summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx50
-rw-r--r--svx/source/tbxctrls/itemwin.cxx63
2 files changed, 84 insertions, 29 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 );
+}
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 6db5a748aa8d..204e3e069b2b 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: itemwin.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: cl $ $Date: 2002-03-01 09:17:05 $
+ * 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
@@ -107,13 +107,13 @@
SvxLineBox::SvxLineBox( Window* pParent, SfxBindings& rBind, WinBits nBits ) :
LineLB( pParent, nBits ),
-
+ aLogicalSize(40,140),
nCurPos ( 0 ),
rBindings ( rBind ),
bRelease ( TRUE )
{
- SetSizePixel( Size( 90, 260 ) );
+ SetSizePixel( LogicToPixel( aLogicalSize, MAP_APPFONT ));
Show();
aDelayTimer.SetTimeout( DELAY_TIMEOUT );
@@ -271,6 +271,19 @@ void SvxLineBox::ReleaseFocus_Impl()
if ( pShellWnd )
pShellWnd->GrabFocus();
}
+/* -----------------------------08.03.2002 15:39------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ }
+
+ LineLB::DataChanged( rDCEvt );
+}
//========================================================================
// SvxColorBox
@@ -279,23 +292,16 @@ void SvxLineBox::ReleaseFocus_Impl()
SvxColorBox::SvxColorBox( Window* pParent, USHORT nSID, SfxBindings& rBind, WinBits nBits ) :
ColorLB( pParent, nBits ),
-
+ aLogicalSize(45,80),
nCurPos ( 0 ),
nId ( nSID ),
rBindings ( rBind ),
bRelease ( TRUE )
{
- SetSizePixel( Size( 100, 180 ) );
+ SetSizePixel( LogicToPixel( aLogicalSize , MAP_APPFONT));
Show();
-/*
- aDelayTimer.SetTimeout( DELAY_TIMEOUT );
- aDelayTimer.SetTimeoutHdl( LINK( this, SvxColorBox, DelayHdl_Impl ) );
- aDelayTimer.Start();
- Jetzt im DelayHdl()
-
-*/
SfxObjectShell* pSh = SfxObjectShell::Current();
if ( pSh )
@@ -408,7 +414,19 @@ long SvxColorBox::Notify( NotifyEvent& rNEvt )
}
return nHandled;
}
+/* -----------------------------08.03.2002 15:35------------------------------
+ ---------------------------------------------------------------------------*/
+void SvxColorBox::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ }
+
+ ColorLB::DataChanged( rDCEvt );
+}
// -----------------------------------------------------------------------
void SvxColorBox::ReleaseFocus_Impl()
@@ -431,7 +449,6 @@ void SvxColorBox::ReleaseFocus_Impl()
SvxMetricField::SvxMetricField( Window* pParent, SfxBindings& rBind, WinBits nBits ) :
MetricField( pParent, nBits ),
-
aCurTxt ( String() ),
rBindings ( rBind )
@@ -444,6 +461,7 @@ SvxMetricField::SvxMetricField( Window* pParent, SfxBindings& rBind, WinBits nBi
aSize.Height() += 5;
#endif
SetSizePixel( aSize );
+ aLogicalSize = PixelToLogic(aSize, MAP_APPFONT);
SetUnit( FUNIT_MM );
SetDecimalDigits( 2 );
SetMax( 5000 );
@@ -586,6 +604,19 @@ long SvxMetricField::Notify( NotifyEvent& rNEvt )
}
return nHandled;
}
+/* -----------------------------08.03.2002 15:32------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SvxMetricField::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ }
+
+ MetricField::DataChanged( rDCEvt );
+}
//========================================================================
// SvxFillTypeBox
@@ -600,7 +631,7 @@ SvxFillTypeBox::SvxFillTypeBox( Window* pParent, WinBits nBits ) :
bRelease(TRUE)
{
- SetSizePixel( Size( 90, 100 ) );
+ SetSizePixel( LogicToPixel( Size(40, 40 ),MAP_APPFONT ));
Fill();
SelectEntryPos( XFILL_SOLID );
Show();
@@ -687,7 +718,7 @@ SvxFillAttrBox::SvxFillAttrBox( Window* pParent, WinBits nBits ) :
{
SetPosPixel( Point( 90, 0 ) );
- SetSizePixel( Size( 110, 180 ) );
+ SetSizePixel( LogicToPixel( Size(50, 80 ), MAP_APPFONT ));
Show();
}