Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compressing and expanding part of a toolbar
#1
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.
#2
Function ToolbarButtonsShowHide
Code:
Copy      Help
;/
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
Code:
Copy      Help
0 :out 0
-
,Hide/Show buttons :ToolbarButtonsShowHide 3 *$qm$\droparrow.ico
1 :out 1
2 :out 2
-
3 :out 3
#3
Wonderful!


Forum Jump:


Users browsing this thread: 1 Guest(s)