[Libreoffice-commits] core.git: sc/source sc/uiconfig sc/UIConfig_scalc.mk

Csikós Tamás csks.tomi at gmail.com
Sat Aug 3 02:08:40 PDT 2013


 sc/UIConfig_scalc.mk                          |    1 
 sc/source/ui/dbgui/validate.cxx               |   34 ++----
 sc/source/ui/dbgui/validate.src               |   53 ---------
 sc/source/ui/inc/validate.hrc                 |    3 
 sc/source/ui/inc/validate.hxx                 |   10 -
 sc/uiconfig/scalc/ui/validationhelptabpage.ui |  147 ++++++++++++++++++++++++++
 6 files changed, 167 insertions(+), 81 deletions(-)

New commits:
commit e8db0fb6f98fe5346a0da613bef99895336bec8a
Author: Csikós Tamás <csks.tomi at gmail.com>
Date:   Fri Aug 2 18:27:04 2013 +0200

    modern .ui widgetlayout for validate
    
    widget found at: spreadsheet/data/validate
    
    Change-Id: Ib4eed0e25f851f90e5dad0dee74a0729da10aa5e
    Reviewed-on: https://gerrit.libreoffice.org/5254
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 2a168fa..f180a53 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -123,6 +123,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/textimportcsv \
 	sc/uiconfig/scalc/ui/tpviewpage \
 	sc/uiconfig/scalc/ui/ungroupdialog \
+	sc/uiconfig/scalc/ui/validationhelptabpage \
 	sc/uiconfig/scalc/ui/movecopysheet \
 ))
 
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 575c238..a9e0415 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -686,17 +686,13 @@ ScTPValidationHelp::ScTPValidationHelp( Window*         pParent,
                                           const SfxItemSet& rArgSet )
 
     :   SfxTabPage      ( pParent,
-                          ScResId( TP_VALIDATION_INPUTHELP ),
-                          rArgSet ),
-        aTsbHelp        ( this, ScResId( TSB_HELP ) ),
-        aFlContent      ( this, ScResId( FL_CONTENT ) ),
-        aFtTitle        ( this, ScResId( FT_TITLE ) ),
-        aEdtTitle       ( this, ScResId( EDT_TITLE ) ),
-        aFtInputHelp    ( this, ScResId( FT_INPUTHELP ) ),
-        aEdInputHelp    ( this, ScResId( EDT_INPUTHELP ) )
+                          "ValidationHelpTabPage" , "modules/scalc/ui/validationhelptabpage.ui" ,
+                          rArgSet )
 {
+    get(pTsbHelp,"tsbhelp");
+    get(pEdtTitle,"title");
+    get(pEdInputHelp,"inputhelp");
     Init();
-    FreeResource();
 }
 
 // -----------------------------------------------------------------------
@@ -709,7 +705,7 @@ ScTPValidationHelp::~ScTPValidationHelp()
 
 void ScTPValidationHelp::Init()
 {
-    aTsbHelp.EnableTriState( false );
+    pTsbHelp->EnableTriState( false );
 }
 
 //------------------------------------------------------------------------
@@ -734,28 +730,28 @@ void ScTPValidationHelp::Reset( const SfxItemSet& rArgSet )
     const SfxPoolItem* pItem;
 
     if ( rArgSet.GetItemState( FID_VALID_SHOWHELP, sal_True, &pItem ) == SFX_ITEM_SET )
-        aTsbHelp.SetState( ((const SfxBoolItem*)pItem)->GetValue() ? STATE_CHECK : STATE_NOCHECK );
+        pTsbHelp->SetState( ((const SfxBoolItem*)pItem)->GetValue() ? STATE_CHECK : STATE_NOCHECK );
     else
-        aTsbHelp.SetState( STATE_NOCHECK );
+        pTsbHelp->SetState( STATE_NOCHECK );
 
     if ( rArgSet.GetItemState( FID_VALID_HELPTITLE, sal_True, &pItem ) == SFX_ITEM_SET )
-        aEdtTitle.SetText( ((const SfxStringItem*)pItem)->GetValue() );
+        pEdtTitle->SetText( ((const SfxStringItem*)pItem)->GetValue() );
     else
-        aEdtTitle.SetText( EMPTY_STRING );
+        pEdtTitle->SetText( EMPTY_STRING );
 
     if ( rArgSet.GetItemState( FID_VALID_HELPTEXT, sal_True, &pItem ) == SFX_ITEM_SET )
-        aEdInputHelp.SetText( ((const SfxStringItem*)pItem)->GetValue() );
+        pEdInputHelp->SetText( ((const SfxStringItem*)pItem)->GetValue() );
     else
-        aEdInputHelp.SetText( EMPTY_STRING );
+        pEdInputHelp->SetText( EMPTY_STRING );
 }
 
 // -----------------------------------------------------------------------
 
 sal_Bool ScTPValidationHelp::FillItemSet( SfxItemSet& rArgSet )
 {
-    rArgSet.Put( SfxBoolItem( FID_VALID_SHOWHELP, aTsbHelp.GetState() == STATE_CHECK ) );
-    rArgSet.Put( SfxStringItem( FID_VALID_HELPTITLE, aEdtTitle.GetText() ) );
-    rArgSet.Put( SfxStringItem( FID_VALID_HELPTEXT, aEdInputHelp.GetText() ) );
+    rArgSet.Put( SfxBoolItem( FID_VALID_SHOWHELP, pTsbHelp->GetState() == STATE_CHECK ) );
+    rArgSet.Put( SfxStringItem( FID_VALID_HELPTITLE, pEdtTitle->GetText() ) );
+    rArgSet.Put( SfxStringItem( FID_VALID_HELPTEXT, pEdInputHelp->GetText() ) );
 
     return sal_True;
 }
