summaryrefslogtreecommitdiff
path: root/padmin/source/helper.cxx
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2001-06-26 18:27:24 +0000
committerPhilipp Lohmann <pl@openoffice.org>2001-06-26 18:27:24 +0000
commitfe958007bf53d284f173201a7f6f0c987c7c1256 (patch)
treebe327406d7bb8667b7dac696a813fa29a1895174 /padmin/source/helper.cxx
parent5c181f18afe4347e35e6c21f5432f641e22d0777 (diff)
#85520# add: rename fonts
Diffstat (limited to 'padmin/source/helper.cxx')
-rw-r--r--padmin/source/helper.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 794ea27a588e..a9c3f56c8989 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: helper.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2001-06-19 13:47:44 $
+ * last change: $Author: pl $ $Date: 2001-06-26 19:27:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -194,17 +194,32 @@ long DelListBox::Notify( NotifyEvent& rEvent )
* QueryString
*/
-QueryString::QueryString( Window* pParent, String& rQuery, String& rRet ) :
+QueryString::QueryString( Window* pParent, String& rQuery, String& rRet, const ::std::list< String >& rChoices ) :
m_rReturnValue( rRet ),
ModalDialog( pParent, PaResId( RID_STRINGQUERYDLG ) ),
m_aOKButton( this, PaResId( RID_STRQRY_BTN_OK ) ),
m_aEdit( this, PaResId( RID_STRQRY_EDT_NEWNAME ) ),
+ m_aComboBox( this, PaResId( RID_STRQRY_BOX_NEWNAME ) ),
m_aFixedText( this, PaResId( RID_STRQRY_TXT_RENAME ) ),
m_aCancelButton( this, PaResId( RID_STRQRY_BTN_CANCEL ) )
{
m_aOKButton.SetClickHdl( LINK( this, QueryString, ClickBtnHdl ) );
m_aFixedText.SetText( rQuery );
- m_aEdit.SetText( m_rReturnValue );
+ if( rChoices.begin() != rChoices.end() )
+ {
+ m_aComboBox.SetText( m_rReturnValue );
+ m_aComboBox.InsertEntry( m_rReturnValue );
+ for( ::std::list<String>::const_iterator it = rChoices.begin(); it != rChoices.end(); ++it )
+ m_aComboBox.InsertEntry( *it );
+ m_aEdit.Show( FALSE );
+ m_bUseEdit = false;
+ }
+ else
+ {
+ m_aEdit.SetText( m_rReturnValue );
+ m_aComboBox.Show( FALSE );
+ m_bUseEdit = true;
+ }
SetText( Application::GetDisplayName() );
FreeResource();
}
@@ -217,7 +232,7 @@ IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton )
{
if( pButton == &m_aOKButton )
{
- m_rReturnValue = m_aEdit.GetText();
+ m_rReturnValue = m_bUseEdit ? m_aEdit.GetText() : m_aComboBox.GetText();
EndDialog( 1 );
}
else