diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-09-08 23:42:24 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-09 10:36:32 +0000 |
commit | a8dd49b9fc59371ff8edb31082bbd4f1b6179b1c (patch) | |
tree | 1179f5a4ca575a4b988eb353fd8d8930a8534e78 | |
parent | 8c204276a438c718bd2eed6c59189dcfb24032be (diff) |
Convert dimension lines tab page to widget UI
Change-Id: I1d5176609e2acd0d70991a541196e2b9857576f8
Reviewed-on: https://gerrit.libreoffice.org/5879
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/AllLangResTarget_cui.mk | 1 | ||||
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 2 | ||||
-rw-r--r-- | cui/source/inc/measure.hxx | 47 | ||||
-rw-r--r-- | cui/source/tabpages/measure.cxx | 344 | ||||
-rw-r--r-- | cui/source/tabpages/measure.hrc | 47 | ||||
-rw-r--r-- | cui/source/tabpages/measure.src | 268 | ||||
-rw-r--r-- | cui/uiconfig/ui/dimensionlines.ui | 471 | ||||
-rw-r--r-- | cui/uiconfig/ui/linetabpage.ui | 34 | ||||
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 3 | ||||
-rw-r--r-- | include/svx/measctrl.hxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/measctrl.cxx | 57 |
12 files changed, 732 insertions, 553 deletions
diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index af8e41d18ede..edd487590e5e 100644 --- a/cui/AllLangResTarget_cui.mk +++ b/cui/AllLangResTarget_cui.mk @@ -71,7 +71,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/tabpages/grfpage.src \ cui/source/tabpages/labdlg.src \ cui/source/tabpages/macroass.src \ - cui/source/tabpages/measure.src \ cui/source/tabpages/page.src \ cui/source/tabpages/paragrph.src \ cui/source/tabpages/strings.src \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 8ff1a09c1709..ade8143c6b2d 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -31,6 +31,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/colorpage \ cui/uiconfig/ui/comment \ cui/uiconfig/ui/cuiimapdlg \ + cui/uiconfig/ui/dimensionlines \ cui/uiconfig/ui/editdictionarydialog \ cui/uiconfig/ui/formatnumberdialog \ cui/uiconfig/ui/gradientpage \ diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index ad6b45cdf411..2303504a68cd 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -224,7 +224,7 @@ #define HID_SVXPAGE_GRFCROP "CUI_HID_SVXPAGE_GRFCROP" #define HID_CAPTION "CUI_HID_CAPTION" #define HID_CAPTION_CTL_TYPE "CUI_HID_CAPTION_CTL_TYPE" -#define HID_PAGE_MEASURE "CUI_HID_PAGE_MEASURE" + #define HID_MEASURE_CTL_POSITION "CUI_HID_MEASURE_CTL_POSITION" #define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM" #define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW" diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index a05cab446c1a..5a15a6595574 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -32,40 +32,30 @@ class SvxMeasurePage : public SvxTabPage { private: - FixedLine aFlLine; - FixedText aFtLineDist; - MetricField aMtrFldLineDist; - FixedText aFtHelplineOverhang; - MetricField aMtrFldHelplineOverhang; - FixedText aFtHelplineDist; - MetricField aMtrFldHelplineDist; - FixedText aFtHelpline1Len; - MetricField aMtrFldHelpline1Len; - FixedText aFtHelpline2Len; - MetricField aMtrFldHelpline2Len; - TriStateBox aTsbBelowRefEdge; - FixedText aFtDecimalPlaces; - MetricField aMtrFldDecimalPlaces; - - FixedLine aFlLabel; - FixedText aFtPosition; - SvxRectCtl aCtlPosition; - TriStateBox aTsbAutoPosV; - TriStateBox aTsbAutoPosH; - TriStateBox aTsbShowUnit; - ListBox aLbUnit; - TriStateBox aTsbParallel; - - SvxXMeasurePreview aCtlPreview; - - FixedLine aFlVert; + MetricField* m_pMtrFldLineDist; + MetricField* m_pMtrFldHelplineOverhang; + MetricField* m_pMtrFldHelplineDist; + MetricField* m_pMtrFldHelpline1Len; + MetricField* m_pMtrFldHelpline2Len; + TriStateBox* m_pTsbBelowRefEdge; + MetricField* m_pMtrFldDecimalPlaces; + + SvxRectCtl* m_pCtlPosition; + TriStateBox* m_pTsbAutoPosV; + TriStateBox* m_pTsbAutoPosH; + TriStateBox* m_pTsbShowUnit; + ListBox* m_pLbUnit; + TriStateBox* m_pTsbParallel; + FixedText* m_pFtAutomatic; + + SvxXMeasurePreview* m_pCtlPreview; const SfxItemSet& rOutAttrs; SfxItemSet aAttrSet; const SdrView* pView; SfxMapUnit eUnit; - sal_Bool bPositionModified; + sal_Bool bPositionModified; void FillUnitLB(); @@ -88,6 +78,7 @@ public: void Construct(); void SetView( const SdrView* pSdrView ) { pView = pSdrView; } virtual void PageCreated (SfxAllItemSet aSet); + }; /* Derived from SfxNoLayoutSingleTabDialog, in order to be able to be diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 96d05dbe27ef..f9bb3712caca 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -45,7 +45,6 @@ #include <svx/sxmtritm.hxx> #include <svx/sxmuitm.hxx> -#include "measure.hrc" #include "measure.hxx" static sal_uInt16 pRanges[] = @@ -91,83 +90,74 @@ SvxMeasureDialog::~SvxMeasureDialog() \************************************************************************/ SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_MEASURE ), - rInAttrs ), - - aFlLine ( this, CUI_RES( FL_LINE ) ), - aFtLineDist ( this, CUI_RES( FT_LINE_DIST ) ), - aMtrFldLineDist ( this, CUI_RES( MTR_LINE_DIST ) ), - aFtHelplineOverhang ( this, CUI_RES( FT_HELPLINE_OVERHANG ) ), - aMtrFldHelplineOverhang ( this, CUI_RES( MTR_FLD_HELPLINE_OVERHANG ) ), - aFtHelplineDist ( this, CUI_RES( FT_HELPLINE_DIST ) ), - aMtrFldHelplineDist ( this, CUI_RES( MTR_FLD_HELPLINE_DIST ) ), - aFtHelpline1Len ( this, CUI_RES( FT_HELPLINE1_LEN ) ), - aMtrFldHelpline1Len ( this, CUI_RES( MTR_FLD_HELPLINE1_LEN ) ), - aFtHelpline2Len ( this, CUI_RES( FT_HELPLINE2_LEN ) ), - aMtrFldHelpline2Len ( this, CUI_RES( MTR_FLD_HELPLINE2_LEN ) ), - aTsbBelowRefEdge ( this, CUI_RES( TSB_BELOW_REF_EDGE ) ), - aFtDecimalPlaces ( this, CUI_RES( FT_DECIMALPLACES ) ), - aMtrFldDecimalPlaces ( this, CUI_RES( MTR_FLD_DECIMALPLACES ) ), - - aFlLabel ( this, CUI_RES( FL_LABEL ) ), - aFtPosition ( this, CUI_RES( FT_POSITION ) ), - aCtlPosition ( this, CUI_RES( CTL_POSITION ) ), - aTsbAutoPosV ( this, CUI_RES( TSB_AUTOPOSV ) ), - aTsbAutoPosH ( this, CUI_RES( TSB_AUTOPOSH ) ), - aTsbShowUnit ( this, CUI_RES( TSB_SHOW_UNIT ) ), - aLbUnit ( this, CUI_RES( LB_UNIT ) ), - aTsbParallel ( this, CUI_RES( TSB_PARALLEL ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ), - - aFlVert ( this, CUI_RES( FL_VERT ) ), + SvxTabPage ( pWindow + ,"DimensionLines" + ,"cui/ui/dimensionlines.ui" + ,rInAttrs ), + +// aCtlPreview ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ), + rOutAttrs ( rInAttrs ), aAttrSet ( *rInAttrs.GetPool() ), pView( 0 ), - bPositionModified ( sal_False ) { - aCtlPreview.SetAccessibleName(aCtlPreview.GetHelpText()); - FillUnitLB(); + get(m_pMtrFldLineDist, "MTR_LINE_DIST"); + get(m_pMtrFldHelplineOverhang, "MTR_FLD_HELPLINE_OVERHANG"); + get(m_pMtrFldHelplineDist, "MTR_FLD_HELPLINE_DIST"); + get(m_pMtrFldHelpline1Len, "MTR_FLD_HELPLINE1_LEN"); + get(m_pMtrFldHelpline2Len, "MTR_FLD_HELPLINE2_LEN"); + get(m_pTsbBelowRefEdge, "TSB_BELOW_REF_EDGE"); + get(m_pMtrFldDecimalPlaces, "MTR_FLD_DECIMALPLACES"); + + get(m_pCtlPosition, "CTL_POSITION"); + get(m_pTsbAutoPosV, "TSB_AUTOPOSV"); + get(m_pTsbAutoPosH, "TSB_AUTOPOSH"); + get(m_pTsbShowUnit, "TSB_SHOW_UNIT"); + get(m_pLbUnit, "LB_UNIT"); + get(m_pTsbParallel, "TSB_PARALLEL"); + + get(m_pCtlPreview, "CTL_PREVIEW"); + m_pCtlPreview->SetAttributes(rInAttrs); + + get(m_pFtAutomatic,"STR_MEASURE_AUTOMATIC"); - FreeResource(); + FillUnitLB(); const FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( aMtrFldLineDist, eFUnit ); - SetFieldUnit( aMtrFldHelplineOverhang, eFUnit ); - SetFieldUnit( aMtrFldHelplineDist, eFUnit ); - SetFieldUnit( aMtrFldHelpline1Len, eFUnit ); - SetFieldUnit( aMtrFldHelpline2Len, eFUnit ); + SetFieldUnit( *m_pMtrFldLineDist, eFUnit ); + SetFieldUnit( *m_pMtrFldHelplineOverhang, eFUnit ); + SetFieldUnit( *m_pMtrFldHelplineDist, eFUnit ); + SetFieldUnit( *m_pMtrFldHelpline1Len, eFUnit ); + SetFieldUnit( *m_pMtrFldHelpline2Len, eFUnit ); if( eFUnit == FUNIT_MM ) { - aMtrFldLineDist.SetSpinSize( 50 ); - aMtrFldHelplineOverhang.SetSpinSize( 50 ); - aMtrFldHelplineDist.SetSpinSize( 50 ); - aMtrFldHelpline1Len.SetSpinSize( 50 ); - aMtrFldHelpline2Len.SetSpinSize( 50 ); + m_pMtrFldLineDist->SetSpinSize( 50 ); + m_pMtrFldHelplineOverhang->SetSpinSize( 50 ); + m_pMtrFldHelplineDist->SetSpinSize( 50 ); + m_pMtrFldHelpline1Len->SetSpinSize( 50 ); + m_pMtrFldHelpline2Len->SetSpinSize( 50 ); } - aTsbAutoPosV.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); - aTsbAutoPosH.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); + m_pTsbAutoPosV->SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); + m_pTsbAutoPosH->SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); // set background and border of iconchoicectrl const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); - aCtlPreview.SetBackground ( rStyles.GetWindowColor() ); - aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO); + m_pCtlPreview->SetBackground ( rStyles.GetWindowColor() ); + m_pCtlPreview->SetBorderStyle(WINDOW_BORDER_MONO); Link aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) ); - aMtrFldLineDist.SetModifyHdl( aLink ); - aMtrFldHelplineOverhang.SetModifyHdl( aLink ); - aMtrFldHelplineDist.SetModifyHdl( aLink ); - aMtrFldHelpline1Len.SetModifyHdl( aLink ); - aMtrFldHelpline2Len.SetModifyHdl( aLink ); - aMtrFldDecimalPlaces.SetModifyHdl( aLink ); - aTsbBelowRefEdge.SetClickHdl( aLink ); - aTsbParallel.SetClickHdl( aLink ); - aTsbShowUnit.SetClickHdl( aLink ); - aLbUnit.SetSelectHdl( aLink ); - aLbUnit.SetAccessibleName(GetNonMnemonicString(aTsbShowUnit.GetText())); - aCtlPosition.SetAccessibleRelationMemberOf( &aFlLabel ); - aLbUnit.SetAccessibleRelationLabeledBy( &aTsbShowUnit ); + m_pMtrFldLineDist->SetModifyHdl( aLink ); + m_pMtrFldHelplineOverhang->SetModifyHdl( aLink ); + m_pMtrFldHelplineDist->SetModifyHdl( aLink ); + m_pMtrFldHelpline1Len->SetModifyHdl( aLink ); + m_pMtrFldHelpline2Len->SetModifyHdl( aLink ); + m_pMtrFldDecimalPlaces->SetModifyHdl( aLink ); + m_pTsbBelowRefEdge->SetClickHdl( aLink ); + m_pTsbParallel->SetClickHdl( aLink ); + m_pTsbShowUnit->SetClickHdl( aLink ); + m_pLbUnit->SetSelectHdl( aLink ); } /************************************************************************* @@ -200,13 +190,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLineDist, nValue, eUnit ); + SetMetricValue( *m_pMtrFldLineDist, nValue, eUnit ); } else { - aMtrFldLineDist.SetText( String() ); + m_pMtrFldLineDist->SetText( String() ); } - aMtrFldLineDist.SaveValue(); + m_pMtrFldLineDist->SaveValue(); // SdrMeasureHelplineOverhangItem pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG ); @@ -215,13 +205,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelplineOverhang, nValue, eUnit ); + SetMetricValue( *m_pMtrFldHelplineOverhang, nValue, eUnit ); } else { - aMtrFldHelplineOverhang.SetText( String() ); + m_pMtrFldHelplineOverhang->SetText( String() ); } - aMtrFldHelplineOverhang.SaveValue(); + m_pMtrFldHelplineOverhang->SaveValue(); // SdrMeasureHelplineDistItem pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST ); @@ -230,13 +220,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelplineDist, nValue, eUnit ); + SetMetricValue( *m_pMtrFldHelplineDist, nValue, eUnit ); } else { - aMtrFldHelplineDist.SetText( String() ); + m_pMtrFldHelplineDist->SetText( String() ); } - aMtrFldHelplineDist.SaveValue(); + m_pMtrFldHelplineDist->SaveValue(); // SdrMeasureHelpline1LenItem pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN ); @@ -245,13 +235,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelpline1Len, nValue, eUnit ); + SetMetricValue( *m_pMtrFldHelpline1Len, nValue, eUnit ); } else { - aMtrFldHelpline1Len.SetText( String() ); + m_pMtrFldHelpline1Len->SetText( String() ); } - aMtrFldHelpline1Len.SaveValue(); + m_pMtrFldHelpline1Len->SaveValue(); // SdrMeasureHelpline2LenItem pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN ); @@ -260,26 +250,26 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelpline2Len, nValue, eUnit ); + SetMetricValue( *m_pMtrFldHelpline2Len, nValue, eUnit ); } else { - aMtrFldHelpline2Len.SetText( String() ); + m_pMtrFldHelpline2Len->SetText( String() ); } - aMtrFldHelpline2Len.SaveValue(); + m_pMtrFldHelpline2Len->SaveValue(); // SdrMeasureBelowRefEdgeItem if( rAttrs.GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SFX_ITEM_DONTCARE ) { - aTsbBelowRefEdge.SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ). + m_pTsbBelowRefEdge->SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ). GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbBelowRefEdge.EnableTriState( sal_False ); + m_pTsbBelowRefEdge->EnableTriState( sal_False ); } else { - aTsbBelowRefEdge.SetState( STATE_DONTKNOW ); + m_pTsbBelowRefEdge->SetState( STATE_DONTKNOW ); } - aTsbBelowRefEdge.SaveValue(); + m_pTsbBelowRefEdge->SaveValue(); // SdrMeasureDecimalPlacesItem pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES ); @@ -288,40 +278,40 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( pItem ) { sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue(); - aMtrFldDecimalPlaces.SetValue( nValue ); + m_pMtrFldDecimalPlaces->SetValue( nValue ); } else { - aMtrFldDecimalPlaces.SetText( String() ); + m_pMtrFldDecimalPlaces->SetText( String() ); } - aMtrFldDecimalPlaces.SaveValue(); + m_pMtrFldDecimalPlaces->SaveValue(); // SdrMeasureTextRota90Item // Attention: negate ! if( rAttrs.GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SFX_ITEM_DONTCARE ) { - aTsbParallel.SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ). + m_pTsbParallel->SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ). GetValue() ? STATE_NOCHECK : STATE_CHECK ); - aTsbParallel.EnableTriState( sal_False ); + m_pTsbParallel->EnableTriState( sal_False ); } else { - aTsbParallel.SetState( STATE_DONTKNOW ); + m_pTsbParallel->SetState( STATE_DONTKNOW ); } - aTsbParallel.SaveValue(); + m_pTsbParallel->SaveValue(); // SdrMeasureShowUnitItem if( rAttrs.GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE ) { - aTsbShowUnit.SetState( ( ( const SdrMeasureShowUnitItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ). + m_pTsbShowUnit->SetState( ( ( const SdrMeasureShowUnitItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ). GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbShowUnit.EnableTriState( sal_False ); + m_pTsbShowUnit->EnableTriState( sal_False ); } else { - aTsbShowUnit.SetState( STATE_DONTKNOW ); + m_pTsbShowUnit->SetState( STATE_DONTKNOW ); } - aTsbShowUnit.SaveValue(); + m_pTsbShowUnit->SaveValue(); // SdrMeasureUnitItem if( rAttrs.GetItemState( SDRATTR_MEASUREUNIT ) != SFX_ITEM_DONTCARE ) @@ -329,20 +319,20 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs. Get( SDRATTR_MEASUREUNIT ) ).GetValue(); - for( sal_uInt16 i = 0; i < aLbUnit.GetEntryCount(); ++i ) + for( sal_uInt16 i = 0; i < m_pLbUnit->GetEntryCount(); ++i ) { - if ( (sal_IntPtr)aLbUnit.GetEntryData( i ) == nFieldUnit ) + if ( (sal_IntPtr)m_pLbUnit->GetEntryData( i ) == nFieldUnit ) { - aLbUnit.SelectEntryPos( i ); + m_pLbUnit->SelectEntryPos( i ); break; } } } else { - aLbUnit.SetNoSelection(); + m_pLbUnit->SetNoSelection(); } - aLbUnit.SaveValue(); + m_pLbUnit->SaveValue(); // Position if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) @@ -352,8 +342,8 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) { if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE ) { - aTsbAutoPosV.EnableTriState( sal_False ); - aTsbAutoPosH.EnableTriState( sal_False ); + m_pTsbAutoPosV->EnableTriState( sal_False ); + m_pTsbAutoPosH->EnableTriState( sal_False ); SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos) ( ( const SdrMeasureTextHPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue(); @@ -403,33 +393,33 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) if( eHPos == SDRMEASURE_TEXTHAUTO ) { - aTsbAutoPosH.SetState( STATE_CHECK ); + m_pTsbAutoPosH->SetState( STATE_CHECK ); nState = CS_NOHORZ; } if( eVPos == SDRMEASURE_TEXTVAUTO ) { - aTsbAutoPosV.SetState( STATE_CHECK ); + m_pTsbAutoPosV->SetState( STATE_CHECK ); nState |= CS_NOVERT; } - aCtlPosition.SetState( nState ); - aCtlPosition.SetActualRP( eRP ); + m_pCtlPosition->SetState( nState ); + m_pCtlPosition->SetActualRP( eRP ); } } } else { - aCtlPosition.Reset(); - aTsbAutoPosV.SetState( STATE_DONTKNOW ); - aTsbAutoPosH.SetState( STATE_DONTKNOW ); + m_pCtlPosition->Reset(); + m_pTsbAutoPosV->SetState( STATE_DONTKNOW ); + m_pTsbAutoPosH->SetState( STATE_DONTKNOW ); } // put the attributes to the preview-control, // otherwise the control don't know about // the settings of the dialog (#67930) - ChangeAttrHdl_Impl( &aTsbShowUnit ); - aCtlPreview.SetAttributes( rAttrs ); + ChangeAttrHdl_Impl( m_pTsbShowUnit ); + m_pCtlPreview->SetAttributes( rAttrs ); bPositionModified = sal_False; } @@ -446,77 +436,77 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) sal_Int32 nValue; TriState eState; - if( aMtrFldLineDist.GetText() != aMtrFldLineDist.GetSavedValue() ) + if( m_pMtrFldLineDist->GetText() != m_pMtrFldLineDist->GetSavedValue() ) { - nValue = GetCoreValue( aMtrFldLineDist, eUnit ); + nValue = GetCoreValue( *m_pMtrFldLineDist, eUnit ); rAttrs.Put( SdrMeasureLineDistItem( nValue ) ); bModified = sal_True; } - if( aMtrFldHelplineOverhang.GetText() != aMtrFldHelplineOverhang.GetSavedValue() ) + if( m_pMtrFldHelplineOverhang->GetText() != m_pMtrFldHelplineOverhang->GetSavedValue() ) { - nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit ); + nValue = GetCoreValue( *m_pMtrFldHelplineOverhang, eUnit ); rAttrs.Put( SdrMeasureHelplineOverhangItem( nValue ) ); bModified = sal_True; } - if( aMtrFldHelplineDist.GetText() != aMtrFldHelplineDist.GetSavedValue() ) + if( m_pMtrFldHelplineDist->GetText() != m_pMtrFldHelplineDist->GetSavedValue() ) { - nValue = GetCoreValue( aMtrFldHelplineDist, eUnit ); + nValue = GetCoreValue( *m_pMtrFldHelplineDist, eUnit ); rAttrs.Put( SdrMeasureHelplineDistItem( nValue ) ); bModified = sal_True; } - if( aMtrFldHelpline1Len.GetText() != aMtrFldHelpline1Len.GetSavedValue() ) + if( m_pMtrFldHelpline1Len->GetText() != m_pMtrFldHelpline1Len->GetSavedValue() ) { - nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit ); + nValue = GetCoreValue( *m_pMtrFldHelpline1Len, eUnit ); rAttrs.Put( SdrMeasureHelpline1LenItem( nValue ) ); bModified = sal_True; } - if( aMtrFldHelpline2Len.GetText() != aMtrFldHelpline2Len.GetSavedValue() ) + if( m_pMtrFldHelpline2Len->GetText() != m_pMtrFldHelpline2Len->GetSavedValue() ) { - nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit ); + nValue = GetCoreValue( *m_pMtrFldHelpline2Len, eUnit ); rAttrs.Put( SdrMeasureHelpline2LenItem( nValue ) ); bModified = sal_True; } - eState = aTsbBelowRefEdge.GetState(); - if( eState != aTsbBelowRefEdge.GetSavedValue() ) + eState = m_pTsbBelowRefEdge->GetState(); + if( eState != m_pTsbBelowRefEdge->GetSavedValue() ) { rAttrs.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); bModified = sal_True; } - if( aMtrFldDecimalPlaces.GetText() != aMtrFldDecimalPlaces.GetSavedValue() ) + if( m_pMtrFldDecimalPlaces->GetText() != m_pMtrFldDecimalPlaces->GetSavedValue() ) { - nValue = static_cast<sal_Int32>(aMtrFldDecimalPlaces.GetValue()); + nValue = static_cast<sal_Int32>(m_pMtrFldDecimalPlaces->GetValue()); rAttrs.Put( SdrMeasureDecimalPlacesItem( sal::static_int_cast< sal_Int16 >( nValue ) ) ); bModified = sal_True; } - eState = aTsbParallel.GetState(); - if( eState != aTsbParallel.GetSavedValue() ) + eState = m_pTsbParallel->GetState(); + if( eState != m_pTsbParallel->GetSavedValue() ) { rAttrs.Put( SdrMeasureTextRota90Item( (sal_Bool) STATE_NOCHECK == eState ) ); bModified = sal_True; } - eState = aTsbShowUnit.GetState(); - if( eState != aTsbShowUnit.GetSavedValue() ) + eState = m_pTsbShowUnit->GetState(); + if( eState != m_pTsbShowUnit->GetSavedValue() ) { rAttrs.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); bModified = sal_True; } - sal_uInt16 nPos = aLbUnit.GetSelectEntryPos(); - if( nPos != aLbUnit.GetSavedValue() ) + sal_uInt16 nPos = m_pLbUnit->GetSelectEntryPos(); + if( nPos != m_pLbUnit->GetSavedValue() ) { if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)aLbUnit.GetEntryData( nPos ); + sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbUnit->GetEntryData( nPos ); FieldUnit _eUnit = (FieldUnit) nFieldUnit; rAttrs.Put( SdrMeasureUnitItem( _eUnit ) ); bModified = sal_True; @@ -529,7 +519,7 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) SdrMeasureTextVPos eVPos, eOldVPos; SdrMeasureTextHPos eHPos, eOldHPos; - RECT_POINT eRP = aCtlPosition.GetActualRP(); + RECT_POINT eRP = m_pCtlPosition->GetActualRP(); switch( eRP ) { default: @@ -552,10 +542,10 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) case RP_RB: eVPos = SDRMEASURE_BELOW; eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; } - if( aTsbAutoPosH.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosH->GetState() == STATE_CHECK ) eHPos = SDRMEASURE_TEXTHAUTO; - if( aTsbAutoPosV.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosV->GetState() == STATE_CHECK ) eVPos = SDRMEASURE_TEXTVAUTO; if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) @@ -605,8 +595,8 @@ void SvxMeasurePage::Construct() { DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); - aCtlPreview.pMeasureObj->SetModel( pView->GetModel() ); - aCtlPreview.Invalidate(); + m_pCtlPreview->pMeasureObj->SetModel( pView->GetModel() ); + m_pCtlPreview->Invalidate(); } /************************************************************************* @@ -633,44 +623,44 @@ void SvxMeasurePage::PointChanged( Window* pWindow, RECT_POINT /*eRP*/ ) IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p ) { - if( aTsbAutoPosH.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosH->GetState() == STATE_CHECK ) { - switch( aCtlPosition.GetActualRP() ) + switch( m_pCtlPosition->GetActualRP() ) { case RP_LT: case RP_RT: - aCtlPosition.SetActualRP( RP_MT ); + m_pCtlPosition->SetActualRP( RP_MT ); break; case RP_LM: case RP_RM: - aCtlPosition.SetActualRP( RP_MM ); + m_pCtlPosition->SetActualRP( RP_MM ); break; case RP_LB: case RP_RB: - aCtlPosition.SetActualRP( RP_MB ); + m_pCtlPosition->SetActualRP( RP_MB ); break; default: ;//prevent warning } } - if( aTsbAutoPosV.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosV->GetState() == STATE_CHECK ) { - switch( aCtlPosition.GetActualRP() ) + switch( m_pCtlPosition->GetActualRP() ) { case RP_LT: case RP_LB: - aCtlPosition.SetActualRP( RP_LM ); + m_pCtlPosition->SetActualRP( RP_LM ); break; case RP_MT: case RP_MB: - aCtlPosition.SetActualRP( RP_MM ); + m_pCtlPosition->SetActualRP( RP_MM ); break; case RP_RT: case RP_RB: - aCtlPosition.SetActualRP( RP_RM ); + m_pCtlPosition->SetActualRP( RP_RM ); break; default: ;//prevent warning } @@ -683,81 +673,81 @@ IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p ) IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) { - if( p == &aMtrFldLineDist ) + if( p == m_pMtrFldLineDist ) { - sal_Int32 nValue = GetCoreValue( aMtrFldLineDist, eUnit ); + sal_Int32 nValue = GetCoreValue( *m_pMtrFldLineDist, eUnit ); aAttrSet.Put( SdrMeasureLineDistItem( nValue ) ); } - if( p == &aMtrFldHelplineOverhang ) + if( p == m_pMtrFldHelplineOverhang ) { - sal_Int32 nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit ); + sal_Int32 nValue = GetCoreValue( *m_pMtrFldHelplineOverhang, eUnit ); aAttrSet.Put( SdrMeasureHelplineOverhangItem( nValue) ); } - if( p == &aMtrFldHelplineDist ) + if( p == m_pMtrFldHelplineDist ) { - sal_Int32 nValue = GetCoreValue( aMtrFldHelplineDist, eUnit ); + sal_Int32 nValue = GetCoreValue( *m_pMtrFldHelplineDist, eUnit ); aAttrSet.Put( SdrMeasureHelplineDistItem( nValue) ); } - if( p == &aMtrFldHelpline1Len ) + if( p == m_pMtrFldHelpline1Len ) { - sal_Int32 nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit ); + sal_Int32 nValue = GetCoreValue( *m_pMtrFldHelpline1Len, eUnit ); aAttrSet.Put( SdrMeasureHelpline1LenItem( nValue ) ); } - if( p == &aMtrFldHelpline2Len ) + if( p == m_pMtrFldHelpline2Len ) { - sal_Int32 nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit ); + sal_Int32 nValue = GetCoreValue( *m_pMtrFldHelpline2Len, eUnit ); aAttrSet.Put( SdrMeasureHelpline2LenItem( nValue ) ); } - if( p == &aTsbBelowRefEdge ) + if( p == m_pTsbBelowRefEdge ) { - TriState eState = aTsbBelowRefEdge.GetState(); + TriState eState = m_pTsbBelowRefEdge->GetState(); if( eState != STATE_DONTKNOW ) aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); } - if( p == &aMtrFldDecimalPlaces ) + if( p == m_pMtrFldDecimalPlaces ) { sal_Int16 nValue = sal::static_int_cast< sal_Int16 >( - aMtrFldDecimalPlaces.GetValue() ); + m_pMtrFldDecimalPlaces->GetValue() ); aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) ); } - if( p == &aTsbParallel ) + if( p == m_pTsbParallel ) { - TriState eState = aTsbParallel.GetState(); + TriState eState = m_pTsbParallel->GetState(); if( eState != STATE_DONTKNOW ) aAttrSet.Put( SdrMeasureTextRota90Item( (sal_Bool) !STATE_CHECK == eState ) ); } - if( p == &aTsbShowUnit ) + if( p == m_pTsbShowUnit ) { - TriState eState = aTsbShowUnit.GetState(); + TriState eState = m_pTsbShowUnit->GetState(); if( eState != STATE_DONTKNOW ) aAttrSet.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); } - if( p == &aLbUnit ) + if( p == m_pLbUnit ) { - sal_uInt16 nPos = aLbUnit.GetSelectEntryPos(); + sal_uInt16 nPos = m_pLbUnit->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)aLbUnit.GetEntryData( nPos ); + sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbUnit->GetEntryData( nPos ); FieldUnit _eUnit = (FieldUnit) nFieldUnit; aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) ); } } - if( p == &aTsbAutoPosV || p == &aTsbAutoPosH || p == &aCtlPosition ) + if( p == m_pTsbAutoPosV || p == m_pTsbAutoPosH || p == m_pCtlPosition ) { bPositionModified = sal_True; // Position - RECT_POINT eRP = aCtlPosition.GetActualRP(); + RECT_POINT eRP = m_pCtlPosition->GetActualRP(); SdrMeasureTextVPos eVPos; SdrMeasureTextHPos eHPos; @@ -786,27 +776,27 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) CTL_STATE nState = 0; - if( aTsbAutoPosH.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosH->GetState() == STATE_CHECK ) { eHPos = SDRMEASURE_TEXTHAUTO; nState = CS_NOHORZ; } - if( aTsbAutoPosV.GetState() == STATE_CHECK ) + if( m_pTsbAutoPosV->GetState() == STATE_CHECK ) { eVPos = SDRMEASURE_TEXTVAUTO; nState |= CS_NOVERT; } - if( p == &aTsbAutoPosV || p == &aTsbAutoPosH ) - aCtlPosition.SetState( nState ); + if( p == m_pTsbAutoPosV || p == m_pTsbAutoPosH ) + m_pCtlPosition->SetState( nState ); aAttrSet.Put( SdrMeasureTextVPosItem( eVPos ) ); aAttrSet.Put( SdrMeasureTextHPosItem( eHPos ) ); } - aCtlPreview.SetAttributes( aAttrSet ); - aCtlPreview.Invalidate(); + m_pCtlPreview->SetAttributes( aAttrSet ); + m_pCtlPreview->Invalidate(); return( 0L ); } @@ -817,16 +807,16 @@ void SvxMeasurePage::FillUnitLB() SvxStringArray aMetricArr( SVX_RES( RID_SVXSTR_FIELDUNIT_TABLE ) ); sal_IntPtr nUnit = FUNIT_NONE; - String aStrMetric( CUI_RES( STR_MEASURE_AUTOMATIC ) ); - sal_uInt16 nPos = aLbUnit.InsertEntry( aStrMetric ); - aLbUnit.SetEntryData( nPos, (void*)nUnit ); + OUString aStrMetric( m_pFtAutomatic->GetText()); + sal_uInt16 nPos = m_pLbUnit->InsertEntry( aStrMetric ); + m_pLbUnit->SetEntryData( nPos, (void*)nUnit ); for( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i ) { aStrMetric = aMetricArr.GetStringByPos( i ); nUnit = aMetricArr.GetValue( i ); - nPos = aLbUnit.InsertEntry( aStrMetric ); - aLbUnit.SetEntryData( nPos, (void*)nUnit ); + nPos = m_pLbUnit->InsertEntry( aStrMetric ); + m_pLbUnit->SetEntryData( nPos, (void*)nUnit ); } } void SvxMeasurePage::PageCreated (SfxAllItemSet aSet) diff --git a/cui/source/tabpages/measure.hrc b/cui/source/tabpages/measure.hrc deleted file mode 100644 index abcc7fe4cc34..000000000000 --- a/cui/source/tabpages/measure.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#define FL_LINE 1 -#define FL_LABEL 2 -#define FL_VERT 3 - -#define FT_LINE_DIST 1 -#define FT_HELPLINE_OVERHANG 2 -#define FT_HELPLINE_DIST 3 -#define FT_HELPLINE1_LEN 4 -#define FT_HELPLINE2_LEN 5 -#define FT_POSITION 6 -#define FT_DECIMALPLACES 7 -#define MTR_LINE_DIST 1 -#define MTR_FLD_HELPLINE_OVERHANG 2 -#define MTR_FLD_HELPLINE_DIST 3 -#define MTR_FLD_HELPLINE1_LEN 4 -#define MTR_FLD_HELPLINE2_LEN 5 -#define MTR_FLD_DECIMALPLACES 6 -#define TSB_BELOW_REF_EDGE 1 -#define TSB_SHOW_UNIT 2 -#define TSB_AUTOPOSV 3 -#define TSB_AUTOPOSH 4 -#define TSB_PARALLEL 5 -#define CTL_POSITION 1 -#define CTL_PREVIEW 2 -#define LB_UNIT 1 - -#define STR_MEASURE_AUTOMATIC 1 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/measure.src b/cui/source/tabpages/measure.src deleted file mode 100644 index 7808339b6d64..000000000000 --- a/cui/source/tabpages/measure.src +++ /dev/null @@ -1,268 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <cuires.hrc> -#include "measure.hrc" -#include "helpid.hrc" -#include <svx/dialogs.hrc> - -#define DELTA 20 - - // RID_SVXPAGE_MEASURE --------------------------------------------------- -TabPage RID_SVXPAGE_MEASURE -{ - HelpId = HID_PAGE_MEASURE ; - Hide = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Text [ en-US ] = "Dimensioning" ; - - FixedLine FL_LINE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Line"; - }; - FixedText FT_LINE_DIST - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "Line ~distance" ; - }; - MetricField MTR_LINE_DIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_LINE_DIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 14 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE_OVERHANG - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "Guide ~overhang" ; - }; - MetricField MTR_FLD_HELPLINE_OVERHANG - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE_OVERHANG"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 30 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE_DIST - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Guide distance" ; - }; - MetricField MTR_FLD_HELPLINE_DIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE_DIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 46 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE1_LEN - { - Pos = MAP_APPFONT ( 12 , 64 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Left guide" ; - }; - MetricField MTR_FLD_HELPLINE1_LEN - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE1_LEN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 62 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE2_LEN - { - Pos = MAP_APPFONT ( 12 , 80 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Right guide" ; - }; - MetricField MTR_FLD_HELPLINE2_LEN - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE2_LEN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 78 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - TriStateBox TSB_BELOW_REF_EDGE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_BELOW_REF_EDGE"; - Pos = MAP_APPFONT ( 12 , 96 ) ; - Size = MAP_APPFONT ( 108 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Measure ~below object"; - }; - FixedText FT_DECIMALPLACES - { - Pos = MAP_APPFONT ( 12 , 112 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - - Text [ en-US ] = "Decimal places" ; - }; - MetricField MTR_FLD_DECIMALPLACES - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_DECIMALPLACES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 110 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - StrictFormat = TRUE ; - Last = 99 ; - SpinSize = 1 ; - }; - FixedLine FL_VERT - { - Pos = MAP_APPFONT ( 127 , 14 ) ; - Size = MAP_APPFONT ( 4 , 108 ) ; - Vert = TRUE ; - }; - FixedLine FL_LABEL - { - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Legend"; - }; - FixedText FT_POSITION - { - Pos = MAP_APPFONT ( 138 , 14 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "~Text position" ; - }; - Control CTL_POSITION - { - HelpId = HID_MEASURE_CTL_POSITION ; - Border = TRUE ; - Pos = MAP_APPFONT ( 154 , 25 ) ; - Size = MAP_APPFONT ( 60 , 24 ) ; - TabStop = TRUE ; - }; - TriStateBox TSB_AUTOPOSV - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_AUTOPOSV"; - Pos = MAP_APPFONT ( 154 , 54 ) ; - Size = MAP_APPFONT ( 101 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~AutoVertical" ; - }; - TriStateBox TSB_AUTOPOSH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_AUTOPOSH"; - Pos = MAP_APPFONT ( 154 , 68 ) ; - Size = MAP_APPFONT ( 101 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "A~utoHorizontal" ; - }; - TriStateBox TSB_PARALLEL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_PARALLEL"; - Pos = MAP_APPFONT ( 138 , 82 ) ; - Size = MAP_APPFONT ( 110 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Parallel to line"; - }; - TriStateBox TSB_SHOW_UNIT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_SHOW_UNIT"; - Pos = MAP_APPFONT ( 138 , 96 ) ; - Size = MAP_APPFONT ( 64+40 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Show ~meas. units" ; - }; - ListBox LB_UNIT - { - HelpID = "cui:ListBox:RID_SVXPAGE_MEASURE:LB_UNIT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 154 , 110 ) ; - Size = MAP_APPFONT ( 60 , 80+35 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - Control CTL_PREVIEW - { - HelpId = HID_MEASURE_CTL_PREVIEW ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 132 ) ; - Size = MAP_APPFONT ( 248 , 47 ) ; - }; - String STR_MEASURE_AUTOMATIC - { - Text [ en-US ] = "Automatic" ; - }; -}; - // ********************************************************************** EOF - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/dimensionlines.ui b/cui/uiconfig/ui/dimensionlines.ui new file mode 100644 index 000000000000..07646e526ac7 --- /dev/null +++ b/cui/uiconfig/ui/dimensionlines.ui @@ -0,0 +1,471 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires LibreOffice 1.0 --> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">-10</property> + <property name="upper">10</property> + <property name="step_increment">0.10000000000000001</property> + <property name="page_increment">1</property> + </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="upper">99</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkBox" id="DimensionLines"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkFrame" id="FL_LINE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="FT_LINE_DIST"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="yalign">0.4699999988079071</property> + <property name="label" translatable="yes">Line _distance</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_LINE_DIST:0.00mm</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_HELPLINE_OVERHANG"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Guide _overhang</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_FLD_HELPLINE_OVERHANG:0.00mm</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_HELPLINE_DIST"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Guide distance</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_FLD_HELPLINE_DIST:0.00mm</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_HELPLINE1_LEN"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Left guide</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_FLD_HELPLINE1_LEN:0.00mm</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_HELPLINE2_LEN"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Right guide</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_FLD_HELPLINE2_LEN:0.00mm</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_DECIMALPLACES"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Decimal _places</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">MTR_FLD_DECIMALPLACES:0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TSB_BELOW_REF_EDGE"> + <property name="label" translatable="yes">Measure _below object</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="margin_left">12</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_LINE_DIST:0.00mm"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_FLD_HELPLINE_OVERHANG:0.00mm"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_FLD_HELPLINE_DIST:0.00mm"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_FLD_HELPLINE1_LEN:0.00mm"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_FLD_HELPLINE2_LEN:0.00mm"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="MTR_FLD_DECIMALPLACES:0"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</property> + <property name="adjustment">adjustment2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">6</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Line</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="FL_LABEL"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="FT_POSITION"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Text position</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="svxlo-SvxRectCtl" id="CTL_POSITION"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">center</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TSB_AUTOPOSV"> + <property name="label" translatable="yes">_AutoVertical</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TSB_AUTOPOSH"> + <property name="label" translatable="yes">A_utoHorizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TSB_PARALLEL"> + <property name="label" translatable="yes">_Parallel to line</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TSB_SHOW_UNIT"> + <property name="label" translatable="yes">Show _measurement units</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="LB_UNIT"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Legend</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="STR_MEASURE_AUTOMATIC"> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Automatic</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="svxlo-SvxXMeasurePreview" id="CTL_PREVIEW:border"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> +</interface> diff --git a/cui/uiconfig/ui/linetabpage.ui b/cui/uiconfig/ui/linetabpage.ui index 8c5128b18de5..85c0f9ff218c 100644 --- a/cui/uiconfig/ui/linetabpage.ui +++ b/cui/uiconfig/ui/linetabpage.ui @@ -2,6 +2,21 @@ <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkAdjustment" id="adjustmentPERCENT"> + <property name="upper">100</property> + <property name="step_increment">5</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustmentWIDTH"> + <property name="upper">5</property> + <property name="step_increment">0.10000000000000001</property> + <property name="page_increment">1</property> + </object> + <object class="GtkAdjustment" id="adjustmentWIDTH_SYMBOL"> + <property name="upper">19.989999999999998</property> + <property name="step_increment">0.050000000000000003</property> + <property name="page_increment">1</property> + </object> <object class="GtkBox" id="LineTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -700,11 +715,11 @@ </packing> </child> <child> - <object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW"> + <object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW:border"> <property name="visible">True</property> <property name="can_focus">False</property> <child internal-child="accessible"> - <object class="AtkObject" id="CTL_PREVIEW-atkobject"> + <object class="AtkObject" id="CTL_PREVIEW:border-atkobject"> <property name="AtkObject::accessible-name" translatable="yes">Example</property> </object> </child> @@ -716,21 +731,6 @@ </packing> </child> </object> - <object class="GtkAdjustment" id="adjustmentPERCENT"> - <property name="upper">100</property> - <property name="step_increment">5</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="adjustmentWIDTH"> - <property name="upper">5</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="adjustmentWIDTH_SYMBOL"> - <property name="upper">19.989999999999998</property> - <property name="step_increment">0.050000000000000003</property> - <property name="page_increment">1</property> - </object> <object class="GtkListStore" id="liststoreCAP_STYLE"> <columns> <!-- column-name gchararray1 --> diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index ba080bf3a271..90d875be2925 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -248,6 +248,9 @@ <glade-widget-class title="SvxXLinePreview" name="svxlo-SvxXLinePreview" generic-name="Line Preview Window" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> + <glade-widget-class title="SvxXMeasurePreview" name="svxlo-SvxXMeasurePreview" + generic-name="Dimension Line Preview Window" parent="GtkDrawingArea" + icon-name="widget-gtk-drawingarea"/> <glade-widget-class title="Shadow Preview" name="svxlo-SvxXShadowPreview" generic-name="Shadow Preview Window" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> diff --git a/include/svx/measctrl.hxx b/include/svx/measctrl.hxx index dfd1ff7202de..f17190a3edc1 100644 --- a/include/svx/measctrl.hxx +++ b/include/svx/measctrl.hxx @@ -37,16 +37,16 @@ class SVX_DLLPUBLIC SvxXMeasurePreview : public Control friend class SvxMeasurePage; private: - const SfxItemSet& rAttrs; SdrMeasureObj* pMeasureObj; SdrModel* pModel; public: - SvxXMeasurePreview( Window* pParent, const ResId& rResId, - const SfxItemSet& rInAttrs ); - ~SvxXMeasurePreview(); + SvxXMeasurePreview(Window* pParent, const ResId& rResId, const SfxItemSet& rInAttrs); + SvxXMeasurePreview(Window* pParent, WinBits nStyle); + ~SvxXMeasurePreview(); - virtual void Paint( const Rectangle& rRect ); + virtual void Paint(const Rectangle& rRect); + virtual void Resize(); virtual void MouseButtonDown( const MouseEvent& rMEvt ); void SetAttributes( const SfxItemSet& rInAttrs ); diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 740ddc8b938a..646decbf06d5 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -19,20 +19,14 @@ #include <svx/svdomeas.hxx> #include <svx/svdmodel.hxx> +#include <vcl/builder.hxx> #include "svx/measctrl.hxx" #include <svx/dialmgr.hxx> #include "svx/dlgutil.hxx" -SvxXMeasurePreview::SvxXMeasurePreview -( - Window* pParent, - const ResId& rResId, - const SfxItemSet& rInAttrs -) : - - Control ( pParent, rResId ), - rAttrs ( rInAttrs ) +SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent,const ResId& rResId,const SfxItemSet& rInAttrs) +: Control ( pParent, rResId ) { SetMapMode( MAP_100TH_MM ); @@ -60,6 +54,51 @@ SvxXMeasurePreview::SvxXMeasurePreview Invalidate(); } +SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent, WinBits nStyle) + : Control(pParent, nStyle) +{ + SetMapMode( MAP_100TH_MM ); + + // Scale: 1:2 + MapMode aMapMode = GetMapMode(); + aMapMode.SetScaleX( Fraction( 1, 2 ) ); + aMapMode.SetScaleY( Fraction( 1, 2 ) ); + SetMapMode( aMapMode ); + + Size aSize = GetOutputSize(); + Point aPt1 = Point( aSize.Width() / 5, (long) ( aSize.Height() / 2 ) ); + Point aPt2 = Point( aSize.Width() * 4 / 5, (long) ( aSize.Height() / 2 ) ); + + pMeasureObj = new SdrMeasureObj( aPt1, aPt2 ); + pModel = new SdrModel(); + pMeasureObj->SetModel( pModel ); + + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + + Invalidate(); +} + +void SvxXMeasurePreview::Resize() +{ + Control::Resize(); + + Size aSize = GetOutputSize(); + Point aPt1 = Point( aSize.Width() / 5, (long) ( aSize.Height() / 2 ) ); + pMeasureObj->SetPoint(aPt1, 0); + Point aPt2 = Point( aSize.Width() * 4 / 5, (long) ( aSize.Height() / 2 ) ); + pMeasureObj->SetPoint(aPt2, 1); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXMeasurePreview(Window *pParent, VclBuilder::stringmap &rMap) +{ + WinBits nWinStyle = 0; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new SvxXMeasurePreview(pParent, nWinStyle); +} + + SvxXMeasurePreview::~SvxXMeasurePreview() { // No one is deleting the MeasureObj? This is not only an error but also |