From 1bfb59ba81984b056d96c442405a31cc3aeb744d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 9 Oct 2016 20:43:31 +0100 Subject: de-src solo ComboBox Change-Id: Ie3f687f203c66f93114f5b2421af924ae4c2f76a --- sfx2/source/dialog/dinfdlg.cxx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'sfx2/source/dialog/dinfdlg.cxx') diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 62176bf44a16..c763f6a779fb 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -1402,9 +1403,26 @@ void CustomPropertiesYesNoButton::Resize() m_aNoButton->SetPosSizePixel(aPos, aSize); } +namespace +{ + VclPtr makeComboBox(vcl::Window *pParent) + { + VclPtr aNameBox(VclPtr::Create(pParent, WB_TABSTOP|WB_DROPDOWN| + WB_AUTOSIZE|WB_AUTOHSCROLL)); + Point aPos(aNameBox->LogicToPixel(Point(0, 2), MapUnit::MapAppFont)); + Size aSize(aNameBox->LogicToPixel(Size(60, 72), MapUnit::MapAppFont)); + aNameBox->SetPosSizePixel(aPos, aSize); + std::vector aList; + tools::StringListResource aRes(SfxResId(RID_STR_TYPE_CONST), aList); + for (const auto& rName : aList) + aNameBox->InsertEntry(rName); + return aNameBox; + } +} + // struct CustomPropertyLine --------------------------------------------- CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : - m_aNameBox ( VclPtr::Create(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ), + m_aNameBox ( makeComboBox(pParent) ), m_aTypeBox ( VclPtr::Create(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ), m_aValueEdit ( VclPtr::Create(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ), m_aDateField ( VclPtr::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), @@ -1451,7 +1469,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent, m_pHeaderAccName(pHeaderAccName), m_pHeaderAccType(pHeaderAccType), m_pHeaderAccValue(pHeaderAccValue), - m_aNameBox ( VclPtr::Create( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ), + m_aNameBox ( makeComboBox(this) ), m_aTypeBox ( VclPtr::Create( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ), m_aValueEdit ( VclPtr::Create( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ), m_aDateField ( VclPtr::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), -- cgit