summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/tpoption.cxx
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-03-22 13:15:58 +0000
committerOliver Specht <os@openoffice.org>2001-03-22 13:15:58 +0000
commit079a4199ad2129505c24334ee8484564b91827e2 (patch)
tree962441e9525b6f0c40734ca0c6fd903092f73e33 /sd/source/ui/dlg/tpoption.cxx
parentf22c6c746995a9bfb354ee06b166200c13da32e8 (diff)
option dialog changed
Diffstat (limited to 'sd/source/ui/dlg/tpoption.cxx')
-rw-r--r--sd/source/ui/dlg/tpoption.cxx499
1 files changed, 210 insertions, 289 deletions
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index b695642dc932..69c042687a0d 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tpoption.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ka $ $Date: 2000-10-24 11:16:24 $
+ * last change: $Author: os $ $Date: 2001-03-22 14:14:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -88,33 +88,22 @@
\************************************************************************/
SdTpOptionsSnap::SdTpOptionsSnap( Window* pParent, const SfxItemSet& rInAttrs ) :
- SfxTabPage ( pParent, SdResId( TP_OPTIONS_SNAP ), rInAttrs ),
-
- aFiSnap ( this, SdResId( FI_SNAP ) ),
- aCbxSnapGrid ( this, SdResId( CBX_SNAP_GRID ) ),
- aCbxSnapHelplines ( this, SdResId( CBX_SNAP_HELPLINES ) ),
- aCbxSnapBorder ( this, SdResId( CBX_SNAP_BORDER ) ),
- aCbxSnapFrame ( this, SdResId( CBX_SNAP_FRAME ) ),
- aCbxSnapPoints ( this, SdResId( CBX_SNAP_POINTS ) ),
- aFtSnapArea ( this, SdResId( FT_SNAP_AREA ) ),
- aMtrFldSnapArea ( this, SdResId( MTR_FLD_SNAP_AREA ) ),
- aGrpSnap ( this, SdResId( GRP_SNAP ) ),
- aFiOrtho ( this, SdResId( FI_ORTHO ) ),
- aCbxOrtho ( this, SdResId( CBX_ORTHO ) ),
- aCbxBigOrtho ( this, SdResId( CBX_BIGORTHO ) ),
- aCbxRotate ( this, SdResId( CBX_ROTATE ) ),
- aMtrFldAngle ( this, SdResId( MTR_FLD_ANGLE ) ),
- aFtBezAngle ( this, SdResId( FT_BEZ_ANGLE ) ),
- aMtrFldBezAngle ( this, SdResId( MTR_FLD_BEZ_ANGLE ) ),
- aGrpOrtho ( this, SdResId( GRP_ORTHO ) ),
- rOutAttrs ( rInAttrs ),
- pExampleSet (0)
+ SvxGridTabPage(pParent, rInAttrs)
{
- FreeResource();
-
- SetExchangeSupport();
-
- aCbxRotate.SetClickHdl( LINK( this, SdTpOptionsSnap, ClickRotateHdl ) );
+ aGrpSnap.Show();
+ aCbxSnapHelplines.Show();
+ aCbxSnapBorder.Show();
+ aCbxSnapFrame.Show();
+ aCbxSnapPoints.Show();
+ aFtSnapArea.Show();
+ aMtrFldSnapArea.Show();
+ aGrpOrtho.Show();
+ aCbxOrtho.Show();
+ aCbxBigOrtho.Show();
+ aCbxRotate.Show();
+ aMtrFldAngle.Show();
+ aFtBezAngle.Show();
+ aMtrFldBezAngle.Show();
}
// -----------------------------------------------------------------------
@@ -127,9 +116,10 @@ SdTpOptionsSnap::~SdTpOptionsSnap()
BOOL SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
{
+ SvxGridTabPage::FillItemSet(rAttrs);
SdOptionsSnapItem* pOptsItem = NULL;
- if(SFX_ITEM_SET != rAttrs.GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem ))
- pExampleSet->GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem );
+// if(SFX_ITEM_SET != rAttrs.GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem ))
+// pExampleSet->GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem );
SdOptionsSnapItem aOptsItem( ATTR_OPTIONS_SNAP );
@@ -150,22 +140,6 @@ BOOL SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
// Evtl. vorhandenes GridItem wird geholt, um nicht versehentlich
// irgendwelche Standardwerte einzustellen
const SfxPoolItem* pAttr = NULL;
-
- // der ExampleSet wird im Reset mit dem inputset initialisiert
- DBG_ASSERT(pExampleSet, "Wo ist der ExampleSet?")
- if( SFX_ITEM_SET != rAttrs.GetItemState( SID_ATTR_GRID_OPTIONS , FALSE, (const SfxPoolItem**) &pAttr ) )
- pExampleSet->GetItemState( SID_ATTR_GRID_OPTIONS , FALSE, (const SfxPoolItem**) &pAttr );
-
- if( pAttr )
- {
- SdOptionsGridItem* pGridAttr = (SdOptionsGridItem*) pAttr;
- if(pGridAttr->GetUseGridSnap() != aCbxSnapGrid.IsChecked())
- {
- pGridAttr->SetUseGridSnap( aCbxSnapGrid.IsChecked() );
- rAttrs.Put( *pGridAttr );
- }
- }
-
return( TRUE );
}
@@ -173,7 +147,7 @@ BOOL SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
void __EXPORT SdTpOptionsSnap::Reset( const SfxItemSet& rAttrs )
{
- pExampleSet = &rAttrs;
+ SvxGridTabPage::Reset(rAttrs);
SdOptionsSnapItem aOptsItem( (const SdOptionsSnapItem&) rAttrs.
Get( ATTR_OPTIONS_SNAP ) );
@@ -189,7 +163,7 @@ void __EXPORT SdTpOptionsSnap::Reset( const SfxItemSet& rAttrs )
aMtrFldAngle.SetValue( aOptsItem.GetAngle() );
aMtrFldBezAngle.SetValue( aOptsItem.GetEliminatePolyPointLimitAngle() );
- ClickRotateHdl( NULL );
+ aCbxRotate.GetClickHdl().Call(0);
}
// -----------------------------------------------------------------------
@@ -200,243 +174,6 @@ SfxTabPage* __EXPORT SdTpOptionsSnap::Create( Window* pWindow,
return( new SdTpOptionsSnap( pWindow, rAttrs ) );
}
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SdTpOptionsSnap, ClickRotateHdl, void *, p )
-{
- if( aCbxRotate.IsChecked() )
- aMtrFldAngle.Enable();
- else
- aMtrFldAngle.Disable();
-
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-void SdTpOptionsSnap::ActivatePage( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pAttr = NULL;
-
- if( SFX_ITEM_SET != rSet.GetItemState( SID_ATTR_GRID_OPTIONS , FALSE, (const SfxPoolItem**)&pAttr ))
- if( SFX_ITEM_SET != pExampleSet->GetItemState( SID_ATTR_GRID_OPTIONS, FALSE, (const SfxPoolItem**)&pAttr ))
- pAttr = NULL;
-
- if(pAttr)
- {
- SdOptionsGridItem* pGridAttr = (SdOptionsGridItem*) pAttr;
- aCbxSnapGrid.Check( pGridAttr->GetUseGridSnap() );
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SdTpOptionsSnap::DeactivatePage( SfxItemSet* pSet )
-{
- FillItemSet( *pSet );
-
- return( LEAVE_PAGE );
-}
-
-/*************************************************************************
-|*
-|* TabPage zum Einstellen der Layout-Optionen
-|*
-\************************************************************************/
-
-SdTpOptionsLayout::SdTpOptionsLayout( Window* pParent, const SfxItemSet& rInAttrs ) :
- SfxTabPage ( pParent, SdResId( TP_OPTIONS_LAYOUT ), rInAttrs ),
- aCbxRuler ( this, SdResId( CBX_RULER ) ),
- aCbxMoveOutline ( this, SdResId( CBX_MOVE_OUTLINE ) ),
- aCbxDragStripes ( this, SdResId( CBX_HELPLINES ) ),
- aCbxHandlesBezier ( this, SdResId( CBX_HANDLES_BEZIER ) ),
- aGrpDisplay ( this, SdResId( GRP_DISPLAY ) ),
-
- aLbMetric ( this, ResId( LB_METRIC ) ),
- aGrpMetric ( this, ResId( GRP_METRIC ) ),
-
- aMtrFldTabstop ( this, ResId( MTR_FLD_TABSTOP ) ),
- aGrpTabstop ( this, ResId( GRP_TABSTOP ) ),
-
- rOutAttrs ( rInAttrs )
-{
- FreeResource();
-
- SetExchangeSupport();
-
- // Metrik einstellen
- FieldUnit eFUnit;
-
- USHORT nWhich = GetWhich( SID_ATTR_METRIC );
- if ( rInAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SfxUInt16Item& rItem = (SfxUInt16Item&)rInAttrs.Get( nWhich );
- eFUnit = (FieldUnit)rItem.GetValue();
- }
- else
- eFUnit = GetModuleFieldUnit();
-
- SetFieldUnit( aMtrFldTabstop, eFUnit );
-
- // ListBox mit Metriken f"ullen
- SvxStringArray aMetricArr( RID_SVXSTR_FIELDUNIT_TABLE );
-
- for ( USHORT i = 0; i < aMetricArr.Count(); ++i )
- {
- String sMetric = aMetricArr.GetStringByPos( i );
- long nFieldUnit = aMetricArr.GetValue( i );
- USHORT nPos = aLbMetric.InsertEntry( sMetric );
- aLbMetric.SetEntryData( nPos, (void*)nFieldUnit );
- }
- aLbMetric.SetSelectHdl( LINK( this, SdTpOptionsLayout, SelectMetricHdl_Impl ) );
-}
-
-// -----------------------------------------------------------------------
-
-SdTpOptionsLayout::~SdTpOptionsLayout()
-{
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SdTpOptionsLayout::FillItemSet( SfxItemSet& rAttrs )
-{
- BOOL bModified = FALSE;
-
- if( aCbxRuler.GetSavedValue() != aCbxRuler.IsChecked() ||
- aCbxMoveOutline.GetSavedValue() != aCbxMoveOutline.IsChecked() ||
- aCbxDragStripes.GetSavedValue() != aCbxDragStripes.IsChecked() ||
- //aCbxHelplines.GetSavedValue() != aCbxHelplines.IsChecked() ||
- aCbxHandlesBezier.GetSavedValue() != aCbxHandlesBezier.IsChecked() )
- {
- bModified = TRUE;
- }
-
- SdOptionsLayoutItem aOptsItem( ATTR_OPTIONS_LAYOUT );
-
- aOptsItem.SetRulerVisible( aCbxRuler.IsChecked() );
- aOptsItem.SetMoveOutline( aCbxMoveOutline.IsChecked() );
- aOptsItem.SetDragStripes( aCbxDragStripes.IsChecked() );
- aOptsItem.SetHandlesBezier( aCbxHandlesBezier.IsChecked() );
- //aOptsItem.SetHelplines( aCbxHelplines.IsChecked() );
-
- rAttrs.Put( aOptsItem );
-
- // Metrik
- const USHORT nMPos = aLbMetric.GetSelectEntryPos();
- if ( nMPos != aLbMetric.GetSavedValue() )
- {
- USHORT nFieldUnit = (USHORT)(long)aLbMetric.GetEntryData( nMPos );
- rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ),
- (UINT16)nFieldUnit ) );
- bModified |= TRUE;
- }
-
- // Tabulatorabstand
- if( aMtrFldTabstop.GetText() != aMtrFldTabstop.GetSavedValue() )
- {
- USHORT nWh = GetWhich( SID_ATTR_DEFTABSTOP );
- SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWh );
- SfxUInt16Item aDef( nWh,(USHORT)GetCoreValue( aMtrFldTabstop, eUnit ) );
- rAttrs.Put( aDef );
- bModified |= TRUE;
- }
- return( bModified );
-}
-
-// -----------------------------------------------------------------------
-
-void SdTpOptionsLayout::Reset( const SfxItemSet& rAttrs )
-{
- SdOptionsLayoutItem aOptsItem( (const SdOptionsLayoutItem&) rAttrs.
- Get( ATTR_OPTIONS_LAYOUT ) );
-
- aCbxRuler.Check( aOptsItem.IsRulerVisible() );
- aCbxMoveOutline.Check( aOptsItem.IsMoveOutline() );
- aCbxDragStripes.Check( aOptsItem.IsDragStripes() );
- aCbxHandlesBezier.Check( aOptsItem.IsHandlesBezier() );
- //aCbxHelplines.Check( aOptsItem.IsHelplines() );
-
- aCbxRuler.SaveValue();
- aCbxMoveOutline.SaveValue();
- aCbxDragStripes.SaveValue();
- aCbxHandlesBezier.SaveValue();
- //aCbxHelplines.SaveValue();
-
- // Metrik
- USHORT nWhich = GetWhich( SID_ATTR_METRIC );
- aLbMetric.SetNoSelection();
-
- if ( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
- long nFieldUnit = (long)rItem.GetValue();
-
- for ( USHORT i = 0; i < aLbMetric.GetEntryCount(); ++i )
- {
- if ( (long)aLbMetric.GetEntryData( i ) == nFieldUnit )
- {
- aLbMetric.SelectEntryPos( i );
- break;
- }
- }
- }
-
- // Tabulatorabstand
- nWhich = GetWhich( SID_ATTR_DEFTABSTOP );
- if( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWhich );
- const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
- SetMetricValue( aMtrFldTabstop, rItem.GetValue(), eUnit );
- }
- aLbMetric.SaveValue();
- aMtrFldTabstop.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* __EXPORT SdTpOptionsLayout::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SdTpOptionsLayout( pWindow, rAttrs ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SdTpOptionsLayout::ActivatePage( const SfxItemSet& rSet )
-{
- // Hier muss noch einmal SaveValue gerufen werden, da sonst u.U.
- // der Wert in anderen TabPages keine Wirkung hat
- aLbMetric.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-int SdTpOptionsLayout::DeactivatePage( SfxItemSet* pSet )
-{
- FillItemSet( *pSet );
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SdTpOptionsLayout, SelectMetricHdl_Impl, ListBox *, EMPTYARG )
-{
- USHORT nPos = aLbMetric.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- FieldUnit eUnit = (FieldUnit)(long)aLbMetric.GetEntryData( nPos );
- long nVal =
- aMtrFldTabstop.Denormalize( aMtrFldTabstop.GetValue( FUNIT_TWIP ) );
- SetFieldUnit( aMtrFldTabstop, eUnit );
- aMtrFldTabstop.SetValue( aMtrFldTabstop.Normalize( nVal ), FUNIT_TWIP );
- }
- return 0;
-}
-
/*************************************************************************
|*
|* TabPage zum Einstellen der Inhalte-Optionen
@@ -450,8 +187,11 @@ SdTpOptionsContents::SdTpOptionsContents( Window* pParent, const SfxItemSet& rIn
aCbxNoText ( this, SdResId( CBX_NOTEXT ) ),
aCbxHairlineMode ( this, SdResId( CBX_HAIRLINEMODE ) ),
aGrpViewSubstitute ( this, SdResId( GRP_VIEW_SUBSTITUTE ) ),
-
- rOutAttrs ( rInAttrs )
+ aCbxRuler ( this, SdResId( CBX_RULER ) ),
+ aCbxMoveOutline ( this, SdResId( CBX_MOVE_OUTLINE ) ),
+ aCbxDragStripes ( this, SdResId( CBX_HELPLINES ) ),
+ aCbxHandlesBezier ( this, SdResId( CBX_HANDLES_BEZIER ) ),
+ aGrpDisplay ( this, SdResId( GRP_DISPLAY ) )
{
FreeResource();
}
@@ -484,6 +224,24 @@ BOOL SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs )
bModified = TRUE;
}
+
+ if( aCbxRuler.GetSavedValue() != aCbxRuler.IsChecked() ||
+ aCbxMoveOutline.GetSavedValue() != aCbxMoveOutline.IsChecked() ||
+ aCbxDragStripes.GetSavedValue() != aCbxDragStripes.IsChecked() ||
+ //aCbxHelplines.GetSavedValue() != aCbxHelplines.IsChecked() ||
+ aCbxHandlesBezier.GetSavedValue() != aCbxHandlesBezier.IsChecked() )
+ {
+ SdOptionsLayoutItem aOptsItem( ATTR_OPTIONS_LAYOUT );
+
+ aOptsItem.SetRulerVisible( aCbxRuler.IsChecked() );
+ aOptsItem.SetMoveOutline( aCbxMoveOutline.IsChecked() );
+ aOptsItem.SetDragStripes( aCbxDragStripes.IsChecked() );
+ aOptsItem.SetHandlesBezier( aCbxHandlesBezier.IsChecked() );
+ //aOptsItem.SetHelplines( aCbxHelplines.IsChecked() );
+
+ rAttrs.Put( aOptsItem );
+ bModified = TRUE;
+ }
return( bModified );
}
@@ -503,6 +261,21 @@ void SdTpOptionsContents::Reset( const SfxItemSet& rAttrs )
aCbxOutlineMode.SaveValue();
aCbxNoText.SaveValue();
aCbxHairlineMode.SaveValue();
+
+ SdOptionsLayoutItem aLayoutItem( (const SdOptionsLayoutItem&) rAttrs.
+ Get( ATTR_OPTIONS_LAYOUT ) );
+
+ aCbxRuler.Check( aLayoutItem.IsRulerVisible() );
+ aCbxMoveOutline.Check( aLayoutItem.IsMoveOutline() );
+ aCbxDragStripes.Check( aLayoutItem.IsDragStripes() );
+ aCbxHandlesBezier.Check( aLayoutItem.IsHandlesBezier() );
+ //aCbxHelplines.Check( aLayoutItem.IsHelplines() );
+
+ aCbxRuler.SaveValue();
+ aCbxMoveOutline.SaveValue();
+ aCbxDragStripes.SaveValue();
+ aCbxHandlesBezier.SaveValue();
+ //aCbxHelplines.SaveValue();
}
// -----------------------------------------------------------------------
@@ -530,7 +303,6 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs )
aGrpProgramStart ( this, SdResId( GRP_PROGRAMSTART ) ),
aCbxMasterPageCache ( this, SdResId( CBX_MASTERPAGE_CACHE ) ),
- aGrpDisplay ( this, SdResId( GRP_DISPLAY ) ),
aCbxCopy ( this, SdResId( CBX_COPY ) ),
aCbxMarkedHitMovesAlways ( this, SdResId( CBX_MARKED_HIT_MOVES_ALWAYS ) ),
@@ -541,9 +313,40 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs )
aCbxStartWithActualPage ( this, SdResId( CBX_START_WITH_ACTUAL_PAGE ) ),
aGrpStartWithActualPage ( this, SdResId( GRP_START_WITH_ACTUAL_PAGE ) ),
- rOutAttrs ( rInAttrs )
+ aGrpSettings ( this, SdResId( GRP_SETTINGS ) ),
+ aTxtMetric ( this, SdResId( FT_METRIC ) ),
+ aLbMetric ( this, SdResId( LB_METRIC ) ),
+ aTxtTabstop ( this, SdResId( FT_TABSTOP ) ),
+ aMtrFldTabstop ( this, SdResId( MTR_FLD_TABSTOP ) )
{
FreeResource();
+ SetExchangeSupport();
+
+ // Metrik einstellen
+ FieldUnit eFUnit;
+
+ USHORT nWhich = GetWhich( SID_ATTR_METRIC );
+ if ( rInAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
+ {
+ const SfxUInt16Item& rItem = (SfxUInt16Item&)rInAttrs.Get( nWhich );
+ eFUnit = (FieldUnit)rItem.GetValue();
+ }
+ else
+ eFUnit = GetModuleFieldUnit();
+
+ SetFieldUnit( aMtrFldTabstop, eFUnit );
+
+ // ListBox mit Metriken f"ullen
+ SvxStringArray aMetricArr( RID_SVXSTR_FIELDUNIT_TABLE );
+
+ for ( USHORT i = 0; i < aMetricArr.Count(); ++i )
+ {
+ String sMetric = aMetricArr.GetStringByPos( i );
+ long nFieldUnit = aMetricArr.GetValue( i );
+ USHORT nPos = aLbMetric.InsertEntry( sMetric );
+ aLbMetric.SetEntryData( nPos, (void*)nFieldUnit );
+ }
+ aLbMetric.SetSelectHdl( LINK( this, SdTpOptionsMisc, SelectMetricHdl_Impl ) );
}
// -----------------------------------------------------------------------
@@ -551,6 +354,22 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs )
SdTpOptionsMisc::~SdTpOptionsMisc()
{
}
+// -----------------------------------------------------------------------
+void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
+{
+ // Hier muss noch einmal SaveValue gerufen werden, da sonst u.U.
+ // der Wert in anderen TabPages keine Wirkung hat
+ aLbMetric.SaveValue();
+}
+
+// -----------------------------------------------------------------------
+
+int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pSet )
+{
+ FillItemSet( *pSet );
+
+ return LEAVE_PAGE;
+}
// -----------------------------------------------------------------------
@@ -583,6 +402,27 @@ BOOL SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
bModified = TRUE;
}
+
+ // Metrik
+ const USHORT nMPos = aLbMetric.GetSelectEntryPos();
+ if ( nMPos != aLbMetric.GetSavedValue() )
+ {
+ USHORT nFieldUnit = (USHORT)(long)aLbMetric.GetEntryData( nMPos );
+ rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ),
+ (UINT16)nFieldUnit ) );
+ bModified |= TRUE;
+ }
+
+ // Tabulatorabstand
+ if( aMtrFldTabstop.GetText() != aMtrFldTabstop.GetSavedValue() )
+ {
+ USHORT nWh = GetWhich( SID_ATTR_DEFTABSTOP );
+ SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWh );
+ SfxUInt16Item aDef( nWh,(USHORT)GetCoreValue( aMtrFldTabstop, eUnit ) );
+ rAttrs.Put( aDef );
+ bModified |= TRUE;
+ }
+
return( bModified );
}
@@ -609,6 +449,36 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
aCbxMasterPageCache.SaveValue();
aCbxCopy.SaveValue();
aCbxStartWithActualPage.SaveValue();
+
+ // Metrik
+ USHORT nWhich = GetWhich( SID_ATTR_METRIC );
+ aLbMetric.SetNoSelection();
+
+ if ( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
+ {
+ const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
+ long nFieldUnit = (long)rItem.GetValue();
+
+ for ( USHORT i = 0; i < aLbMetric.GetEntryCount(); ++i )
+ {
+ if ( (long)aLbMetric.GetEntryData( i ) == nFieldUnit )
+ {
+ aLbMetric.SelectEntryPos( i );
+ break;
+ }
+ }
+ }
+
+ // Tabulatorabstand
+ nWhich = GetWhich( SID_ATTR_DEFTABSTOP );
+ if( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
+ {
+ SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWhich );
+ const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
+ SetMetricValue( aMtrFldTabstop, rItem.GetValue(), eUnit );
+ }
+ aLbMetric.SaveValue();
+ aMtrFldTabstop.SaveValue();
}
// -----------------------------------------------------------------------
@@ -618,6 +488,57 @@ SfxTabPage* __EXPORT SdTpOptionsMisc::Create( Window* pWindow,
{
return( new SdTpOptionsMisc( pWindow, rAttrs ) );
}
+//------------------------------------------------------------------------
+
+IMPL_LINK( SdTpOptionsMisc, SelectMetricHdl_Impl, ListBox *, EMPTYARG )
+{
+ USHORT nPos = aLbMetric.GetSelectEntryPos();
+ if( nPos != LISTBOX_ENTRY_NOTFOUND )
+ {
+ FieldUnit eUnit = (FieldUnit)(long)aLbMetric.GetEntryData( nPos );
+ long nVal =
+ aMtrFldTabstop.Denormalize( aMtrFldTabstop.GetValue( FUNIT_TWIP ) );
+ SetFieldUnit( aMtrFldTabstop, eUnit );
+ aMtrFldTabstop.SetValue( aMtrFldTabstop.Normalize( nVal ), FUNIT_TWIP );
+ }
+ return 0;
+}
+/* -----------------------------22.03.01 13:03--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void lcl_MoveWin( Window& rWin, long nDiff )
+{
+ Point aPos(rWin.GetPosPixel());
+ aPos.Y() -= nDiff;
+ rWin.SetPosPixel(aPos);
+}
+/* -----------------------------22.03.01 13:10--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SdTpOptionsMisc::SetDrawMode()
+{
+ aCbxStartWithTemplate.Hide();
+ aGrpProgramStart.Hide();
+ aCbxStartWithActualPage.Hide();
+ aGrpStartWithActualPage.Hide();
+ aCbxCrookNoContortion.Show();
+
+ long nDiff = aGrpOther.GetPosPixel().Y() - aGrpProgramStart.GetPosPixel().Y();
+ lcl_MoveWin( aGrpOther, nDiff );
+ lcl_MoveWin( aCbxMasterPageCache, nDiff );
+ lcl_MoveWin( aCbxCopy, nDiff );
+ lcl_MoveWin( aCbxMarkedHitMovesAlways, nDiff );
+ lcl_MoveWin( aCbxCrookNoContortion, nDiff );
+
+ nDiff += aGrpSettings.GetPosPixel().Y() - aGrpStartWithActualPage.GetPosPixel().Y();
+ nDiff -= aCbxCrookNoContortion.GetPosPixel().Y() - aCbxMarkedHitMovesAlways.GetPosPixel().Y();
+
+ lcl_MoveWin( aGrpSettings, nDiff );
+ lcl_MoveWin( aTxtMetric, nDiff );
+ lcl_MoveWin( aLbMetric, nDiff );
+ lcl_MoveWin( aTxtTabstop, nDiff );
+ lcl_MoveWin( aMtrFldTabstop, nDiff );
+}