diff options
author | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-01 02:46:51 +0300 |
---|---|---|
committer | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-01 02:46:51 +0300 |
commit | f42ed44b2f612b33998242091a3a762ca3fb4215 (patch) | |
tree | 0aeeeb6a40e17824103ced39fb782d842cbae8d1 | |
parent | c6aa9122c4153ef29a0112458001e27f97ade876 (diff) |
Some code cleanup
SetupButton function overloaded for MenuButton type.
Change-Id: Ib171c7590a59ad360dd8ebab1039d3eba5d565ef
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 55 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 1 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/startcenter.ui | 9 |
3 files changed, 33 insertions, 32 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 34a40e1bd1e7..f481f18a72ff 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -52,9 +52,6 @@ #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -//FIXME:well find a better way for it. -#include "../doc/doc.hrc" - using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -294,32 +291,13 @@ void BackingWindow::initControls() //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl)); //set handlers - //mpLocalView->setItemStateHdl(LINK(this, BackingWindow, TVItemStateHdl)); mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl)); mpLocalView->setOpenTemplateHdl(LINK(this,BackingWindow,OpenTemplateHdl)); - /*FIXME: Add other things for Local View - *Filter and the bars*/ + /*FIXME: Add other things for Local View*/ setupButton( mpOpenButton ); - //setupButton( mpTemplateButton ); - Font bFont(mpTemplateButton->GetControlFont()); - bFont.SetHeight(nButtonsFontSize); - mpTemplateButton->SetControlFont(bFont); - - // color that fits the theme - mpTemplateButton->SetControlForeground(aButtonsText); - - - - //Menubutton implementation - PopupMenu* pMenu = mpTemplateButton->GetPopupMenu(); - pMenu->SetMenuFlags( - pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ); - - mpTemplateButton->SetSelectHdl(LINK(this,BackingWindow,MenuSelectHdl)); - mpTemplateButton->SetClickHdl( LINK(this, BackingWindow, ClickHdl) ); - + setupButton( mpTemplateButton ); setupButton( mpWriterAllButton ); setupButton( mpDrawAllButton ); setupButton( mpCalcAllButton ); @@ -373,6 +351,23 @@ void BackingWindow::setupButton( PushButton* pButton ) pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); } +void BackingWindow::setupButton( MenuButton* pButton ) +{ + Font aFont(pButton->GetControlFont()); + aFont.SetHeight(nButtonsFontSize); + pButton->SetControlFont(aFont); + pButton->SetControlForeground(aButtonsText); + + //Menubutton implementation + PopupMenu* pMenu = mpTemplateButton->GetPopupMenu(); + pMenu->SetMenuFlags( + pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ); + + pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); + pButton->SetSelectHdl( LINK( this, BackingWindow, MenuSelectHdl ) ); +} + + void BackingWindow::Paint( const Rectangle& ) { Resize(); @@ -611,6 +606,18 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) { mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_DRAW)); } + else if( sId == "edit" ) + { + Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY ); + + Sequence< com::sun::star::beans::PropertyValue > aArgs(1); + PropertyValue* pArg = aArgs.getArray(); + pArg[0].Name = "Referer"; + pArg[0].Value <<= OUString("private:user"); + + dispatchURL( TEMPLATE_URL, OUString(), xFrame, aArgs ); + + } mpAllRecentThumbnails->Hide(); diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index 586b879e4bc1..f842644585ec 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -101,6 +101,7 @@ class BackingWindow svt::AcceleratorExecute* mpAccExec; void setupButton( PushButton* pButton ); + void setupButton( MenuButton* pButton ); //Template Manager void OnTemplateOpen (); diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui index 792b43be3a5a..da54f918f821 100644 --- a/sfx2/uiconfig/ui/startcenter.ui +++ b/sfx2/uiconfig/ui/startcenter.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.0 on Wed Jul 23 16:41:24 2014 --> +<!-- Generated with glade 3.16.0 on Sun Jul 27 15:03:37 2014 --> <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires LibreOffice 1.0 --> @@ -466,13 +466,6 @@ </object> </child> <child> - <object class="GtkMenuItem" id="filter_math"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Math Templates</property> - </object> - </child> - <child> <object class="GtkSeparatorMenuItem" id="menuitem3"> <property name="visible">True</property> <property name="can_focus">False</property> |