From 337ac3bd696046e734c4bcc0c91294c59514274b Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Wed, 5 Dec 2012 17:15:04 +0100 Subject: Template Manager: put all the ToolBoxes in a Control to ease painting changes Change-Id: Ie63638a2b69594edf21e8025b1531842390f409d --- sfx2/inc/templatedlg.hxx | 1 + sfx2/source/doc/templatedlg.cxx | 11 ++++++----- sfx2/source/doc/templatedlg.hrc | 1 + sfx2/source/doc/templatedlg.src | 12 +++++++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx index 8ce829e06867..8e70039d14c1 100644 --- a/sfx2/inc/templatedlg.hxx +++ b/sfx2/inc/templatedlg.hxx @@ -125,6 +125,7 @@ private: PushButton aButtonSheets; PushButton aButtonDraws; ImageButton maButtonSelMode; + Control *mpToolbars; Edit *mpSearchEdit; ToolBox *mpViewBar; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 371f8735851e..b4fb512916ed 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -54,7 +54,6 @@ #define INIT_FOLDER_COLS 3 #define INIT_FOLDER_LINES 2 -#define PADDING_TOOLBAR_VIEW 15 #define PADDING_DLG_BORDER 10 using namespace ::com::sun::star; @@ -106,10 +105,11 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)), aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)), maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)), + mpToolbars( new Control(this,SfxResId(TOOLBARS))), mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)), - mpViewBar( new ToolBox(this, SfxResId(TBX_ACTION_VIEW))), - mpActionBar( new ToolBox(this, SfxResId(TBX_ACTION_ACTION))), - mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))), + mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))), + mpActionBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_ACTION))), + mpTemplateBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_TEMPLATES))), mpSearchView(new TemplateSearchView(this)), maView(new TemplateLocalView(this,SfxResId(TEMPLATE_VIEW))), mpOnlineView(new TemplateRemoteView(this, WB_VSCROLL,false)), @@ -177,7 +177,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) // Set view position below toolbox Point aViewPos = maView->GetPosPixel(); - aViewPos.setY(aActionPos.Y() + aActionSize.getHeight() + PADDING_TOOLBAR_VIEW); + aViewPos.setY(mpToolbars->GetPosPixel().Y() + mpToolbars->GetSizePixel().getHeight()); aViewPos.setX((aWinSize.getWidth() - aThumbSize.getWidth())/2); // Center the view maView->SetPosPixel(aViewPos); @@ -273,6 +273,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg () delete mpActionMenu; delete mpRepositoryMenu; delete mpTemplateDefaultMenu; + delete mpToolbars; } void SfxTemplateManagerDlg::setSaveMode(bool bMode) diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc index aced42ae5466..7624e4829bcf 100644 --- a/sfx2/source/doc/templatedlg.hrc +++ b/sfx2/source/doc/templatedlg.hrc @@ -16,6 +16,7 @@ #define TEMPLATE_VIEW 7 #define TBX_ACTION_VIEW 8 +#define TOOLBARS 9 #define TBI_TEMPLATE_IMPORT 10 #define TBX_ACTION_ACTION 11 diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index 9bafd2b2a533..184b2165accb 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -189,12 +189,18 @@ ModelessDialog DLG_TEMPLATE_MANAGER }; }; + Control TOOLBARS + { + Pos = MAP_APPFONT( 0 , 22 ); + Size = MAP_APPFONT( 290 , 20 ); + TabStop = False; + }; ToolBox TBX_ACTION_VIEW { SVLook = TRUE ; TabStop = TRUE ; - Pos = MAP_APPFONT ( 4 , 22 ) ; + Pos = MAP_APPFONT ( 4 , 0 ) ; ItemList = { @@ -251,7 +257,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER { SVLook = TRUE ; TabStop = TRUE ; - Pos = MAP_APPFONT ( 4 , 22 ) ; + Pos = MAP_APPFONT ( 4 , 0 ) ; ItemList = { @@ -283,7 +289,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER { SVLook = TRUE ; TabStop = TRUE ; - Pos = MAP_APPFONT ( 4 , 22 ) ; + Pos = MAP_APPFONT ( 4 , 0 ) ; Hide = TRUE; ItemList = -- cgit