diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-19 22:01:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:49 +0100 |
commit | adda1a25f248586b46682bb9e19cd7a6b2c9debc (patch) | |
tree | 30d29d5107bcf9b37c35ca8032a677cb3bdf46c6 /svtools/source/control | |
parent | 29d6cfdca55c56a61c5a22c42f764697b5dc03b4 (diff) |
convert hard-coded layout of char name tabpage to .ui
Change-Id: I20829b6a0835bf96489d67b6f7effcfa84650328
Diffstat (limited to 'svtools/source/control')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 69 |
1 files changed, 65 insertions, 4 deletions
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() |