summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-05-30 07:07:20 +0000
committerOliver Bolte <obo@openoffice.org>2008-05-30 07:07:20 +0000
commitd1e9ee6c216291f81b9162e7c2608551342bc7a2 (patch)
treeeba85f2c9f2da14e83bda78fa62a377372ef4cc1
parente8965f49de9a0f07d9b1455232a258341ec5da19 (diff)
INTEGRATION: CWS aquavcl07 (1.161.4); FILE MERGED
2008/05/14 20:23:09 pl 1.161.4.7: #i78832# event propagation for native popup menus 2008/05/14 12:15:29 pl 1.161.4.6: #i78832# do not keep pointer to destroyed window 2008/05/13 17:48:38 pl 1.161.4.5: #i78832# do not derefrence NULL pointer 2008/05/13 13:50:44 fne 1.161.4.4: #i78832# return correct selected item id 2008/05/13 09:51:26 fne 1.161.4.3: #i78832# correctly shut down popup window 2008/05/09 09:07:23 pl 1.161.4.2: RESYNC: (1.161-1.162); FILE MERGED 2008/05/08 12:24:32 fne 1.161.4.1: #i78832# implementation of native context menus for aqua
-rw-r--r--vcl/source/window/menu.cxx32
1 files changed, 30 insertions, 2 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 666f4e4c1c8c..0f9951685557 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: menu.cxx,v $
- * $Revision: 1.162 $
+ * $Revision: 1.163 $
*
* This file is part of OpenOffice.org.
*
@@ -1129,6 +1129,17 @@ void Menu::Select()
}
}
+void Menu::ImplSelectWithStart( Menu* pSMenu )
+{
+ Menu* pOldStartedFrom = pStartedFrom;
+ pStartedFrom = pSMenu;
+ Menu* pOldStartedStarted = pOldStartedFrom ? pOldStartedFrom->pStartedFrom : NULL;
+ Select();
+ if( pOldStartedFrom )
+ pOldStartedFrom->pStartedFrom = pOldStartedStarted;
+ pStartedFrom = pOldStartedFrom;
+}
+
void Menu::RequestHelp( const HelpEvent& )
{
}
@@ -3385,6 +3396,11 @@ void PopupMenu::SelectEntry( USHORT nId )
}
}
+void PopupMenu::SetSelectedEntry( USHORT nId )
+{
+ nSelectedId = nId;
+}
+
USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
{
return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN );
@@ -3549,7 +3565,19 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
// pWin->GrabFocus();
if ( GetItemCount() )
{
- pWin->StartPopupMode( aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS );
+ SalMenu* pMenu = ImplGetSalMenu();
+ if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+ {
+ pWin->StopExecute(0);
+ pWin->doShutdown();
+ pWindow->doLazyDelete();
+ pWindow = NULL;
+ return nSelectedId;
+ }
+ else
+ {
+ pWin->StartPopupMode( aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS );
+ }
if( pSFrom )
{
USHORT aPos;