summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-19 22:01:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:49 +0100
commitadda1a25f248586b46682bb9e19cd7a6b2c9debc (patch)
tree30d29d5107bcf9b37c35ca8032a677cb3bdf46c6 /svtools
parent29d6cfdca55c56a61c5a22c42f764697b5dc03b4 (diff)
convert hard-coded layout of char name tabpage to .ui
Change-Id: I20829b6a0835bf96489d67b6f7effcfa84650328
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/ctrlbox.hxx1
-rw-r--r--svtools/source/control/ctrlbox.cxx69
2 files changed, 66 insertions, 4 deletions
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index 5cb20efb26f5..44117464cb76 100644
--- a/svtools/inc/svtools/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -486,6 +486,7 @@ private:
using ComboBox::SetText;
public:
FontStyleBox( Window* pParent, const ResId& rResId );
+ FontStyleBox( Window* pParent, WinBits nBits );
virtual ~FontStyleBox();
virtual void Select();
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index e420d4e9fc5e..1ee95891eb5c 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -29,6 +29,7 @@
#define _CTRLBOX_CXX
#include <tools/stream.hxx>
+#include <vcl/builder.hxx>
#include <vcl/svapp.hxx>
#include <vcl/field.hxx>
#include <vcl/helper.hxx>
@@ -124,10 +125,30 @@ ColorListBox::ColorListBox( Window* pParent, const ResId& rResId ) :
ImplInit();
}
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorListBox(Window *pParent)
+namespace
+{
+ bool extractDropdown(VclBuilder::stringmap &rMap)
+ {
+ bool bDropdown = true;
+ VclBuilder::stringmap::iterator aFind = rMap.find(rtl::OString(RTL_CONSTASCII_STRINGPARAM("dropdown")));
+ if (aFind != rMap.end())
+ {
+ bDropdown = toBool(aFind->second);
+ rMap.erase(aFind);
+ }
+ return bDropdown;
+ }
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorListBox(Window *pParent, VclBuilder::stringmap &rMap)
{
- ColorListBox *pListBox = new ColorListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
- pListBox->SetDropDownLineCount(16); //arbitrary
+ bool bDropdown = extractDropdown(rMap);
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ if (bDropdown)
+ nWinBits |= WB_DROPDOWN;
+ ColorListBox *pListBox = new ColorListBox(pParent, nWinBits);
+ if (bDropdown)
+ pListBox->SetBestDropDownLineCount();
return pListBox;
}
@@ -1040,6 +1061,18 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
InitFontMRUEntriesFile();
}
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontNameBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ bool bDropdown = extractDropdown(rMap);
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ if (bDropdown)
+ nWinBits |= WB_DROPDOWN;
+ FontNameBox *pListBox = new FontNameBox(pParent, nWinBits);
+ if (bDropdown)
+ pListBox->SetBestDropDownLineCount();
+ return pListBox;
+}
+
// -------------------------------------------------------------------
FontNameBox::~FontNameBox()
@@ -1483,7 +1516,23 @@ FontStyleBox::FontStyleBox( Window* pParent, const ResId& rResId ) :
aLastStyle = GetText();
}
-// -------------------------------------------------------------------
+FontStyleBox::FontStyleBox( Window* pParent, WinBits nBits ) :
+ ComboBox( pParent, nBits )
+{
+ aLastStyle = GetText();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontStyleBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ bool bDropdown = extractDropdown(rMap);
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ if (bDropdown)
+ nWinBits |= WB_DROPDOWN;
+ FontStyleBox *pListBox = new FontStyleBox(pParent, nWinBits);
+ if (bDropdown)
+ pListBox->SetBestDropDownLineCount();
+ return pListBox;
+}
FontStyleBox::~FontStyleBox()
{
@@ -1693,6 +1742,18 @@ FontSizeBox::FontSizeBox( Window* pParent, const ResId& rResId ) :
ImplInit();
}
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontSizeBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ bool bDropdown = extractDropdown(rMap);
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ if (bDropdown)
+ nWinBits |= WB_DROPDOWN;
+ FontSizeBox* pListBox = new FontSizeBox(pParent, nWinBits);
+ if (bDropdown)
+ pListBox->SetBestDropDownLineCount();
+ return pListBox;
+}
+
// -----------------------------------------------------------------------
FontSizeBox::~FontSizeBox()