+
+void UMAAppendSubMenuItem( MenuRef menu , StringPtr l , SInt16 id )
+{
+ Str255 label ;
+ memcpy( label , l , l[0]+1 ) ;
+ // hardcoded adding of the submenu combination for mac
+
+ int theEnd = label[0] + 1;
+ if (theEnd > 251)
+ theEnd = 251; // mac allows only 255 characters
+ label[theEnd++] = '/';
+ label[theEnd++] = hMenuCmd;
+ label[theEnd++] = '!';
+ label[theEnd++] = id ;
+ label[theEnd] = 0x00;
+ label[0] = theEnd;
+ MacAppendMenu(menu, label);
+}
+
+void UMAInsertSubMenuItem( MenuRef menu , StringPtr l , MenuItemIndex item , SInt16 id )
+{
+ Str255 label ;
+ memcpy( label , l , l[0]+1 ) ;
+ // hardcoded adding of the submenu combination for mac
+
+ int theEnd = label[0] + 1;
+ if (theEnd > 251)
+ theEnd = 251; // mac allows only 255 characters
+ label[theEnd++] = '/';
+ label[theEnd++] = hMenuCmd;
+ label[theEnd++] = '!';
+ label[theEnd++] = id;
+ label[theEnd] = 0x00;
+ label[0] = theEnd;
+ MacInsertMenuItem(menu, label , item);
+}
+
+void UMAAppendMenuItem( MenuRef menu , StringPtr l , SInt16 key, UInt8 modifiers )
+{
+ Str255 label ;
+ memcpy( label , l , l[0]+1 ) ;
+ if ( key )
+ {
+ int pos = label[0] ;
+ label[++pos] = '/';
+ label[++pos] = toupper( key );
+ label[0] = pos ;
+ }
+ MacAppendMenu( menu , label ) ;
+}
+
+void UMAInsertMenuItem( MenuRef menu , StringPtr l , MenuItemIndex item , SInt16 key, UInt8 modifiers )
+{
+ Str255 label ;
+ memcpy( label , l , l[0]+1 ) ;
+ if ( key )
+ {
+ int pos = label[0] ;
+ label[++pos] = '/';
+ label[++pos] = toupper( key );
+ label[0] = pos ;
+ }
+ MacInsertMenuItem( menu , label , item) ;
+}
+
+void UMADrawMenuBar()
+{
+ DrawMenuBar() ;
+}
+
+
+void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label )
+{
+ ::SetMenuItemText( menu , item , label ) ;
+}
+
+MenuRef UMANewMenu( SInt16 menuid , StringPtr label )
+{
+ return ::NewMenu(menuid, label);
+}
+
+void UMADisposeMenu( MenuRef menu )
+{
+ DisposeMenu( menu ) ;
+}
+void UMADeleteMenu( SInt16 menuId )
+{
+ ::DeleteMenu( menuId ) ;
+}
+
+void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId )
+{
+ ::InsertMenu( insertMenu , afterId ) ;
+}
+
+