[Libreoffice-commits] core.git: cui/source cui/uiconfig extras/source

Caolán McNamara caolanm at redhat.com
Mon Dec 30 08:29:20 PST 2013


 cui/source/customize/selector.cxx              |   28 +++++++++++++++++--------
 cui/source/inc/selector.hxx                    |    8 +++----
 cui/uiconfig/ui/macroselectordialog.ui         |   15 +++++++++----
 extras/source/glade/libreoffice-catalog.xml.in |    6 +++++
 4 files changed, 41 insertions(+), 16 deletions(-)

New commits:
commit f42d83b986fda93ba54222b730eacd5d253fdae7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 30 16:24:51 2013 +0000

    add borders to macro/configuration listboxes
    
    Change-Id: Ia028b19fa0e0eae0bb5e3cbc63bde2fac0785ef2

diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index ea8f32c..bb37627 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -73,8 +73,8 @@ using namespace ::com::sun::star::container;
  * The implementations of SvxConfigFunctionListBox and
  * SvxConfigGroupListBox are copied from sfx2/source/dialog/cfg.cxx
  */
-SvxConfigFunctionListBox::SvxConfigFunctionListBox(Window* pParent)
-    : SvTreeListBox(pParent, WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT | WB_TABSTOP)
+SvxConfigFunctionListBox::SvxConfigFunctionListBox(Window* pParent, WinBits nStyle)
+    : SvTreeListBox(pParent, nStyle | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT | WB_TABSTOP)
     , pCurEntry(0)
     , m_pDraggingEntry(0)
 {
@@ -86,9 +86,15 @@ SvxConfigFunctionListBox::SvxConfigFunctionListBox(Window* pParent)
         LINK( this, SvxConfigFunctionListBox, TimerHdl ) );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxConfigFunctionListBox(Window *pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxConfigFunctionListBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
-    return new SvxConfigFunctionListBox(pParent);
+    WinBits nWinBits = WB_TABSTOP;
+
+    OString sBorder = VclBuilder::extractCustomProperty(rMap);
+    if (!sBorder.isEmpty())
+       nWinBits |= WB_BORDER;
+
+    return new SvxConfigFunctionListBox(pParent, nWinBits);
 }
 
 SvxConfigFunctionListBox::~SvxConfigFunctionListBox()
@@ -187,8 +193,8 @@ SvxConfigFunctionListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
     return DND_ACTION_NONE;
 }
 
-SvxConfigGroupListBox::SvxConfigGroupListBox(Window* pParent)
-    : SvTreeListBox(pParent,
+SvxConfigGroupListBox::SvxConfigGroupListBox(Window* pParent, WinBits nStyle)
+    : SvTreeListBox(pParent, nStyle |
             WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_TABSTOP)
     , m_bShowSlots(false)
     , m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK))
@@ -206,9 +212,15 @@ SvxConfigGroupListBox::SvxConfigGroupListBox(Window* pParent)
     );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxConfigGroupListBox(Window *pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxConfigGroupListBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
-    return new SvxConfigGroupListBox(pParent);
+    WinBits nWinBits = WB_TABSTOP;
+
+    OString sBorder = VclBuilder::extractCustomProperty(rMap);
+    if (!sBorder.isEmpty())
+       nWinBits |= WB_BORDER;
+
+    return new SvxConfigGroupListBox(pParent, nWinBits);
 }
 
 SvxConfigGroupListBox::~SvxConfigGroupListBox()
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index 9243010..fc10f54 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -100,8 +100,8 @@ friend class SvxConfigGroupListBox;
     virtual void                    MouseMove( const MouseEvent& rMEvt );
 
 public:
-                                    SvxConfigFunctionListBox(Window* pParent);
-                                    ~SvxConfigFunctionListBox();
+    SvxConfigFunctionListBox(Window* pParent, WinBits nStyle);
+    ~SvxConfigFunctionListBox();
     void                            ClearAll();
     OUString                        GetHelpText( SvTreeListEntry *pEntry );
     using Window::GetHelpText;
@@ -161,8 +161,8 @@ protected:
     using SvListView::Expand;
 
 public:
-            SvxConfigGroupListBox(Window* pParent);
-            ~SvxConfigGroupListBox();
+    SvxConfigGroupListBox(Window* pParent, WinBits nStyle);
+    ~SvxConfigGroupListBox();
 
     void    Init(bool bShowSlots, const ::com::sun::star::uno::Reference
                     < ::com::sun::star::frame::XFrame >& xFrame);
diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui
index 1734426..5a2278d 100644
--- a/cui/uiconfig/ui/macroselectordialog.ui
+++ b/cui/uiconfig/ui/macroselectordialog.ui
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
   <object class="GtkDialog" id="MacroSelectorDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -150,11 +151,14 @@
                         <property name="top_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="cuilo-SvxConfigGroupListBox" id="categories">
-                            <property name="height_request">300</property>
+                          <object class="cuilo-SvxConfigGroupListBox" id="categories:border">
                             <property name="width_request">280</property>
+                            <property name="height_request">300</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection" id="SvxConfigGroupListBox-selection1"/>
+                            </child>
                           </object>
                         </child>
                       </object>
@@ -215,11 +219,14 @@
                         <property name="top_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="cuilo-SvxConfigFunctionListBox" id="commands">
-                            <property name="height_request">300</property>
+                          <object class="cuilo-SvxConfigFunctionListBox" id="commands:border">
                             <property name="width_request">280</property>
+                            <property name="height_request">300</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection" id="SvxConfigFunctionListBox-selection1"/>
+                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 082e216..0bf7eca 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -439,6 +439,12 @@
     <glade-widget-class title="SwIdxTreeListBox" name="swuilo-SwIdxTreeListBox"
                         generic-name="SwIdxTreeListBox" parent="svtlo-SvTreeListBox"
                         icon-name="widget-gtk-treeview"/>
+    <glade-widget-class title="SvxConfigGroupListBox" name="cuilo-SvxConfigGroupListBox"
+                        generic-name="SvxConfigGroupListBox" parent="svtlo-SvTreeListBox"
+                        icon-name="widget-gtk-treeview"/>
+    <glade-widget-class title="SvxConfigFunctionListBox`" name="cuilo-SvxConfigFunctionListBox"
+                        generic-name="SvxConfigFunctionListBox" parent="svtlo-SvTreeListBox"
+                        icon-name="widget-gtk-treeview"/>
     <glade-widget-class title="Tooltip Tree List" name="swuilo-SwFldRefTreeListBox"
                         generic-name="Tooltip Tree List" parent="svtlo-SvTreeListBox"
                         icon-name="widget-gtk-treeview"/>


More information about the Libreoffice-commits mailing list