Posts: 69
Threads: 42
Joined: Jun 2006
In a toolbar like this:
Item1
Item2
Item3
I would like, by clicking on Item1, to toggle compressing/expanding Item2. So, the first time I click on Item1, the toolbar should appear like this:
>Item1
Item3
The second time I click on Item1, the toolbar should appear like this:
vItem1
Item2
Item3
and so on.
Posts: 12,140
Threads: 142
Joined: Dec 2002
Function
ToolbarButtonsShowHide
;/
function nButtons
;Hides or shows buttons of a QM user toolbar.
;nButtons - the number of buttons to hide/show. Actually it is the number of lines in toolbar text.
;This function must be called from that toolbar. It hides/shows buttons that follow the clicked button. It makes the clicked button checked when hides.
int htb=id(9999 TriggerWindow)
POINT p; xm p htb 1
int button=SendMessage(htb TB_HITTEST 0 &p)
int firstButton=button+1
int hide=!SendMessage(htb TB_ISBUTTONHIDDEN firstButton 0)
SendMessage(htb TB_CHECKBUTTON button hide)
int i
for i firstButton firstButton+nButtons
,if !SendMessage(htb TB_HIDEBUTTON i hide)
,,;if failed, it is probably a separator, id -1
,,if SendMessage(htb TB_SETCMDID i -i)
,,,SendMessage(htb TB_HIDEBUTTON -i hide)
example
Toolbar
Toolbar3
0 :out 0
-
,Hide/Show buttons :ToolbarButtonsShowHide 3 *$qm$\droparrow.ico
1 :out 1
2 :out 2
-
3 :out 3
Posts: 69
Threads: 42
Joined: Jun 2006