Little problem in TWindow
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
In the following sample try to put the mouse pointer over the btnbmp and then press ALT. You will see that the menu is not activated as it does then the mouse pointer is not over the btnbmp.
A possible fix (but I don't know if it is the best one):
EMG
- Code: Select all Expand view
FUNCTION MAIN()
LOCAL oWnd, oMenu, oBar
MENU oMenu
MENUITEM "Test"
MENU
MENUITEM "Test1"
MENUITEM "Test2"
MENUITEM "Test3"
MENUITEM "Test4"
ENDMENU
ENDMENU
DEFINE WINDOW oWnd;
MENU oMenu
DEFINE BUTTONBAR oBar 3D OF oWnd
DEFINE BUTTON OF oBar;
TOOLTIP "This is a test";
NOBORDER
ACTIVATE WINDOW oWnd
RETURN NIL
A possible fix (but I don't know if it is the best one):
- Code: Select all Expand view
METHOD SysCommand( nWParam, nLParam ) CLASS TWindow
local bKeyAction
if ::oBar != nil //EMG
AEval( ::oBar:aControls, { | oCtl | If( oCtl:ClassName() == "TBTNBMP", oCtl:LostFocus(), ) } ) //EMG
endif //EMG
if nWParam == 61696 // VK_F10
if ( bKeyAction := SetKey( VK_F10 ) ) != nil
Eval( bKeyAction, ProcName( 4 ), ProcLine( 4 ), Self )
return 0
endif
endif
if ::oSysMenu != nil .and. nWParam < 61440 // 0xF000
::oSysMenu:Command( nWParam )
else
do case
case nWParam == SC_CLOSE .or. nWParam == SC_CLOSE_OPEN
return ::End()
endcase
endif
return nil
EMG