Disappearance menu

Post Reply
User avatar
arthursilvestre
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Disappearance menu

Post 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?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disappearance menu

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
arthursilvestre
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: Disappearance menu

Post 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)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disappearance menu

Post 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

//----------------------------------------------------------------------------//
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
arthursilvestre
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: Disappearance menu

Post 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.
User avatar
arthursilvestre
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: Disappearance menu

Post by arthursilvestre »

With this his test, after I click the ok from msginfo, looks like this:
Image

I want to be like this:
Image
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disappearance menu

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
arthursilvestre
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: Disappearance menu

Post 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)
Post Reply