#412 Add test for MENUEX in oodialog.cls

ooDialog.4.2.0
closed
Mark Miesfeld
ooDialog (102)
5
2012-08-27
2010-12-23
hex
No

Using resource editors which creates .rc files with MENUEX in menu resources doesn't work
There is a comment in OODIALOG.CLS
-- TODO we could parse extended menus by looking for MENU and MENUEX

So a test for MENUEX is appreciated.
Replacing the above comment with:
select
when s~wordpos("MENU ") > 0 then n = s~wordpos("MENU ")
when s~wordpos("MENUEX ") > 0 then n = s~wordpos("MENUEX ")
--n = s~wordpos("MENUEX") -- TODO we could parse extended menus by looking for MENU and MENUEX
otherwise
nop
end

will solve the problem

TIA

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2010-12-23

    Thanks for this too.

    As you saw, it is on my TODO list. The problem I had was I couldn't find a resource editor, (at the time,) that produced extended menus to test with.

    What resource editor are you using?

     
  • hex
    hex
    2010-12-23

    I use resedit http://www.resedit.net/ 64bit, but I don't actually know the difference between MENU and MENUEX, I just realize that resedit always create MENUEX but I change in the .rc file to MENU to be able to run oorexx oodialog programs on an unmodified OODIALOG.CLS member and have never seen any problems with that change, so far.
    Resedit is also able to produce .res and .dll files but I have never got it to work with oodialog, maybe my knowledge is to limited in this matter. My learning is raising in the creation of oodialogs and I like the the new oodialog 4.2.

     
  • hex
    hex
    2010-12-23

    And once you change the .rc script file from MENUEX to MENU it's not possible to open the .rc file in resedit again without changing back to MENUEX in .rc script again, Most annoying part I asume.
    Now here (Sweden) it's Christmas eve so Merry Christmas to you all

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-12-24

    I also use ResEdit, and recommend it to others. Unfortunately, I can not get it to produce extended menus.

    MENU is the old style menu resource, while MENUEX is the extended menu resource. There are not a lot of differences, but one difference is that MENUEX allows assigning an ID to separators. Having an ID assigned to a separator allows you to remove them by ID rather than position. This is very convenient in multi-level menus.

    Anyhow, could you attach the .rc file that has the MENUEX in it to this tracker item. I'd like to take a look at it.

     
  • hex
    hex
    2010-12-24

    Well this is a sample .rc dialog with MENUEX
    // Generated by ResEdit 1.5.4
    // Copyright (C) 2006-2010
    // http://www.resedit.net

    include <windows.h>

    include <commctrl.h>

    include <richedit.h>

    include <winuser.h>

    include "errDialog.h"

    //
    // Menu resources
    //
    IDR_MENU1 MENUEX
    BEGIN
    POPUP "File", 0, 0, 0
    BEGIN
    MENUITEM "&New", IDM_FILE_NEW, 0, MFS_GRAYED
    MENUITEM "&Open", IDM_FILE_OPEN, 0, 0
    MENUITEM "&Save", IDM_FILE_SAVE, 0, MFS_GRAYED
    MENUITEM "Save as...", IDM_FILE_SAVEAS, 0, MFS_GRAYED
    MENUITEM "", 0, MFT_SEPARATOR, 0
    MENUITEM "Exit", IDM_EXIT1, 0, 0
    END
    POPUP "Edit", 0, 0, 0
    BEGIN
    MENUITEM "&Copy Ctrl+C", IDM_EDIT_COPY, 0, 0
    MENUITEM "Paste Ctrl+V", IDM_EDIT_PASTE, 0, 0
    END
    POPUP "Help", 0, 0, 0
    BEGIN
    MENUITEM "Help F1", IDM_HELP, 0, 0
    MENUITEM "About", IDM_ABOUT, 0, 0
    END
    END

    //
    // Dialog resources
    //
    IDD_DIALOG1 DIALOGEX 0, 0, 580, 233
    STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
    CAPTION "Dialog"
    MENU IDR_MENU1
    FONT 8, "Ms Shell Dlg", 400, 0, 1
    BEGIN
    DEFPUSHBUTTON "OK", IDOK, 457, 202, 50, 14, 0, WS_EX_TRANSPARENT
    PUSHBUTTON "Cancel", IDCANCEL, 517, 202, 50, 14
    CONTROL "", IDC_LIST1, WC_LISTVIEW, WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_NOLABELWRAP | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_REPORT, 167, 23, 400, 110, WS_EX_CLIENTEDGE | WS_EX_RIGHT
    PUSHBUTTON "Delete", IDC_Delete, 172, 143, 26, 14
    END

    //
    // Icon resources
    //
    IDI_ICON1 ICON ".\App.ico"

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-12-30

    The current code to parse a MENU resource does not parse a MENUEX resource correctly, in that it does not recognize any of the extended features for menus.

    However, it does generate an in-memory MENU template from the MENUEX resource. I reworked the code so that it will accept either a MENU or a MENUEX resource in a .rc script file.

    On a side note, mye ResEdit is also 1.5.4 and it only produces MENU resources, will not produce MENUEX resources. I'd be interested in knowing if you have to do or set anythign special to get it to produce the MENUEX resource?

     
  • hex
    hex
    2010-12-30

    About resedit producing MENUEX, I think it happens when you in the editor /rc file set a menuitem to GRAYED for example, But it seems that it's dependent on the SDK used and/or OS. At home using win7 and SDK7 it produces menuex (GRAYED is set to MFS_GRAYED for menuitem in rc file) . At work using WinXP and sdk win2003 server, RESEDIT does NOT produce MENUEX (GRAYED is just GRAYED for an menuitem in the rc file). Maybe that also explains why I at work can't open an rc file with a menuex statement i resedit.

    Or shorter, I have no idea how/when it happens :-)

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-12-30

    I tried resedit on Windows 7 where I have the latest SDK. Also tried graying some of the menu items. Still no luck.

    I'm going to close this RFE now, the next ooDialog build will handle either MENU or MENUEX in .rc resource script files.

     


Anonymous


Cancel   Add attachments