#include "FiveWin.ch"
function Main()
local oWnd, oBar1, oBar2, oBar3, oBar4
DEFINE WINDOW oWnd FROM 1, 5 TO 20, 75 ;
TITLE "Up Your Cash Flow XT2-2009" ;
MENU BUILDMENU() ;
COLOR CLR_GRAY, CLR_GRAY
DEFINE BUTTONBAR oBar2 SIZE 33, 33 3D OF oWnd
DEFINE BUTTONBAR oBar3 SIZE 33, 33 3D OF oWnd
DEFINE BUTTONBAR oBar4 SIZE 33, 33 3D OF oWnd
DEFINE BUTTONBAR oBar1 SIZE 33, 33 3D OF oWnd // The last one created remains visible
oBar2:Hide()
oBar3:Hide()
oBar4:Hide()
DEFINE BUTTON OF oBar1 NOBORDER ;
PROMPT "2" ;
TOOLTIP "switch to toolbar 2" ;
ACTION SelBar( oWnd, oBar2 )
DEFINE BUTTON OF oBar2 NOBORDER ;
PROMPT "3" ;
TOOLTIP "switch to toolbar 3" ;
ACTION SelBar( oWnd, oBar3 )
DEFINE BUTTON OF oBar3 NOBORDER ;
PROMPT "4" ;
TOOLTIP "switch to toolbar 4" ;
ACTION SelBar( oWnd, oBar4 )
DEFINE BUTTON OF oBar4 NOBORDER ;
PROMPT "1" ;
TOOLTIP "switch to toolbar 1" ;
ACTION SelBar( oWnd, oBar1 )
ACTIVATE WINDOW oWnd
return nil
function SelBar( oWnd, oBar )
oWnd:oBar:Hide()
oWnd:oBar = oBar
oWnd:Resize()
oBar:Show()
return nil
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "A menuitem"
ENDMENU
return oMenu
#include 'fivewin.ch'
#include 'folder.ch'
static oWnd
static oPanel
static aBars[2], nBar
static oTabs
function main()
DEFINE WINDOW oWnd //MDI
MakeBar()
ACTIVATE WINDOW ownd
return nil
static function MakeBar()
@ 0,0 TABS oTabs OF oWnd ;
ITEMS 'One', 'Two' ACTION SetBar( nOption )
oWnd:oTop := oTabs
oPanel := TPanel():New(,,,,oWnd)
oWnd:oClient := oPanel
DEFINE BUTTONBAR aBars[ 2 ] OF oPanel SIZE 80,40 2007
DEFINE BUTTON OF aBars[ 2 ] PROMPT 'Second-1' FLAT ACTION MsgInfo( This:cCaption )
DEFINE BUTTON OF aBars[ 2 ] PROMPT 'Second-2' FLAT ACTION MsgInfo( This:cCaption )
aBars[ 2 ]:Hide()
DEFINE BUTTONBAR aBars[ 1 ] OF oPanel SIZE 80,40 2007
DEFINE BUTTON OF aBars[ 1 ] PROMPT 'First-1' FLAT ACTION MsgInfo( This:cCaption )
DEFINE BUTTON OF aBars[ 1 ] PROMPT 'First-2' FLAT ACTION MsgInfo( This:cCaption )
aBars[ 1 ]:Hide()
SetBar( 1 )
return nil
static function SetBar( nOption )
if nBar != nOption
if nBar != nil
aBars[ nBar ]:Hide()
endif
nBar := nOption
oPanel:oBar := aBars[ nBar ]
oPanel:Resize()
aBars[ nBar ]:Show()
endif
return nil
#include 'fivewin.ch'
function Main()
local oWnd, oPanel
DEFINE WINDOW oWnd MDI
oPanel = TPanel():New( ,,,, oWnd )
oPanel:nHeight = 80
oWnd:oTop = oPanel
ACTIVATE WINDOW oWnd
return nil
#include 'fivewin.ch'
function Main()
local oWnd, oPanel, oTabs
DEFINE WINDOW oWnd MDI
oPanel = TPanel():New( ,,,,oWnd )
oPanel:nHeight = 80
oWnd:oTop = oPanel
@ 0, 0 TABS oTabs OF oPanel ;
ITEMS 'One', 'Two'
oPanel:oTop = oTabs
ACTIVATE WINDOW ownd
return nil
#include 'fivewin.ch'
function Main()
local oWnd, oPanel, oTabs, aBars[ 2 ]
DEFINE WINDOW oWnd MDI
oPanel = TPanel():New( ,,,,oWnd )
oPanel:nHeight = 57
oWnd:oTop = oPanel
@ 0, 0 TABS oTabs OF oPanel ;
ITEMS 'One', 'Two' ACTION SetBar( nOption, aBars )
DEFINE BUTTONBAR aBars[ 1 ] OF oPanel SIZE 80,40 2007
DEFINE BUTTON OF aBars[ 1 ] PROMPT 'First-1' FLAT ACTION MsgInfo( This:cCaption )
DEFINE BUTTON OF aBars[ 1 ] PROMPT 'First-2' FLAT ACTION MsgInfo( This:cCaption )
DEFINE BUTTONBAR aBars[ 2 ] OF oPanel SIZE 80,40 2007
DEFINE BUTTON OF aBars[ 2 ] PROMPT 'Second-1' FLAT ACTION MsgInfo( This:cCaption )
DEFINE BUTTON OF aBars[ 2 ] PROMPT 'Second-2' FLAT ACTION MsgInfo( This:cCaption )
aBars[ 2 ]:Hide()
oPanel:oTop = oTabs
oPanel:oBar = nil
oPanel:oClient = aBars[ 1 ]
oPanel:ReSize()
ACTIVATE WINDOW ownd
return nil
static function SetBar( nOption, aBars )
local nBar := AScan( aBars, { | oBar | IsWindowVisible( oBar:hWnd ) } )
aBars[ nBar ]:Hide()
aBars[ nOption ]:oWnd:oClient = aBars[ nOption ]
aBars[ nOption ]:oWnd:ReSize()
aBars[ nOption ]:Show()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 41 guests