When using DCMENUBAR, I would like the first submenu (DCSUBMENU) to be visible immediately. It always appears hidden. What can I do to make the first submenu visible?
Best regards.
START DCMENUBAR SHOWING THE FIRST DCSUBMENU
-
- Posts: 176
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
Perhaps you can send an PostAppEvent(xbeP_ItemSelected, , , oMyMenuBar) from the EVAL block of your DCREAD GUI.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
The Windows Menu System has always been the weakest GUI class of all.
I wrote the below sample program, hoping it would work, only to finally see the last sentence in the docs.
Windows does not support this method.
Sorry, I have no solution for you.
I wrote the below sample program, hoping it would work, only to finally see the last sentence in the docs.
Windows does not support this method.
Sorry, I have no solution for you.
Code: Select all
#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"
FUNCTION Main()
LOCAL GetList[0], oMenuBar, oSubMenu1, oSubMenu2, oSubMenu3
DCMENUBAR oMenuBar
DCSUBMENU oSubMenu1 PROMPT 'SubMenu 1' PARENT oMenuBar
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu1
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu1
DCSUBMENU oSubMenu2 PROMPT 'SubMenu 2' PARENT oMenuBar
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu2
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu2
DCSUBMENU oSubMenu3 PROMPT 'SubMenu 3' PARENT oMenuBar
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu3
DCMENUITEM 'Menu Item 1' ACTION {||nil} PARENT oSubMenu3
DCREAD GUI EVAL {||oSubMenu2:selectItem(2), ;
PostAppEvent(xbeMENB_BeginMenu,,,oMenuBar)}
RETURN nil
PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.
-
- Posts: 176
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
I have made the suggestions that you have given me, but I cannot activate the first submenu, by automatic means
Since there are no methods for controlling DCMENUBAR, try using dcputkey, but it doesn't work either
DCSUBMENU oFileMenu PROMPT "& File" PARENT oMenuBar
DCMENUITEM "& Open a File" PARENT oFileMenu; ACTION {|| Msgbox ('OpenFile')};
DCMENUITEM "& Close File" PARENT oFileMenu; ACTION {|| Msgbox ('CloseFile')}
DOES NOT ACTIVATE WITH
DCPUSHBUTTON ACTION {|| DC_PUTKEY (K_ALT_F)}
DOES NOT ACTIVATE WITH HANDLERBLOCK
DCREAD GUI PARENT AREADLG HANDLERBLOCK {|| DC_PUTKEY (K_ALT_F)}
NOT ACTIVATED WITH EVAL
DCREAD GUI PARENT AREADLG EVAL {|| DC_PUTKEY (K_ALT_F)}
Can you help me?
Best regards
Since there are no methods for controlling DCMENUBAR, try using dcputkey, but it doesn't work either
DCSUBMENU oFileMenu PROMPT "& File" PARENT oMenuBar
DCMENUITEM "& Open a File" PARENT oFileMenu; ACTION {|| Msgbox ('OpenFile')};
DCMENUITEM "& Close File" PARENT oFileMenu; ACTION {|| Msgbox ('CloseFile')}
DOES NOT ACTIVATE WITH
DCPUSHBUTTON ACTION {|| DC_PUTKEY (K_ALT_F)}
DOES NOT ACTIVATE WITH HANDLERBLOCK
DCREAD GUI PARENT AREADLG HANDLERBLOCK {|| DC_PUTKEY (K_ALT_F)}
NOT ACTIVATED WITH EVAL
DCREAD GUI PARENT AREADLG EVAL {|| DC_PUTKEY (K_ALT_F)}
Can you help me?
Best regards
-
- Posts: 176
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
I could already solve the problem.
I already make visible, without user intervention, the first submenu of a menu bar, writing the postappevent statement before the READ GUI
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar
DCMENUITEM "&Open a File" PARENT oFileMenu ; ACTION {||Msgbox('OpenFile')}
DCMENUITEM "&Close File" PARENT oFileMenu ; ACTION {||Msgbox('CloseFile')}
PostAppEvent( xbeP_Keyboard, XBEK_ALT_F ,, oDLGmain )
DCREAD GUI PARENT oDLGmain
Best regards
I already make visible, without user intervention, the first submenu of a menu bar, writing the postappevent statement before the READ GUI
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar
DCMENUITEM "&Open a File" PARENT oFileMenu ; ACTION {||Msgbox('OpenFile')}
DCMENUITEM "&Close File" PARENT oFileMenu ; ACTION {||Msgbox('CloseFile')}
PostAppEvent( xbeP_Keyboard, XBEK_ALT_F ,, oDLGmain )
DCREAD GUI PARENT oDLGmain
Best regards
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
Aha, sending the event to the dialog instead of the menu worked. Congrats.
The eXpress train is coming - and it has more cars.
-
- Posts: 176
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
Re: START DCMENUBAR SHOWING THE FIRST DCSUBMENU
Exactly, Roger.
Thanks.
Thanks.