Kaydet (Commit) d3515915 authored tarafından Efe Gürkan YALAMAN's avatar Efe Gürkan YALAMAN Kaydeden (comit) Jan Holesovsky

Some code cleanup

SetupButton function overloaded for MenuButton type.

Change-Id: Ib171c7590a59ad360dd8ebab1039d3eba5d565ef
üst 13c4d0ab
......@@ -53,9 +53,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;
......@@ -295,32 +292,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 aFont(mpTemplateButton->GetSettings().GetStyleSettings().GetPushButtonFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
mpTemplateButton->SetControlFont(aFont);
// 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 );
......@@ -374,6 +352,24 @@ void BackingWindow::setupButton( PushButton* pButton )
pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
}
void BackingWindow::setupButton( MenuButton* pButton )
{
Font aFont(pButton->GetSettings().GetStyleSettings().GetPushButtonFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
pButton->SetControlFont(aFont);
// color that fits the theme
pButton->SetControlForeground(aButtonsText);
//Menubutton implementation
PopupMenu* pMenu = pButton->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();
......@@ -612,6 +608,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();
......
......@@ -101,6 +101,7 @@ class BackingWindow
svt::AcceleratorExecute* mpAccExec;
void setupButton( PushButton* pButton );
void setupButton( MenuButton* pButton );
//Template Manager
void OnTemplateOpen ();
......
<?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 -->
......@@ -464,13 +464,6 @@
<property name="label" translatable="yes">Draw Templates</property>
</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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment