summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/fillctrl.cxx
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-03-12 12:06:30 +0000
committerOliver Specht <os@openoffice.org>2002-03-12 12:06:30 +0000
commitfd910344c031eb1ea8d3f20749944f71da4303b8 (patch)
tree6e07139d87e038f5fef46fe57893d83db01d560a /svx/source/tbxctrls/fillctrl.cxx
parent435e5e749ffadf1ae53f1a254b336ea8b20624e9 (diff)
#97051# Controllers change their size depending on the system font settings
Diffstat (limited to 'svx/source/tbxctrls/fillctrl.cxx')
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx50
1 files changed, 37 insertions, 13 deletions
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index ac568531469e..9d8676706f6d 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fillctrl.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: cl $ $Date: 2002-03-01 09:15:12 $
+ * last change: $Author: os $ $Date: 2002-03-12 13:06:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,7 +124,6 @@ SvxFillToolBoxControl::SvxFillToolBoxControl( USHORT nId, ToolBox& rTbx, SfxBind
bUpdate ( FALSE ),
eLastXFS ( XFILL_NONE )
-
{
StartListening( rBind );
}
@@ -550,18 +549,19 @@ Window* SvxFillToolBoxControl::CreateItemWindow( Window *pParent )
\************************************************************************/
FillControl::FillControl( Window* pParent, WinBits nStyle ) :
- Window( pParent, nStyle | WB_DIALOGCONTROL )
+ Window( pParent, nStyle | WB_DIALOGCONTROL ),
+ pLbFillType(new SvxFillTypeBox( this )),
+ aLogicalFillSize(40,80),
+ aLogicalAttrSize(50,80)
{
-#ifdef OS2
- WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL;
- pLbFillType = new SvxFillTypeBox( this, nBits );
-#else
- pLbFillType = new SvxFillTypeBox( this );
-#endif
pLbFillAttr = new SvxFillAttrBox( this );
-
- Size aTypeSize = pLbFillType->GetSizePixel();
- Size aAttrSize = pLbFillAttr->GetSizePixel();
+ Size aTypeSize(LogicToPixel(aLogicalFillSize, MAP_APPFONT));
+ Size aAttrSize(LogicToPixel(aLogicalAttrSize, MAP_APPFONT));
+ pLbFillType->SetSizePixel(aTypeSize);
+ pLbFillAttr->SetSizePixel(aAttrSize);
+ //to get the base height
+ aTypeSize = pLbFillType->GetSizePixel();
+ aAttrSize = pLbFillAttr->GetSizePixel();
Point aAttrPnt = pLbFillAttr->GetPosPixel();
SetSizePixel(
Size( aAttrPnt.X() + aAttrSize.Width(),
@@ -810,4 +810,28 @@ void FillControl::Resize()
pLbFillType->SetSizePixel( Size( nW * 2 - nSep, nH ) );
pLbFillAttr->SetPosSizePixel( Point( nW * 2 + nSep, 0 ), Size( nW * 3 - nSep, nH ) );
}
+/* -----------------------------08.03.2002 15:04------------------------------
+
+ ---------------------------------------------------------------------------*/
+
+void FillControl::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ Size aTypeSize(LogicToPixel(aLogicalFillSize, MAP_APPFONT));
+ Size aAttrSize(LogicToPixel(aLogicalAttrSize, MAP_APPFONT));
+ pLbFillType->SetSizePixel(aTypeSize);
+ pLbFillAttr->SetSizePixel(aAttrSize);
+ //to get the base height
+ aTypeSize = pLbFillType->GetSizePixel();
+ aAttrSize = pLbFillAttr->GetSizePixel();
+ Point aAttrPnt = pLbFillAttr->GetPosPixel();
+
+ SetSizePixel(
+ Size( aAttrPnt.X() + aAttrSize.Width(),
+ Max( aAttrSize.Height(), aTypeSize.Height() ) ) );
+ }
+ Window::DataChanged( rDCEvt );
+}