Good morning everyone, I have a need that is: When you click the menu it does not short.
Use the class TMenu () and as standard and we all know, whenever I click the menu item to add the active bAction for the menuitem you set.
Anyone know where is the command to give a 'hide ()' on the menu? why everything must be programmed even that. Or someone would have a solution to always return the 'focus' on the menuitem I selected the last time?
Disappearance menu
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Disappearance menu
Arthur,
Do you mean that you want to hide the menu ?
Or that you want the selected menuitem to remain visible and selected ?
It is not clear what you are looking for
Do you mean that you want to hide the menu ?
Or that you want the selected menuitem to remain visible and selected ?
It is not clear what you are looking for
- arthursilvestre
- Posts: 32
- Joined: Thu Sep 20, 2012 7:29 pm
Re: Disappearance menu
I want to measure the action menuitem to run it back to the menuitem aq refers. example:
menu 1 -> Menu 1.3 -> 1.3.2 MenuItem
and perform the action when it returns to the position that menuitem
ps: these 1, 1.3 and 1.3.2 are orden menus (so imagined)
menu 1 -> Menu 1.3 -> 1.3.2 MenuItem
and perform the action when it returns to the position that menuitem
ps: these 1, 1.3 and 1.3.2 are orden menus (so imagined)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Disappearance menu
Do you mean that you select a menuitem, and after executing its action, the menu remains open and the menuitem is selected ?
Code: Select all
// A sample for use a simply menu...
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
DEFINE WINDOW oWnd TITLE "Testing Menus" ;
MENU BuildMenu()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
local oMenu, oItOne
MENU oMenu
MENUITEM oItOne PROMPT "&One"
MENU
MENUITEM "&First" ;
ACTION ( MsgInfo( "first" ), oMenu:Hilite( 1 ) )
MENUITEM "&Second"
SEPARATOR
MENUITEM "End" ACTION oWnd:End()
ENDMENU
MENUITEM "Two"
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
- arthursilvestre
- Posts: 32
- Joined: Thu Sep 20, 2012 7:29 pm
Re: Disappearance menu
Morning antonio, the logic is exactly this, but this example you just gave me the menu leaves "one" Not Made selected but he is open. I would like him to stay open.
ps: this would work for a menu with 4 sub-menus?
I appreciate the attention you have given.
ps: this would work for a menu with 4 sub-menus?
I appreciate the attention you have given.
- arthursilvestre
- Posts: 32
- Joined: Thu Sep 20, 2012 7:29 pm
Re: Disappearance menu
With this his test, after I click the ok from msginfo, looks like this:
I want to be like this:
I want to be like this:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Disappearance menu
Unfortunately Windows does not provide such feature.
The only workaround that I can think of is to send "Alt" + "O" to the main window, but we need to find how to generate Alt.
The only workaround that I can think of is to send "Alt" + "O" to the main window, but we need to find how to generate Alt.
- arthursilvestre
- Posts: 32
- Joined: Thu Sep 20, 2012 7:29 pm
Re: Disappearance menu
tried in many ways 'simulate' keystrokes, but could not. used both
___Keyboard (Chr (18))
as
keybd_event (chr (18), 0x45, 0x0001 | 0,1)
___Keyboard (Chr (18))
as
keybd_event (chr (18), 0x45, 0x0001 | 0,1)