diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/inc/aquavclevents.hxx ooo_SRC680_m177_src/vcl/aqua/inc/aquavclevents.hxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/inc/aquavclevents.hxx	2006-07-20 10:05:57.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/inc/aquavclevents.hxx	2006-07-20 15:48:52.000000000 +0200
@@ -35,4 +35,6 @@
 const EventTypeSpec cWindowResizeStarted = { kEventClassWindow, kEventWindowResizeStarted };
 const EventTypeSpec cWindowResizeCompleted = { kEventClassWindow, kEventWindowResizeCompleted };
 
+const EventTypeSpec cCommandProcessEvent = { kEventClassCommand, kEventCommandProcess };
+
 #endif // INCLUDED_AQUAVCLEVENTS_HXX
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/inc/salmenu.h ooo_SRC680_m177_src/vcl/aqua/inc/salmenu.h
--- ooo_SRC680_m177_src.orig/vcl/aqua/inc/salmenu.h	2006-07-20 10:05:57.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/inc/salmenu.h	2006-07-20 18:54:02.000000000 +0200
@@ -88,8 +88,10 @@
 
 	Menu *myMenu;			// Menu into which this MenuItem is inserted
 	CFStringRef sMenuText;		// Title of this menu item
+	unsigned nPos;			// nPos of this menu item
 	MenuRef parentMenuRef;		// The menu in which this menu item is inserted
 	MenuItemIndex myMenuItemIndex;	// The menu index of this menu item in the myMenu menu
+	MenuItemAttributes menuAttributes; // menu attributes of this menu item
 };
 
 #endif // _SV_SALMENU_H
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salframe.cxx ooo_SRC680_m177_src/vcl/aqua/source/window/salframe.cxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salframe.cxx	2006-07-20 10:05:57.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/source/window/salframe.cxx	2006-07-20 16:43:20.000000000 +0200
@@ -680,6 +680,28 @@
     //DbgPrintFrameGeometry(fullWindowRect, contentRect, titleBarRect, maGeometry);
 }
 
+OSStatus HandleCommandProcessEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
+{
+
+    ImplSalYieldMutexAcquire();
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    fprintf(stderr, "PJ: CommandProcess EVENT!\n");
+
+    HICommand commandStruct;
+
+    GetEventParameter (inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &commandStruct);
+
+    // If the CommandProcess event is from menu, print its MenuRef and itemidex
+    if ( commandStruct.attributes & kHICommandFromMenu )
+      fprintf(stderr, "PJ: Menu item selected, MenuRef = %p, (%d. item)\n", commandStruct.menu.menuRef, commandStruct.menu.menuItemIndex);
+
+    //    pSalFrame->CallCallback(SALEVENT_CLOSE, 0);
+    ImplSalYieldMutexRelease();
+
+    return noErr;
+}
+
 OSStatus HandleWindowCloseEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
 {
     BOOST_ASSERT(GetEventClass(inEvent) == kEventClassWindow && GetEventKind(inEvent) == kEventWindowClose && "Only WindowClose event expected");
@@ -1095,6 +1117,8 @@
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleMouseUpDownEvent), GetEventTypeCount(cMouseUpDownEvent), cMouseUpDownEvent);
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleWindowResizeStarted), 1, &cWindowResizeStarted);
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleWindowResizeCompleted), 1, &cWindowResizeCompleted);
+
+    InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleCommandProcessEvent), 1, &cCommandProcessEvent);
 }
 
 OSStatus AquaSalFrame::InstallAndRegisterEventHandler(EventHandlerUPP upp, size_t nEvents, const EventTypeSpec* eventSpec)
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salmenu.cxx ooo_SRC680_m177_src/vcl/aqua/source/window/salmenu.cxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salmenu.cxx	2006-07-20 10:05:57.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/source/window/salmenu.cxx	2006-07-20 21:26:39.000000000 +0200
@@ -82,6 +82,8 @@
 
   AquaSalMenuItem *pSalMenuItem = new AquaSalMenuItem();
 
+  pSalMenuItem->menuAttributes = 0;
+
   pSalMenuItem->sMenuText = CFStringCreateWithFormat(NULL, NULL, CFSTR("%s"),
 			     ByteString(pItemData->aText,RTL_TEXTENCODING_UTF8).GetBuffer());
   fprintf(stderr, "PJ: sMenuText = %s\n",
@@ -92,6 +94,11 @@
   fprintf(stderr, "PJ: nId = %d\n", pItemData->nId);
   fprintf(stderr, "PJ: returning %p\n", pSalMenuItem);
 
+  fprintf(stderr, "PJ: Separator = %d\n", pItemData->eType & MENUITEM_SEPARATOR);
+
+  if (pItemData->eType == MENUITEM_SEPARATOR)
+    pSalMenuItem->menuAttributes |= kMenuItemAttrSeparator;
+  
   return pSalMenuItem;
 }
 
@@ -133,13 +140,14 @@
 
   // save MenuRef of the menu for future reference
   pAquaSalMenuItem->parentMenuRef = myMenuRef;
+  pAquaSalMenuItem->nPos = nPos;
 
   fprintf(stderr, "PJ: bMenuBar = %d\n", bMenuBar);
 
   if (bMenuBar)
-    AppendMenuItemTextWithCFString( myMenuRef, NULL,  0, 0, &pAquaSalMenuItem->myMenuItemIndex);
+    AppendMenuItemTextWithCFString( myMenuRef, NULL,  pAquaSalMenuItem->menuAttributes, 0, &pAquaSalMenuItem->myMenuItemIndex);
   else
-    AppendMenuItemTextWithCFString( myMenuRef, pAquaSalMenuItem->sMenuText,  0, 0, &pAquaSalMenuItem->myMenuItemIndex);
+    AppendMenuItemTextWithCFString( myMenuRef, pAquaSalMenuItem->sMenuText,  pAquaSalMenuItem->menuAttributes, 0, &pAquaSalMenuItem->myMenuItemIndex);
 }
 
 void AquaSalMenu::RemoveItem( unsigned nPos )
@@ -170,6 +178,14 @@
 
 void AquaSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
 {
+  fprintf(stderr, "PJ: ############### EnableItem (%d, %d) #########\n", nPos, bEnable);
+
+  // FIXME: nPos+1 is not correct, we should find out the MenuItem
+  // with nPos and get its MenuItemIndex instead!
+  if (bEnable)
+    EnableMenuItem(this->myMenuRef, nPos+1);
+  else
+    DisableMenuItem(this->myMenuRef, nPos+1);
 }
 
 void AquaSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
diff -urN ooo_SRC680_m177_src.orig/vcl/workben/svdem.cxx ooo_SRC680_m177_src/vcl/workben/svdem.cxx
--- ooo_SRC680_m177_src.orig/vcl/workben/svdem.cxx	2006-07-20 10:05:59.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/workben/svdem.cxx	2006-07-20 17:59:18.000000000 +0200
@@ -130,8 +130,11 @@
   aMainWin.aFileMenu.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Open" ) ));
   PJ_DEBUG("6");
   aMainWin.aFileMenu.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Close" ) ));
-  PJ_DEBUG("7");
-  aMainWin.aFileMenu.InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Exit" ) ));
+  aMainWin.aFileMenu.EnableItem( 2, FALSE);
+  PJ_DEBUG("7 *****************");
+  aMainWin.aFileMenu.InsertSeparator( 3 );
+  PJ_DEBUG("7 *****************");
+  aMainWin.aFileMenu.InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Exit" ) ));
   PJ_DEBUG("8");
 
   aMainWin.aEditMenu.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Search" ) ));
