How do I program Menus with default submenu action - OS2

This is a discussion on How do I program Menus with default submenu action - OS2 ; In some programs there are menus which do not fall into the standard drop down or pop up menu catagory and I cann't find them documented or how to program them. The best way to describe this type of menu ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How do I program Menus with default submenu action

  1. How do I program Menus with default submenu action

    In some programs there are menus which do not fall into the standard drop
    down or pop up menu catagory and I cann't find them documented or how to
    program them.

    The best way to describe this type of menu is to to take the example of
    using the right hand mouse button on the desktop. When the MB2 is pressed a
    sort of popup menu is presented. On my system (ecs 1.2) it looks like this

    Open As ?
    Properties Ctrl+Shift+S
    Open Parent Backspace
    Help ?
    ______________________________________
    Paste....
    Create Shadow....
    Find........
    View ?
    ..
    ..
    ..
    ETC


    Taking the top line as an example, if I just click on the line but not on
    the submenu button ? then the default action (as defined in the sub menu)
    occurs. Alternatively I can go to the right of the line and by presiing the
    ? button open the sub menu I can select any one of the sub menu items. The
    default item is shown marked in the normal manner.

    Does anyone have any ideas how to program this type of menu in C.

    Keith






  2. Re: How do I program Menus with default submenu action

    On Thu, 10 Nov 2005 22:10:24 +0100, Keith wrote:

    > Taking the top line as an example, if I just click on the line but not on
    > the submenu button ? then the default action (as defined in the sub menu)
    > occurs. Alternatively I can go to the right of the line and by presiing the
    > ? button open the sub menu I can select any one of the sub menu items. The
    > default item is shown marked in the normal manner.
    >
    > Does anyone have any ideas how to program this type of menu in C.


    You need to set the QWL_STYLE of the submenu to MS_CONDITIONALCASCADE.

  3. Re: How do I program Menus with default submenu action

    On Thu, 10 Nov 2005 21:10:24 UTC, "Keith"
    wrote:

    > Does anyone have any ideas how to program this type of menu in C.




    void SetConditionalCascade(HWND hMenu, unsigned uSubMenuID, unsigned
    uDefaultID)
    {
    MENUITEM MenuItem;

    if( WinSendMsg(hMenu, MM_QUERYITEM,
    MPFROM2SHORT(uSubMenuID, TRUE), MPFROMP(&MenuItem)) )
    {
    WinSetWindowBits(MenuItem.hwndSubMenu, QWL_STYLE,
    MS_CONDITIONALCASCADE, MS_CONDITIONALCASCADE);
    WinSendMsg(MenuItem.hwndSubMenu,
    MM_SETDEFAULTITEMID, MPFROMLONG(uDefaultID), MPVOID);
    }
    }




    --
    Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
    http://www.s-t.de
    Please remove all characters left of the "R" in my email address


  4. Re: How do I program Menus with default submenu action

    Thanks for quick respose Guys. Like most things its always easy when you
    know.

    Keith Merrington



+ Reply to Thread