|
From: <ss...@ma...> - 2012-01-01 15:08:55
|
Hi~
I found a bug on htool.prg, sample code like:
INIT WINDOW ::oDlg MDICHILD OF ::oMDlg TITLE 'TEST';
AT 0, 0 SIZE 600, 400;
STYLE WS_VISIBLE + WS_OVERLAPPEDWINDOW;
FONT ::oFnt[3];
ON SIZE {|o,w,l| MoveWindow( ::oBrw[1]:handle, 0, ::oBar:nHeight+3, ::oDlg:nWidth - 8, ::oDlg:nHeight - ::oBar:nHeight - 37 ) };
ON EXIT {|| ::End() }
@ 0, 0 TOOLBAR ::oBar OF ::oDlg;
SIZE ::oDlg:nWidth, 43;
FONT ::oFnt[1];
TRANSPARENT
ADDTOOLBUTTON ::oBar;
BITMAP 'B_APPEND';
TOOLTIP "Insert";
ON CLICK {|o,id| msginfo('1') } // <---- Bug, run twice.
ON Click have bug and run twice to show '1'.
I had debug and found on htools.prg line 66:
METHOD New(oParent,cName,nBitIp,nId,bState,bStyle,cText,bClick,ctip,aMenu) CLASS
HToolButton
:
:
:
::oParent:oParent:AddEvent( BN_CLICKED, Self, {|| ::ONCLICK()},,"click" ) // <-- disable it and run ok!!
|