at INIT the height of Bar is 0
on this bar I wish create two bars
each bar (oBar1 or oBar2) is created when his value (lbar1 or lBar2 ) is true ( the final user set if true or false)
and the height of Bar must add of 25
I made also a minimal test to try this problem but I not Found the solution
Someone can Help me pls .thanks
- Code: Select all Expand view
#include "fivewin.ch"
Static oBar
Static oBar1,oBar2 ,oBar3
Static oWnd
Static lBar1,lBar2,lBar3
Function Test()
lBar1:=.t.
lBar2:=.t.
lBar3:=.f.
DEFINE WINDOW oWndMain FROM 0, 0 TO 23, 79 MENU BuildMenu() MDI
SetBar()
ACTIVATE WINDOW oWndMain
return nil
//---------------------------------------------------//
Function SetBar()
DEFINE BUTTONBAR oBar OF oWndMain 3D SIZE 26,1
//------------------------------------------------------------------------------//
IF lBar1
oBar:nHeight+=28
@ oBar:nHeight-28, -1 BUTTONBAR oBar1 OF oBar 3D SIZE oBar:nWidth - 1, 29 ;
BUTTONSIZE 26, 27
oBar1:l2015:=.t.
DEFINE BUTTON OF oBar1 GROUP ;
NOBORDER ;
TOOLTIP "this is bar1" ;
ACTION NIL
DEFINE BUTTON OF oBar1 GROUP ;
NOBORDER ;
ACTION NIL
Endif
//------------------------------------------------------------------------------//
IF lBar2
oBar:nHeight+=28
@ oBar:nHeight-28, -1 BUTTONBAR oBar2 OF oBar 3D SIZE oBar:nWidth - 1, 29 ;
BUTTONSIZE 26, 27
oBar2:l2015:=.t.
DEFINE BUTTON OF oBar2 GROUP ;
NOBORDER ;
ACTION NIL
DEFINE BUTTON OF oBar2 GROUP ;
NOBORDER ;
TOOLTIP "this is bar2" ;
ACTION NIL
Endif
//------------------------------------------------------------------------------//
IF lBar3
oBar:nHeight+=28
@ oBar:nHeight-28, -1 BUTTONBAR oBar3 OF oBar 3D SIZE oBar:nWidth - 1, 29 ;
BUTTONSIZE 26, 27
oBar3:l2015:=.t.
DEFINE BUTTON OF oBar3 GROUP ;
NOBORDER ;
TOOLTIP "this is bar3" ;
ACTION NIL
DEFINE BUTTON OF oBar3 GROUP ;
NOBORDER ;
ACTION NIL
Endif
//------------------------------------------------------------------------------//
return nil
function BuildMenu()
LOCAL oMenu
MENU oMenu 2015
//--------------------------------------------------------------------------------------------------------//
MENUITEM "&Help"
MENU
MENUITEM "&About FivePad..." RESOURCE "Help" ;
MESSAGE "Displays program information, version number and " + ;
"copyright" ;
ACTION NIL
MENUITEM "&Statistic." RESOURCE "Help" ;
MESSAGE " " ;
ACTION NIL
ENDMENU
ENDMENU
RETURN oMenu
it run ok ..only there is a space from Menu and the first bar .....
but Perhaps there is another method ?