diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-07-05 14:55:21 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-07-05 14:55:21 +0000 |
commit | ed61d550f0a7519a31ed4f801eb296891d560f54 (patch) | |
tree | 1326ac6588225ec3e4d0ffd1ed8a23ae3187d71c /toolkit/source | |
parent | 8852630686e9b7357410f7b94ed9322321ff9e53 (diff) |
INTEGRATION: CWS frmcontrols04 (1.44.14); FILE MERGED
2004/06/16 04:35:01 fs 1.44.14.5: RESYNC: (1.44-1.45); FILE MERGED
2004/05/07 10:59:33 fs 1.44.14.4: getProperty: Border should be signed, not unsigned
2004/04/29 10:54:29 fs 1.44.14.3: #i24694# support for BorderColor
2004/04/29 08:04:06 fs 1.44.14.2: #i24692# Text alignment for push button, option button, check box, list box, combo box
2004/04/29 07:38:17 fs 1.44.14.1: #i24681# WordBreak property for push buttons, option buttons, and check boxes
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 96 |
1 files changed, 72 insertions, 24 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 24565326d674..4df586e85bf3 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2,9 +2,9 @@ * * $RCSfile: vclxwindow.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: rt $ $Date: 2004-05-07 16:16:58 $ + * last change: $Author: obo $ $Date: 2004-07-05 15:55:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1013,6 +1013,25 @@ void VCLXWindow::getStyles( sal_Int16 nType, ::com::sun::star::awt::FontDescript } } +namespace toolkit +{ + static void setColorSettings( Window* _pWindow, const ::com::sun::star::uno::Any& _rValue, + void (StyleSettings::*pSetter)( const Color& ), const Color& (StyleSettings::*pGetter)( ) const ) + { + sal_Int32 nColor = 0; + if ( !( _rValue >>= nColor ) ) + nColor = (Application::GetSettings().GetStyleSettings().*pGetter)().GetColor(); + + AllSettings aSettings = _pWindow->GetSettings(); + StyleSettings aStyleSettings = aSettings.GetStyleSettings(); + + (aStyleSettings.*pSetter)( Color( nColor ) ); + + aSettings.SetStyleSettings( aStyleSettings ); + _pWindow->SetSettings( aSettings, TRUE ); + } +} + void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -1231,14 +1250,25 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; case BASEPROPERTY_ALIGN: { + sal_Int16 nAlign = PROPERTY_ALIGN_LEFT; switch ( eWinType ) { + case WINDOW_COMBOBOX: + case WINDOW_BUTTON: + case WINDOW_PUSHBUTTON: + case WINDOW_OKBUTTON: + case WINDOW_CANCELBUTTON: + case WINDOW_HELPBUTTON: + nAlign = PROPERTY_ALIGN_CENTER; + // no break here! case WINDOW_FIXEDTEXT: case WINDOW_EDIT: + case WINDOW_CHECKBOX: + case WINDOW_RADIOBUTTON: + case WINDOW_LISTBOX: { WinBits nStyle = pWindow->GetStyle(); nStyle &= ~(WB_LEFT|WB_CENTER|WB_RIGHT); - sal_uInt16 nAlign = 0; if ( !bVoid ) Value >>= nAlign; if ( nAlign == PROPERTY_ALIGN_LEFT ) @@ -1255,7 +1285,15 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; case BASEPROPERTY_MULTILINE: { - if ( eWinType == WINDOW_FIXEDTEXT ) + if ( ( eWinType == WINDOW_FIXEDTEXT ) + || ( eWinType == WINDOW_CHECKBOX ) + || ( eWinType == WINDOW_RADIOBUTTON ) + || ( eWinType == WINDOW_BUTTON ) + || ( eWinType == WINDOW_PUSHBUTTON ) + || ( eWinType == WINDOW_OKBUTTON ) + || ( eWinType == WINDOW_CANCELBUTTON ) + || ( eWinType == WINDOW_HELPBUTTON ) + ) { WinBits nStyle = pWindow->GetStyle(); sal_Bool bMulti; @@ -1344,20 +1382,12 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; case BASEPROPERTY_SYMBOL_COLOR: - { - sal_Int32 nButtonTextColor = 0; - if ( !( Value >>= nButtonTextColor ) ) - nButtonTextColor = Application::GetSettings().GetStyleSettings().GetButtonTextColor().GetColor(); - - AllSettings aSettings = pWindow->GetSettings(); - StyleSettings aStyleSettings = aSettings.GetStyleSettings(); - - aStyleSettings.SetButtonTextColor( Color( nButtonTextColor ) ); + ::toolkit::setColorSettings( pWindow, Value, &StyleSettings::SetButtonTextColor, &StyleSettings::GetButtonTextColor ); + break; - aSettings.SetStyleSettings( aStyleSettings ); - pWindow->SetSettings( aSettings, TRUE ); - } - break; + case BASEPROPERTY_BORDERCOLOR: + ::toolkit::setColorSettings( pWindow, Value, &StyleSettings::SetMonoColor, &StyleSettings::GetMonoColor); + break; } } } @@ -1429,7 +1459,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; case BASEPROPERTY_BORDER: { - sal_uInt16 nBorder = 0; + sal_Int16 nBorder = 0; if ( GetWindow()->GetStyle() & WB_BORDER ) nBorder = GetWindow()->GetBorderStyle(); aProp <<= nBorder; @@ -1444,6 +1474,15 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: { case WINDOW_FIXEDTEXT: case WINDOW_EDIT: + case WINDOW_CHECKBOX: + case WINDOW_RADIOBUTTON: + case WINDOW_LISTBOX: + case WINDOW_COMBOBOX: + case WINDOW_BUTTON: + case WINDOW_PUSHBUTTON: + case WINDOW_OKBUTTON: + case WINDOW_CANCELBUTTON: + case WINDOW_HELPBUTTON: { WinBits nStyle = GetWindow()->GetStyle(); if ( nStyle & WB_LEFT ) @@ -1458,7 +1497,15 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: } case BASEPROPERTY_MULTILINE: { - if ( eWinType == WINDOW_FIXEDTEXT ) + if ( ( eWinType == WINDOW_FIXEDTEXT ) + || ( eWinType == WINDOW_CHECKBOX ) + || ( eWinType == WINDOW_RADIOBUTTON ) + || ( eWinType == WINDOW_BUTTON ) + || ( eWinType == WINDOW_PUSHBUTTON ) + || ( eWinType == WINDOW_OKBUTTON ) + || ( eWinType == WINDOW_CANCELBUTTON ) + || ( eWinType == WINDOW_HELPBUTTON ) + ) aProp <<= (sal_Bool) ( GetWindow()->GetStyle() & WB_WORDBREAK ) ? sal_True : sal_False; } break; @@ -1487,11 +1534,12 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; case BASEPROPERTY_SYMBOL_COLOR: - { - sal_Int32 nButtonTextColor = GetWindow()->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor(); - aProp <<= nButtonTextColor; - } - break; + aProp <<= (sal_Int32)GetWindow()->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor(); + break; + + case BASEPROPERTY_BORDERCOLOR: + aProp <<= (sal_Int32)GetWindow()->GetSettings().GetStyleSettings().GetMonoColor().GetColor(); + break; } } return aProp; |