[Libreoffice-commits] core.git: sfx2/inc sfx2/source
Cédric Bosdonnat
cedric.bosdonnat at free.fr
Fri Mar 15 09:18:49 PDT 2013
sfx2/inc/templatedlg.hxx | 2
sfx2/source/control/templateview.src | 2
sfx2/source/doc/doc.hrc | 1
sfx2/source/doc/templatedlg.cxx | 43 +++++++-----
sfx2/source/doc/templatedlg.src | 124 ++++++++++++++++++-----------------
5 files changed, 98 insertions(+), 74 deletions(-)
New commits:
commit 5fbc90a6e277fc038b8c3a1c86360556dc9c0069
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Fri Mar 15 17:14:26 2013 +0100
Template manager: moved the controls into a proper TabPage to avoid problems
Change-Id: Ibff35bf24873a38c9a09d71fb3630a57e06f1a3c
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 53a70ff..6b2d4bc 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -15,6 +15,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/tabctrl.hxx>
+#include <vcl/tabpage.hxx>
#include <com/sun/star/frame/XDesktop2.hpp>
class Edit;
@@ -128,6 +129,7 @@ private:
private:
TabControl maTabControl;
+ TabPage maTabPage;
Control *mpToolbars;
Edit *mpSearchEdit;
diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src
index 0e77593..1f78a88 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -12,7 +12,6 @@
Control CONTROL_BUTTONS
{
Size = MAP_APPFONT( 290, 17 );
- Border = True;
TabStop = False;
};
@@ -21,6 +20,7 @@ PushButton BTN_ALL_TEMPLATES
Pos = MAP_APPFONT( 1, 1 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "All Templates";
+ TabStop = True;
};
FixedText FT_NAME
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index 1627e8b..9a38284 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -40,6 +40,7 @@
#define DLG_DOC_TEMPLATE (RID_SFX_DOC_START+2)
#define DLG_TEMPLATE_MANAGER (RID_SFX_DOC_START+4)
+#define TAB_TEMPLATE_MANAGER (RID_SFX_DOC_START+5)
#define BMP_STYLES_CLOSED (RID_SFX_DOC_START+ 0)
#define BMP_STYLES_OPENED (RID_SFX_DOC_START+ 1)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c2bbf7c..ce815bb 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -100,22 +100,38 @@ private:
OUString maKeyword;
};
+class TemplateManagerPage : public TabPage
+{
+ private:
+ FixedText maFixedText;
+
+ public:
+ TemplateManagerPage( Window* pParent );
+ ~TemplateManagerPage( ) { };
+};
+
SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
: ModelessDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
maTabControl(this,SfxResId(TAB_CONTROL)),
- mpToolbars( new Control(&maTabControl,SfxResId(TOOLBARS))),
+ maTabPage(&maTabControl, SfxResId(TAB_TEMPLATE_MANAGER)),
+ mpToolbars( new Control(&maTabPage,SfxResId(TOOLBARS))),
mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
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)),
+ mpSearchView(new TemplateSearchView(&maTabPage)),
+ maView(new TemplateLocalView(&maTabPage,SfxResId(TEMPLATE_VIEW))),
+ mpOnlineView(new TemplateRemoteView(&maTabPage, WB_VSCROLL,false)),
mbIsSaveMode(false),
mxDesktop( Desktop::create(comphelper::getProcessComponentContext()) ),
mbIsSynced(false),
maRepositories()
{
+ maTabControl.SetTabPage( FILTER_DOCS, &maTabPage );
+ maTabControl.SetTabPage( FILTER_SHEETS, &maTabPage );
+ maTabControl.SetTabPage( FILTER_PRESENTATIONS, &maTabPage );
+ maTabControl.SetTabPage( FILTER_DRAWS, &maTabPage );
+
// Create popup menus
mpActionMenu = new PopupMenu;
mpActionMenu->InsertItem(MNI_ACTION_SORT_NAME,SfxResId(STR_ACTION_SORT_NAME).toString(),SfxResId(IMG_ACTION_SORT));
@@ -294,21 +310,18 @@ void SfxTemplateManagerDlg::Resize()
Size aTabSize = maTabControl.GetSizePixel();
aTabSize.setWidth(aWinSize.getWidth());
maTabControl.SetSizePixel(aTabSize);
- Size aTabPageSize = maTabControl.GetTabPageSizePixel();
- Point aToolbarsPos(0, aTabSize.getHeight() - aTabPageSize.getHeight());
- mpToolbars->SetPosPixel(aToolbarsPos);
- aTabPageSize.setHeight(mpToolbars->GetSizePixel().getHeight() + 3);
- maTabControl.SetTabPageSizePixel(aTabPageSize);
-
- Size aToolbarsSize = mpToolbars->GetSizePixel();
- aToolbarsSize.setWidth(aWinSize.getWidth());
- mpToolbars->SetSizePixel(aToolbarsSize);
+ maTabControl.SetTabPageSizePixel(aWinSize);
// Calculate toolboxes size and positions
Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel();
Size aActionSize = mpActionBar->CalcMinimumWindowSizePixel();
Size aTemplateSize = mpTemplateBar->CalcMinimumWindowSizePixel();
+ long nToolbarsHeight = std::max(std::max(aViewSize.getHeight(), aActionSize.getHeight()), aTemplateSize.getHeight());
+
+ Size aToolbarsSize (aWinSize.getWidth(), nToolbarsHeight);
+ mpToolbars->SetSizePixel(aToolbarsSize);
+
aActionSize.setWidth(3*aActionSize.getWidth());
aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X());
aTemplateSize.setWidth(aWinSize.getWidth());
@@ -322,9 +335,9 @@ void SfxTemplateManagerDlg::Resize()
// Set view position below toolbox
Point aViewPos = maView->GetPosPixel();
- aViewPos.setY(maTabControl.GetPosPixel().Y() + maTabControl.GetSizePixel().getHeight());
+ aViewPos.setY(aToolbarsSize.getHeight());
aViewPos.setX(0);
- Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY());
+ Size aThumbSize(aWinSize.getWidth(), maTabControl.GetTabPageSizePixel().getWidth() - aViewPos.getY());
maView->SetPosSizePixel(aViewPos, aThumbSize);
if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER)
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index fcd53bc..3de2c42 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -107,75 +107,24 @@ String STR_QMSG_SEL_TEMPLATE_DELETE
Text [ en-US ] = "Do you want to delete the selected templates?";
};
-ModelessDialog DLG_TEMPLATE_MANAGER
+TabPage TAB_TEMPLATE_MANAGER
{
- OutputSize = TRUE;
- SVLook = TRUE;
- Moveable = TRUE;
- Closeable = TRUE;
- Sizeable = TRUE;
+ Size = MAP_APPFONT( 290, 220 );
Hide = TRUE;
- Size = MAP_APPFONT ( 290 , 250 );
- Text [en-US] = "Template Manager";
- TabControl TAB_CONTROL
+ Control TOOLBARS
{
- OutputSize = TRUE;
- Size = MAP_APPFONT( 290, 22 );
- Pos = MAP_APPFONT( 0, 0 );
- PageList =
- {
- PageItem
- {
- Identifier = FILTER_DOCS;
- Text [ en-US ] = "Documents";
- };
- PageItem
- {
- Identifier = FILTER_SHEETS;
- Text [ en-US ] = "Spreadsheets";
- };
- PageItem
- {
- Identifier = FILTER_PRESENTATIONS;
- Text [ en-US ] = "Presentations";
- };
- PageItem
- {
- Identifier = FILTER_DRAWS;
- Text [ en-US ] = "Drawings";
- };
- };
+ Size = MAP_APPFONT( 290 , 20 );
+ TabStop = False;
};
Control TEMPLATE_VIEW
{
- Size = MAP_APPFONT(280,220);
+ Pos = MAP_APPFONT( 0, 20 );
+ Size = MAP_APPFONT( 290, 200 );
TabStop = TRUE;
};
- Image IMG_ACTION_SORT
- {
- ImageBitmap = Bitmap
- {
- File = "sortascending.png";
- };
- };
-
- Image IMG_ACTION_REFRESH
- {
- ImageBitmap = Bitmap
- {
- File = "reload.png";
- };
- };
-
- Control TOOLBARS
- {
- Size = MAP_APPFONT( 290 , 16 );
- TabStop = False;
- };
-
ToolBox TBX_ACTION_VIEW
{
SVLook = TRUE ;
@@ -351,6 +300,65 @@ ModelessDialog DLG_TEMPLATE_MANAGER
};
};
};
+
+ Image IMG_ACTION_SORT
+ {
+ ImageBitmap = Bitmap
+ {
+ File = "sortascending.png";
+ };
+ };
+
+ Image IMG_ACTION_REFRESH
+ {
+ ImageBitmap = Bitmap
+ {
+ File = "reload.png";
+ };
+ };
+};
+
+ModelessDialog DLG_TEMPLATE_MANAGER
+{
+ OutputSize = TRUE;
+ SVLook = TRUE;
+ Moveable = TRUE;
+ Closeable = TRUE;
+ Sizeable = TRUE;
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 290 , 250 );
+ Text [en-US] = "Template Manager";
+
+ TabControl TAB_CONTROL
+ {
+ OutputSize = TRUE;
+ Size = MAP_APPFONT( 290, 250 );
+ Pos = MAP_APPFONT( 0, 0 );
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = FILTER_DOCS;
+ Text [ en-US ] = "Documents";
+ };
+ PageItem
+ {
+ Identifier = FILTER_SHEETS;
+ Text [ en-US ] = "Spreadsheets";
+ };
+ PageItem
+ {
+ Identifier = FILTER_PRESENTATIONS;
+ Text [ en-US ] = "Presentations";
+ };
+ PageItem
+ {
+ Identifier = FILTER_DRAWS;
+ Text [ en-US ] = "Drawings";
+ };
+ };
+ };
+
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list