You can use Rez compiler.
Try the example bellow.

Regards

Bozidar

// 'MENU' resource type definition
type 'MENU' {
  integer SYS_EDIT_MENU = 10000;
  fill byte[12];
  pstring;
  array {
    pstring SEPARATOR = "-";
    fill byte;
    char NONE = "\$00";
    fill byte[2];
    };
  byte = 0;
};

// 'MBAR' resource type definition
type 'MBAR' {
  integer = $$CountOf( menus );
  array menus {
    integer;
    };
};

// Menu and menu bar resources
resource 'MENU' (1200) {
  1200,
  "Record",
    {
    "Add Record ", "A",
    "Delete Record", "D",
    SEPARATOR, NONE,
    "Delete Note", NONE,
    };
};
                
resource 'MENU' (1100) {
  SYS_EDIT_MENU,
  "Edit",
    {
    "Undo", "U",
    "Cut", "X",
    "Copy", "C",
    "Paste", "P",
    "Select All", "S",
    SEPARATOR, NONE,
    "Keyboard", "K",
    "Graffiti", "G"
    };
};

resource 'MENU' (1000) {
  1000,
  "Options",
    {
    "Preferences...", "R",
    SEPARATOR, NONE,
    "About ...", "A"
    };
};

// attach (in Constructor, but do not create menus in Constructor)
// 1000 as manu bar ID for the first form, and 1100 for the second
resource 'MBAR' (1000) {
  {1100, 1000};
};

resource 'MBAR' (1100) {
  {1100, 1200};
};



> Hi all,
> 
> There are several menues in my app., both having the same pull-down
> menue (say, "Edit", or "Help"). Currently, each menue resource
> contains it's own copy of this pull-down.
> 
> Is there a way to make it common for both menues?
> 
> MenuBarType contains a pointer to the list of pull-down menues
> (MenuPullDownPtr menus), but there's no API to alter this list.
> 
> Thanks in advance,
> Ivan
> 
> 

Reply via email to