Tag: cws_dev300_dba30d
User: fs      
Date: 2008-05-29 11:33:20+0000
Modified:
   dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx
   dba/dbaccess/source/ui/app/AppDetailPageHelper.hxx

Log:
 in preparation of #i80943#: implement IContextMenuProvider

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppDetailPageHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx?r1=1.32&r2=1.32.10.1
Delta lines:  +20 -8
--------------------
--- AppDetailPageHelper.cxx     2008-05-05 15:52:11+0000        1.32
+++ AppDetailPageHelper.cxx     2008-05-29 11:33:17+0000        1.32.10.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppDetailPageHelper.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.32.10.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -763,8 +763,8 @@
        _pTreeView->setPasteHandler(LINK(this, OAppDetailPageHelper, 
OnPasteEntry));
        _pTreeView->setDeleteHandler(LINK(this, OAppDetailPageHelper, 
OnDeleteEntry));
 
-       
_pTreeView->setContextMenuActionListener(getBorderWin().getView()->getCommandController());
-       
_pTreeView->setControlActionListener(getBorderWin().getView()->getActionListener());
+       _pTreeView->setControlActionListener( 
getBorderWin().getView()->getActionListener() );
+       _pTreeView->setContextMenuProvider( this );
 
        return _pTreeView;
 }
@@ -1015,7 +1015,7 @@
                                nSelectedAction = SID_DB_APP_VIEW_DOC_PREVIEW;
                                break;
                        case E_DOCUMENTINFO:
-                               if ( 
getBorderWin().getView()->getCommandController()->isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW)
 )
+                               if ( 
getCommandController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) )
                                        nSelectedAction = 
SID_DB_APP_VIEW_DOCINFO_PREVIEW;
                                else
                                        m_ePreviewMode = E_PREVIEWNONE;
@@ -1196,7 +1196,6 @@
        m_aTBPreview.Update();
 
        // execute the menu
-       IController* pControler = 
getBorderWin().getView()->getCommandController();
        ::std::auto_ptr<PopupMenu> aMenu(new PopupMenu( ModuleRes( 
RID_MENU_APP_PREVIEW ) ));
 
        sal_uInt16 pActions[] = { SID_DB_APP_DISABLE_PREVIEW
@@ -1208,7 +1207,7 @@
        {
                
aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i]));
        }
-       aMenu->EnableItem( SID_DB_APP_VIEW_DOCINFO_PREVIEW, 
pControler->isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) );
+       aMenu->EnableItem( SID_DB_APP_VIEW_DOCINFO_PREVIEW, 
getCommandController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) );
 
        // no disabled entries
        aMenu->RemoveDisabledEntries();
@@ -1222,10 +1221,23 @@
        {
                m_aTBPreview.SetItemText(SID_DB_APP_DISABLE_PREVIEW, 
aMenu->GetItemText(nSelectedAction));
                Resize();
-               
getBorderWin().getView()->getCommandController()->executeChecked(nSelectedAction,Sequence<PropertyValue>());
+               
getCommandController().executeChecked(nSelectedAction,Sequence<PropertyValue>());
        }
        return 0L;
 }
+
+// 
-----------------------------------------------------------------------------
+PopupMenu* OAppDetailPageHelper::getContextMenu( Control& /*_rControl*/ )
+{
+    return new PopupMenu( ModuleRes( RID_MENU_APP_EDIT ) );
+}
+
+// 
-----------------------------------------------------------------------------
+IController& OAppDetailPageHelper::getCommandController()
+{
+    return getBorderWin().getView()->getCommandController();
+}
+
 // 
-----------------------------------------------------------------------------
 void OAppDetailPageHelper::KeyInput( const KeyEvent& rKEvt )
 {

File [changed]: AppDetailPageHelper.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppDetailPageHelper.hxx?r1=1.14&r2=1.14.30.1
Delta lines:  +12 -5
--------------------
--- AppDetailPageHelper.hxx     2008-04-10 13:56:48+0000        1.14
+++ AppDetailPageHelper.hxx     2008-05-29 11:33:17+0000        1.14.30.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppDetailPageHelper.hxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.30.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -65,6 +65,7 @@
 #ifndef _GRFMGR_HXX
 #include <goodies/grfmgr.hxx>
 #endif
+#include "callbacks.hxx"
 #include <memory>
 
 namespace com{ namespace sun { namespace star { namespace awt   { class 
XWindow; } } } }
@@ -108,7 +109,8 @@
        // A helper class for the controls in the detail page.
        // Combines general functionality.
        //==================================================================
-       class OAppDetailPageHelper : public Window
+       class OAppDetailPageHelper  :public Window
+                                ,public IContextMenuProvider
        {
                DBTreeListBox*          m_pLists[CONTROL_COUNT];
                OAppBorderWindow&       m_rBorderWin;
@@ -206,6 +208,7 @@
 
                inline OAppBorderWindow& getBorderWin() const { return 
m_rBorderWin; }
                void ImplInitSettings();
+
        public:
                OAppDetailPageHelper(Window* _pParent,OAppBorderWindow& 
_rBorderWin,PreviewMode _ePreviewMode);
                virtual ~OAppDetailPageHelper();
@@ -214,6 +217,10 @@
                virtual void Resize();
                virtual void KeyInput( const KeyEvent& rKEvt );
 
+        // IContextMenuProvider
+        virtual PopupMenu*      getContextMenu( Control& _rControl );
+        virtual IController&    getCommandController();
+
                sal_Bool isCutAllowed();
                sal_Bool isCopyAllowed();
                sal_Bool isPasteAllowed();




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to