diff --git a/sc/source/ui/dbgui/validate.src b/sc/source/ui/dbgui/validate.src
index 57a5b73..7a6b798 100644
--- a/sc/source/ui/dbgui/validate.src
+++ b/sc/source/ui/dbgui/validate.src
@@ -193,59 +193,6 @@ TabPage TP_VALIDATION_VALUES
     };
 };
 
-TabPage TP_VALIDATION_INPUTHELP
-{
-    HelpID = "sc:TabPage:TP_VALIDATION_INPUTHELP";
-    Hide = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    Text = "Eingabehilfe" ;
-    TriStateBox TSB_HELP
-    {
-        HelpID = "sc:TriStateBox:TP_VALIDATION_INPUTHELP:TSB_HELP";
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 248 , 10 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Show input help when cell is selected" ;
-    };
-    FixedLine FL_CONTENT
-    {
-        Pos = MAP_APPFONT ( 6 , 22 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text [ en-US ] = "Contents" ;
-    };
-    FixedText FT_TITLE
-    {
-        Pos = MAP_APPFONT ( 12 , 35 ) ;
-        Size = MAP_APPFONT ( 64 , 8 ) ;
-        Text [ en-US ] = "~Title" ;
-    };
-    FixedText FT_INPUTHELP
-    {
-        Pos = MAP_APPFONT ( 12 , 53 ) ;
-        Size = MAP_APPFONT ( 64 , 8 ) ;
-        Text [ en-US ] = "~Input help" ;
-    };
-    Edit EDT_TITLE
-    {
-        HelpID = "sc:Edit:TP_VALIDATION_INPUTHELP:EDT_TITLE";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 80 , 33 ) ;
-        Size = MAP_APPFONT ( 171 , 12 ) ;
-        TabStop = TRUE ;
-    };
-    MultiLineEdit EDT_INPUTHELP
-    {
-        HelpID = "sc:MultiLineEdit:TP_VALIDATION_INPUTHELP:EDT_INPUTHELP";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 80 , 51 ) ;
-        Size = MAP_APPFONT ( 171 , 128 ) ;
-        TabStop = TRUE ;
-        VScroll = TRUE ;
-        IgnoreTab = TRUE ;
-    };
-};
-
 TabPage TP_VALIDATION_ERROR
 {
     HelpID = "sc:TabPage:TP_VALIDATION_ERROR";
diff --git a/sc/source/ui/inc/validate.hrc b/sc/source/ui/inc/validate.hrc
index 958fbef..a55299b 100644
--- a/sc/source/ui/inc/validate.hrc
+++ b/sc/source/ui/inc/validate.hrc
@@ -33,11 +33,8 @@
 
 #define FL_CONTENT              10
 
-#define TSB_HELP                11
 #define FT_TITLE                12
 #define EDT_TITLE               13
-#define FT_INPUTHELP            14
-#define EDT_INPUTHELP           15
 
 #define TSB_SHOW                21
 #define FT_ACTION               22
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 8a0a3fa..633c430 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -25,6 +25,7 @@
 #include <vcl/fixed.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
+#include <vcl/vclmedit.hxx>
 #include <svtools/svmedit.hxx>
 
 #include "anyrefdg.hxx"
@@ -254,12 +255,9 @@ public:
 class ScTPValidationHelp : public SfxTabPage
 {
 private:
-    TriStateBox     aTsbHelp;
-    FixedLine       aFlContent;
-    FixedText       aFtTitle;
-    Edit            aEdtTitle;
-    FixedText       aFtInputHelp;
-    MultiLineEdit   aEdInputHelp;
+    TriStateBox*      pTsbHelp;
+    Edit*             pEdtTitle;
+    VclMultiLineEdit* pEdInputHelp;
 
     void    Init();
 
diff --git a/sc/uiconfig/scalc/ui/validationhelptabpage.ui b/sc/uiconfig/scalc/ui/validationhelptabpage.ui
new file mode 100644
index 0000000..7d215d8
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/validationhelptabpage.ui
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkBox" id="ValidationHelpTabPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkCheckButton" id="tsbhelp">
+        <property name="label" translatable="yes">_Show input help when cell is selected</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
+        <property name="hexpand">True</property>
+        <property name="use_underline">True</property>
+        <property name="xalign">0</property>
+        <property name="inconsistent">True</property>
+        <property name="draw_indicator">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">12</property>
+                <child>
+                  <object class="GtkEntry" id="title">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="invisible_char">●</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="title_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">_Title:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">title</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="inputhelp_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">0</property>
+                    <property name="label" translatable="yes">_Input help:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">inputhelp:border</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="vscrollbar_policy">always</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkTextView" id="inputhelp:border">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Contents</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list