[Libreoffice-commits] .: Branch 'feature/template-dialog' - 2 commits - sfx2/inc sfx2/source

Rafael Dominguez rdominguez at kemper.freedesktop.org
Thu Jun 21 16:08:53 PDT 2012


 sfx2/inc/templatedlg.hxx        |    4 +
 sfx2/source/doc/templatedlg.cxx |   35 ++++++++++++++++
 sfx2/source/doc/templatedlg.hrc |   14 ++++++
 sfx2/source/doc/templatedlg.src |   85 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 138 insertions(+)

New commits:
commit c9a32361d44caef7633ba625a93415373187ba89
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Thu Jun 21 18:39:05 2012 -0430

    Set folder view position below toolbars with a padding between them.
    
    Change-Id: I8e305e3c1c45a538745a286781e9e1efaa091fe3

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e3dd9d5..3d56731 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -19,6 +19,8 @@
 #define MAX_COLUMN_COUNT 4
 #define MAX_LINE_COUNT 2
 
+#define PADDING_TOOLBAR_VIEW    15
+
 SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
     : ModalDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
       aButtonAll(this,SfxResId(BTN_SELECT_ALL)),
@@ -55,6 +57,11 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
     mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT);
     mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT);
 
+    // Set view position below toolbox
+    Point aViewPos = maView->GetPosPixel();
+    aViewPos.setY(aActionPos.Y() + aActionSize.getHeight() + PADDING_TOOLBAR_VIEW);
+    maView->SetPosPixel(aViewPos);
+
     maView->SetStyle(WB_TABSTOP | WB_VSCROLL);
     maView->SetColCount(MAX_COLUMN_COUNT);
     maView->SetLineCount(MAX_LINE_COUNT);
commit 44c2e8489276c2ac2ba43fa7fb8274771afb5558
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Thu Jun 21 18:20:58 2012 -0430

    Add toolbox to template manager dialog.
    
    Change-Id: I693e55e903b3e9c4121d65b477d19fbb48fd837e

diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index ee98e2e..4859532 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -14,6 +14,7 @@
 #include <vcl/button.hxx>
 
 class TemplateFolderView;
+class ToolBox;
 
 class SfxTemplateManagerDlg : public ModalDialog
 {
@@ -44,6 +45,9 @@ private:
     PushButton aButtonDraws;
     ImageButton maButtonSelMode;
 
+    ToolBox *mpViewBar;
+    ToolBox *mpActionBar;
+    ToolBox *mpTemplateBar;
     TemplateFolderView *maView;
 };
 
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 1582084..e3dd9d5 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -11,6 +11,7 @@
 
 #include <sfx2/sfxresid.hxx>
 #include <sfx2/templatefolderview.hxx>
+#include <vcl/toolbox.hxx>
 
 #include "doc.hrc"
 #include "templatedlg.hrc"
@@ -26,10 +27,34 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
       aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)),
       aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)),
       maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)),
+      mpViewBar( new ToolBox(this, SfxResId(TBX_ACTION_VIEW))),
+      mpActionBar( new ToolBox(this, SfxResId(TBX_ACTION_ACTION))),
+      mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))),
       maView(new TemplateFolderView(this,SfxResId(TEMPLATE_VIEW)))
 {
     maButtonSelMode.SetStyle(maButtonSelMode.GetStyle() | WB_TOGGLE);
 
+    // Calculate toolboxs size and positions
+    Size aWinSize = GetOutputSize();
+    Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel();
+    Size aActionSize = mpActionBar->CalcMinimumWindowSizePixel();
+    Size aTemplateSize = mpTemplateBar->CalcMinimumWindowSizePixel();
+
+    aActionSize.setWidth(2*aActionSize.getWidth());
+    aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X());
+    aTemplateSize.setWidth(aWinSize.getWidth());
+
+    Point aActionPos = mpActionBar->GetPosPixel();
+    aActionPos.setX(aWinSize.getWidth() - aActionSize.getWidth());
+
+    mpViewBar->SetSizePixel(aViewSize);
+    mpActionBar->SetPosSizePixel(aActionPos,aActionSize);
+    mpTemplateBar->SetSizePixel(aTemplateSize);
+
+    // Set toolbox styles
+    mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT);
+    mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT);
+
     maView->SetStyle(WB_TABSTOP | WB_VSCROLL);
     maView->SetColCount(MAX_COLUMN_COUNT);
     maView->SetLineCount(MAX_LINE_COUNT);
@@ -41,6 +66,9 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
     aButtonDraws.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDrawsHdl));
     maButtonSelMode.SetClickHdl(LINK(this,SfxTemplateManagerDlg,OnClickSelectionMode));
 
+    mpViewBar->Show();
+    mpActionBar->Show();
+
     maView->Populate();
     maView->Show();
 
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index d596a41..8afc9da 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -15,4 +15,18 @@
 
 #define TEMPLATE_VIEW               7
 
+#define TBX_ACTION_VIEW             8
+#define TBI_TEMPLATE_CREATE         9
+#define TBI_TEMPLATE_IMPORT         10
+
+#define TBX_ACTION_ACTION           11
+#define TBI_TEMPLATE_SEARCH         12
+#define TBI_TEMPLATE_ACTION         13
+
+#define TBX_ACTION_TEMPLATES        14
+#define TBI_TEMPLATE_EDIT           15
+#define TBI_TEMPLATE_PROPERTIES     16
+#define TBI_TEMPLATE_MOVE           17
+#define TBI_TEMPLATE_DELETE         18
+
 #define IMG_ONLINE_REPOSITORY       100
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 6771611..610add4 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -88,4 +88,89 @@ ModalDialog DLG_TEMPLATE_MANAGER
             File = "signet.png";
         };
     };
+
+    ToolBox TBX_ACTION_VIEW
+    {
+        SVLook = TRUE ;
+        TabStop = TRUE ;
+        Pos = MAP_APPFONT ( 4 , 22 ) ;
+
+        ItemList =
+        {
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_CREATE;
+                Text [ en-US ] = "Create a template" ;
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_IMPORT ;
+                Text [ en-US ] = "Import a template" ;
+            };
+        };
+    };
+
+    ToolBox TBX_ACTION_ACTION
+    {
+        SVLook = TRUE ;
+        TabStop = TRUE ;
+        Pos = MAP_APPFONT ( 4 , 22 ) ;
+
+        ItemList =
+        {
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_SEARCH;
+                Text [en-US] = "Search";
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_ACTION;
+                Text [en-US] = "Action Menu";
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_IMPORT ;
+                Text [ en-US ] = "Import a template" ;
+            };
+        };
+    };
+
+    ToolBox TBX_ACTION_TEMPLATES
+    {
+        SVLook = TRUE ;
+        TabStop = TRUE ;
+        Pos = MAP_APPFONT ( 4 , 22 ) ;
+        Hide = TRUE;
+
+        ItemList =
+        {
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_EDIT;
+                Text [ en-US ] = "Edit";
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_PROPERTIES;
+                Text [ en-US ] = "Properties";
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_MOVE;
+                Text [ en-US ] = "Move to folder" ;
+            };
+
+            ToolBoxItem
+            {
+                Identifier = TBI_TEMPLATE_DELETE;
+                Text [ en-US ] = "Delete";
+            };
+        };
+    };
 };


More information about the Libreoffice-commits mailing list