diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-18 09:34:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-18 10:06:04 +0100 |
commit | a8e1ed87ff7ccd24ccbcd74cc7689e0eda2fec36 (patch) | |
tree | 8911a1619cfcc8e15dcdf9dc147c7e2d2d9116eb | |
parent | 61a690cd79a0c1412d8432a62d48632b5c2adc80 (diff) |
allow tree and tab boxes to have borders via .ui
Change-Id: I988f307d2ce88ac5f7e1ee7d7c5cffd352c963e0
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 13 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 8 | ||||
-rw-r--r-- | vcl/inc/vcl/builder.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 20 |
4 files changed, 30 insertions, 13 deletions
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 3774a450f9bf..3c8111f89e7c 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -22,7 +22,8 @@ #include <svtools/svtresid.hxx> #include <svtools/svlbitm.hxx> #include <svtools/svtools.hrc> -#include "svtools/treelistentry.hxx" +#include <svtools/treelistentry.hxx> +#include <vcl/builder.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include "svtaccessiblefactory.hxx" @@ -107,6 +108,16 @@ SvTabListBox::SvTabListBox( Window* pParent, WinBits nBits ) SetHighlightRange(); // select full width } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTabListBox(Window *pParent, + VclBuilder::stringmap &rMap) +{ + WinBits nWinStyle = WB_TABSTOP; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new SvTabListBox(pParent, nWinStyle); +} + SvTabListBox::SvTabListBox( Window* pParent, const ResId& rResId ) : SvTreeListBox( pParent, rResId ) { diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index f19018246040..5fa6021abce0 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -452,9 +452,13 @@ SvTreeListBox::SvTreeListBox(Window* pParent, const ResId& rResId) : SetSublistOpenWithLeftRight(); } -extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTreeListBox(Window *pParent, VclBuilder::stringmap &) +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTreeListBox(Window *pParent, VclBuilder::stringmap &rMap) { - return new SvTreeListBox(pParent, WB_TABSTOP); + WinBits nWinStyle = WB_TABSTOP; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new SvTreeListBox(pParent, nWinStyle); } void SvTreeListBox::Clear() diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index 8202aa1494fe..5de792aaab5e 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -257,6 +257,8 @@ public: //Convert _ gtk markup to ~ vcl markup static OString convertMnemonicMarkup(const OString &rIn); + static OString extractCustomProperty(stringmap &rMap); + private: Window *insertObject(Window *pParent, const OString &rClass, const OString &rID, stringmap &rProps, stringmap &rPangoAttributes, diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index bf09bbc71e11..7a7919054c9a 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -490,20 +490,20 @@ void VclBuilder::handleTranslations(xmlreader::XmlReader &reader) } } -namespace +OString VclBuilder::extractCustomProperty(VclBuilder::stringmap &rMap) { - OString extractCustomProperty(VclBuilder::stringmap &rMap) + OString sCustomProperty; + VclBuilder::stringmap::iterator aFind = rMap.find(OString("customproperty")); + if (aFind != rMap.end()) { - OString sCustomProperty; - VclBuilder::stringmap::iterator aFind = rMap.find(OString("customproperty")); - if (aFind != rMap.end()) - { - sCustomProperty = aFind->second; - rMap.erase(aFind); - } - return sCustomProperty; + sCustomProperty = aFind->second; + rMap.erase(aFind); } + return sCustomProperty; +} +namespace +{ bool extractResizable(VclBuilder::stringmap &rMap) { bool bResizable = true; |