How to resize oPanel
Posted: Fri Feb 15, 2008 5:37 pm
The new TABs are really nice. Thank you Antonio for the great work.
I tried with a TAB and Panels with a BUTTONBAR on each.
Changing the TAB I hide one Panel and show the other one.
But how can I resize the Panel’s width if I change the windows width.
I tried like this: ON RESIZE ( oPanel:nRight=oWnd:nWidth() ) of the window
but the Panel remains.
Thanks in advance
Otto
I tried with a TAB and Panels with a BUTTONBAR on each.
Changing the TAB I hide one Panel and show the other one.
But how can I resize the Panel’s width if I change the windows width.
I tried like this: ON RESIZE ( oPanel:nRight=oWnd:nWidth() ) of the window
but the Panel remains.
Thanks in advance
Otto
#include "FiveWin.ch"
static oWnd
function Main()
local oBar,oBar2, oPopup, oBtn , oTabs2,oPanel,oPanel2
SetBalloon( .T. ) // Balloon shape required for tooltips
DEFINE WINDOW oWnd TITLE "Office 2007"
@ 8, 0 TABS oTabs2 PROMPTS "&One", "&Two", "T&hree", "&Four" OF oWnd;
BITMAPS "..\bitmaps\16x16\people.bmp", "..\bitmaps\16x16\open2.bmp",;
"..\bitmaps\16x16\print.bmp", "..\bitmaps\16x16\zoom2.bmp" ;
ACTION f_tab(oTabs2:nOption,oPanel,oPanel2)
oWnd:oTop = oTabs2
oPanel := TPanel():New( 18, 0, 75, oWnd:nWidth(), oWnd )
DEFINE BUTTONBAR oBar OF oPanel SIZE 60, 60 2007
DEFINE BUTTON OF oBar ACTION Print() ;
RESOURCE "attach" PROMPT "Attach" TOOLTIP "Attach"
DEFINE BUTTON OF oBar ACTION MsgInfo( "calendar" ) ;
RESOURCE "calendar" PROMPT "Calendar" WHEN .F. TOOLTIP "Calendar"
MENU oPopup POPUP
MENUITEM "One" ACTION MsgInfo( 1 )
MENUITEM "Two" ACTION MsgInfo( 2 )
ENDMENU
DEFINE BUTTON oBtn OF oBar ACTION oBtn:ShowPopup() ;
RESOURCE "people" PROMPT "Clients" GROUP ;
MENU oPopup TOOLTIP "Clients"
DEFINE BUTTON OF oBar ACTION Test() ;
RESOURCE "print" PROMPT "Print" TOOLTIP "Print"
oPanel2 := TPanel():New( 18, 0, 75, oWnd:nWidth(), oWnd )
DEFINE BUTTONBAR oBar2 OF oPanel2 SIZE 60, 60 2007
DEFINE BUTTON OF oBar2 ACTION Print() ;
RESOURCE "attach" PROMPT "Attach" TOOLTIP "Attach"
DEFINE BUTTON OF oBar2 ACTION MsgInfo( "calendar" ) ;
RESOURCE "calendar" PROMPT "Calendar" WHEN .F. TOOLTIP "Calendar"
SET MESSAGE OF oWnd TO "Testing the ButtonBar 2007 Office look" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd ON INIT (oPanel2:hide()) ON RESIZE ( oPanel:nRight=oWnd:nWidth() ) ;
VALID MsgYesNo( "Do you want to end?" )
return nil
//----------------------------------------------------------------------------//
function Print()
local oPrn
PRINTER oPrn PREVIEW
PAGE
oPrn:Say( 2, 2, "Hello" )
ENDPAGE
PAGE
oPrn:Say( 2, 2, "Bye" )
ENDPAGE
ENDPRINT
return nil
//----------------------------------------------------------------------------//
function Test()
local oDlg, cPass := Space( 4 )
DEFINE DIALOG oDlg RESOURCE "test"
REDEFINE GET cPass ID 100 OF oDlg
ACTIVATE DIALOG oDlg CENTERED
MsgInfo( GetGuiResources() )
return nil
//----------------------------------------------------------------------------//
procedure AppSys // XBase++ requirement
return
//----------------------------------------------------------------------------//
func f_tab(nOption,oPanel,oPanel2)
if nOption=2
oPanel:hide()
oPanel2:show()
elseif nOption=1
oPanel2:hide()
oPanel:show()
endif
return