Page 1 of 1

Disappearance menu

Posted: Mon Oct 14, 2013 11:43 am
by arthursilvestre
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?

Re: Disappearance menu

Posted: Mon Oct 14, 2013 1:00 pm
by Antonio Linares
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

Re: Disappearance menu

Posted: Mon Oct 14, 2013 1:56 pm
by arthursilvestre
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)

Re: Disappearance menu

Posted: Tue Oct 15, 2013 5:53 am
by Antonio Linares
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

//----------------------------------------------------------------------------//
 

Re: Disappearance menu

Posted: Tue Oct 15, 2013 11:24 am
by arthursilvestre
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.

Re: Disappearance menu

Posted: Tue Oct 15, 2013 11:41 am
by arthursilvestre
With this his test, after I click the ok from msginfo, looks like this:
Image

I want to be like this:
Image

Re: Disappearance menu

Posted: Tue Oct 15, 2013 2:29 pm
by Antonio Linares
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.

Re: Disappearance menu

Posted: Tue Oct 15, 2013 2:46 pm
by arthursilvestre
tried in many ways 'simulate' keystrokes, but could not. used both
___Keyboard (Chr (18))
as
keybd_event (chr (18), 0x45, 0x0001 | 0,1)