diff options
author | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-08 18:03:12 +0300 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-08-14 22:20:26 +0200 |
commit | 3e46f2c5a03134b0e819fad98e31b4a7e9925c33 (patch) | |
tree | 35b46fb7a9382eb8b408ec87339a6a73e63fb949 /sfx2/source/dialog | |
parent | 8cf2021712b8f3c4b04c60d18cd2d0150e40c26a (diff) |
Fixed the Templates button
It works as a button. When clicked the triangle works as dropdown.
Change-Id: Ib4e3b6a1832efef3382e7bd01b06d2ff8d4e7543
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 46 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 5 |
2 files changed, 6 insertions, 45 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 22147f5a357e..28179f96fa2f 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -122,9 +122,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : get(mpHelpButton, "help"); get(mpExtensionsButton, "extensions"); - //get(mpViewBar, "action_view"); - //get(mpTemplateBar, "action_templates"); - //Containers are invisible to cursor traversal //So on pressing "right" when in Help the //extension button is considered as a candidate @@ -266,7 +263,7 @@ void BackingWindow::initControls() mpAllRecentThumbnails->Reload(); mpAllRecentThumbnails->ShowTooltips( true ); - //initialize Template views + //initialize Template view mpLocalView->SetStyle( mpLocalView->GetStyle() | WB_VSCROLL); mpLocalView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, TEMPLATE_ITEM_MAX_HEIGHT-TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, @@ -278,25 +275,12 @@ void BackingWindow::initControls() mpCurrentView = mpLocalView; - //mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT); - //mpViewBar->SetItemBits(mpViewBar->GetItemId("repository"), TIB_DROPDOWNONLY); - //mpViewBar->SetClickHdl(LINK(this,BackingWindow,TBXViewHdl)); - //mpViewBar->SetDropdownClickHdl(LINK(this,BackingWindow,TBXDropdownHdl)); - //mpViewBar->Hide(); - //mpViewBar->HideItem("import"); - - //mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT); - //mpTemplateBar->SetItemBits(mpTemplateBar->GetItemId(TEMPLATEBAR_MOVE), TIB_DROPDOWNONLY); - //mpTemplateBar->SetClickHdl( LINK( this, BackingWindow,TBXTemplateHdl ) ); - //mpTemplateBar->SetDoubleClickHdl( LINK(this, BackingWindow, OpenTemplateHdl) ); - //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl)); + mpTemplateButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED ); //set handlers mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl)); mpLocalView->setOpenTemplateHdl(LINK(this,BackingWindow,OpenTemplateHdl)); - /*FIXME: Add other things for Local View*/ - setupButton( mpOpenButton ); setupButton( mpTemplateButton ); setupButton( mpWriterAllButton ); @@ -348,7 +332,6 @@ void BackingWindow::setupButton( PushButton* pButton ) // color that fits the theme pButton->SetControlForeground(aButtonsText); - pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); } @@ -361,15 +344,13 @@ void BackingWindow::setupButton( MenuButton* pButton ) // 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->SetClickHdl(LINK(this, BackingWindow, ClickHdl)); pButton->SetSelectHdl(LINK(this, BackingWindow, MenuSelectHdl)); } - void BackingWindow::Paint( const Rectangle& ) { Resize(); @@ -572,18 +553,9 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton ) } else if( pButton == mpTemplateButton ) { -/* 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(); + mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE)); mpLocalView->Show(); - //mpViewBar->Hide(); } return 0; } @@ -592,11 +564,7 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) { OString sId = pButton->GetCurItemIdent(); - if( sId == "filter_none" ) - { - mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE)); - } - else if( sId == "filter_writer" ) + if( sId == "filter_writer" ) { mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_WRITER)); } @@ -625,7 +593,6 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) } - mpAllRecentThumbnails->Hide(); mpLocalView->Show(); @@ -637,13 +604,10 @@ IMPL_LINK_NOARG( BackingWindow, OpenRegionHdl) { maSelFolders.clear(); maSelTemplates.clear(); - //mpTemplateBar->Hide(); - //mpViewBar->Hide(); return 0; } -//FIXME: Cleanup the code IMPL_LINK(BackingWindow, OpenTemplateHdl, ThumbnailViewItem*, pItem) { if (!mbIsSaveMode) diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index f842644585ec..e4f7a39479b6 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -57,11 +57,11 @@ class BackingWindow com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider; com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame; com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop; + /** helper for drag&drop. */ com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; PushButton* mpOpenButton; - //PushButton* mpTemplateButton; MenuButton* mpTemplateButton; FixedText* mpCreateLabel; @@ -88,9 +88,6 @@ class BackingWindow TemplateLocalView* mpLocalView; TemplateAbstractView* mpCurrentView; - //ToolBox* mpViewBar; - //ToolBox* mpTemplateBar; - std::vector<Window*> maDndWindows; Rectangle maStartCentButtons; |