11-24-2007, 02:26 PM
See also:
change macro? (toolbar check button that controls a macro)
It shows how to check a toolbar button.
----
Also found this:
Function Toolbar8Proc
Toolbar Toolbar8
Macro Macro15
It shows how to change toolbar button icon at run time. Create function, toolbar and macro. Run toolbar. Click the button or run the macro to see how it works.
----
And this:
Can a menu/toolbar item's text-title be a string variable?
Function that changes button text.
change macro? (toolbar check button that controls a macro)
It shows how to check a toolbar button.
----
Also found this:
Function Toolbar8Proc
;/Toolbar8
function# hWnd message wParam lParam
def TB_GETIMAGELIST (WM_USER + 49)
def TB_CHANGEBITMAP (WM_USER + 43)
dll user32 #UpdateWindow hWnd
type TBBLINK htb iic is
int i hil hic button icon
TBBLINK* p
button=2 ;;toolbar button index. This is line index, including comments.
icon=0 ;;real button index (not including comments)
sel message
,case WM_CREATE
,;PostMessage hWnd WM_APP 1 0
,SetProp hWnd "p" p._new
,case WM_DESTROY
,p=+GetProp(hWnd "p"); p._delete
,
,case WM_APP
,p=+GetProp(hWnd "p")
,if(!p.htb)
,,p.htb=id(9999 hWnd)
,,hil=SendMessage(p.htb TB_GETIMAGELIST 0 0)
,,hic=GetIcon("$qm$\mouse.ico")
,,p.iic=ImageList_ReplaceIcon(hil -1 hic)
,,DestroyIcon hic
,if(wParam) SetTimer hWnd 0 300 0; p.is=0; goto g1
,else KillTimer hWnd 0; p.is=1; goto g1
,
,case WM_TIMER
,;g1
,p=+GetProp(hWnd "p")
,p.is^1
,SendMessage p.htb TB_CHANGEBITMAP button iif(p.is p.iic icon)
,UpdateWindow p.htb
,
,Toolbar Toolbar8
Macro Macro15
int h=win("TOOLBAR8" "QM_Toolbar")
PostMessage h WM_APP 1 0
5
PostMessage h WM_APP 0 0It shows how to change toolbar button icon at run time. Create function, toolbar and macro. Run toolbar. Click the button or run the macro to see how it works.
----
And this:
Can a menu/toolbar item's text-title be a string variable?
Function that changes button text.
