Kaydet (Commit) a8dd49b9 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert dimension lines tab page to widget UI

Change-Id: I1d5176609e2acd0d70991a541196e2b9857576f8
Reviewed-on: https://gerrit.libreoffice.org/5879Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8c204276
...@@ -71,7 +71,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ ...@@ -71,7 +71,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/tabpages/grfpage.src \ cui/source/tabpages/grfpage.src \
cui/source/tabpages/labdlg.src \ cui/source/tabpages/labdlg.src \
cui/source/tabpages/macroass.src \ cui/source/tabpages/macroass.src \
cui/source/tabpages/measure.src \
cui/source/tabpages/page.src \ cui/source/tabpages/page.src \
cui/source/tabpages/paragrph.src \ cui/source/tabpages/paragrph.src \
cui/source/tabpages/strings.src \ cui/source/tabpages/strings.src \
......
...@@ -31,6 +31,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ ...@@ -31,6 +31,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/colorpage \ cui/uiconfig/ui/colorpage \
cui/uiconfig/ui/comment \ cui/uiconfig/ui/comment \
cui/uiconfig/ui/cuiimapdlg \ cui/uiconfig/ui/cuiimapdlg \
cui/uiconfig/ui/dimensionlines \
cui/uiconfig/ui/editdictionarydialog \ cui/uiconfig/ui/editdictionarydialog \
cui/uiconfig/ui/formatnumberdialog \ cui/uiconfig/ui/formatnumberdialog \
cui/uiconfig/ui/gradientpage \ cui/uiconfig/ui/gradientpage \
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
#define HID_SVXPAGE_GRFCROP "CUI_HID_SVXPAGE_GRFCROP" #define HID_SVXPAGE_GRFCROP "CUI_HID_SVXPAGE_GRFCROP"
#define HID_CAPTION "CUI_HID_CAPTION" #define HID_CAPTION "CUI_HID_CAPTION"
#define HID_CAPTION_CTL_TYPE "CUI_HID_CAPTION_CTL_TYPE" #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_MEASURE_CTL_POSITION "CUI_HID_MEASURE_CTL_POSITION"
#define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM" #define HID_VALUESET_NUM "CUI_HID_VALUESET_NUM"
#define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW" #define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW"
......
...@@ -32,33 +32,23 @@ class SvxMeasurePage : public SvxTabPage ...@@ -32,33 +32,23 @@ class SvxMeasurePage : public SvxTabPage
{ {
private: private:
FixedLine aFlLine; MetricField* m_pMtrFldLineDist;
FixedText aFtLineDist; MetricField* m_pMtrFldHelplineOverhang;
MetricField aMtrFldLineDist; MetricField* m_pMtrFldHelplineDist;
FixedText aFtHelplineOverhang; MetricField* m_pMtrFldHelpline1Len;
MetricField aMtrFldHelplineOverhang; MetricField* m_pMtrFldHelpline2Len;
FixedText aFtHelplineDist; TriStateBox* m_pTsbBelowRefEdge;
MetricField aMtrFldHelplineDist; MetricField* m_pMtrFldDecimalPlaces;
FixedText aFtHelpline1Len;
MetricField aMtrFldHelpline1Len; SvxRectCtl* m_pCtlPosition;
FixedText aFtHelpline2Len; TriStateBox* m_pTsbAutoPosV;
MetricField aMtrFldHelpline2Len; TriStateBox* m_pTsbAutoPosH;
TriStateBox aTsbBelowRefEdge; TriStateBox* m_pTsbShowUnit;
FixedText aFtDecimalPlaces; ListBox* m_pLbUnit;
MetricField aMtrFldDecimalPlaces; TriStateBox* m_pTsbParallel;
FixedText* m_pFtAutomatic;
FixedLine aFlLabel;
FixedText aFtPosition; SvxXMeasurePreview* m_pCtlPreview;
SvxRectCtl aCtlPosition;
TriStateBox aTsbAutoPosV;
TriStateBox aTsbAutoPosH;
TriStateBox aTsbShowUnit;
ListBox aLbUnit;
TriStateBox aTsbParallel;
SvxXMeasurePreview aCtlPreview;
FixedLine aFlVert;
const SfxItemSet& rOutAttrs; const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet; SfxItemSet aAttrSet;
...@@ -88,6 +78,7 @@ public: ...@@ -88,6 +78,7 @@ public:
void Construct(); void Construct();
void SetView( const SdrView* pSdrView ) { pView = pSdrView; } void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
virtual void PageCreated (SfxAllItemSet aSet); virtual void PageCreated (SfxAllItemSet aSet);
}; };
/* Derived from SfxNoLayoutSingleTabDialog, in order to be able to be /* Derived from SfxNoLayoutSingleTabDialog, in order to be able to be
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <svx/sxmtritm.hxx> #include <svx/sxmtritm.hxx>
#include <svx/sxmuitm.hxx> #include <svx/sxmuitm.hxx>
#include "measure.hrc"
#include "measure.hxx" #include "measure.hxx"
static sal_uInt16 pRanges[] = static sal_uInt16 pRanges[] =
...@@ -91,83 +90,74 @@ SvxMeasureDialog::~SvxMeasureDialog() ...@@ -91,83 +90,74 @@ SvxMeasureDialog::~SvxMeasureDialog()
\************************************************************************/ \************************************************************************/
SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) : SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) :
SvxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_MEASURE ), SvxTabPage ( pWindow
rInAttrs ), ,"DimensionLines"
,"cui/ui/dimensionlines.ui"
aFlLine ( this, CUI_RES( FL_LINE ) ), ,rInAttrs ),
aFtLineDist ( this, CUI_RES( FT_LINE_DIST ) ),
aMtrFldLineDist ( this, CUI_RES( MTR_LINE_DIST ) ), // aCtlPreview ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ),
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 ) ),
rOutAttrs ( rInAttrs ), rOutAttrs ( rInAttrs ),
aAttrSet ( *rInAttrs.GetPool() ), aAttrSet ( *rInAttrs.GetPool() ),
pView( 0 ), pView( 0 ),
bPositionModified ( sal_False ) bPositionModified ( sal_False )
{ {
aCtlPreview.SetAccessibleName(aCtlPreview.GetHelpText()); get(m_pMtrFldLineDist, "MTR_LINE_DIST");
FillUnitLB(); 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 ); const FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs );
SetFieldUnit( aMtrFldLineDist, eFUnit ); SetFieldUnit( *m_pMtrFldLineDist, eFUnit );
SetFieldUnit( aMtrFldHelplineOverhang, eFUnit ); SetFieldUnit( *m_pMtrFldHelplineOverhang, eFUnit );
SetFieldUnit( aMtrFldHelplineDist, eFUnit ); SetFieldUnit( *m_pMtrFldHelplineDist, eFUnit );
SetFieldUnit( aMtrFldHelpline1Len, eFUnit ); SetFieldUnit( *m_pMtrFldHelpline1Len, eFUnit );
SetFieldUnit( aMtrFldHelpline2Len, eFUnit ); SetFieldUnit( *m_pMtrFldHelpline2Len, eFUnit );
if( eFUnit == FUNIT_MM ) if( eFUnit == FUNIT_MM )
{ {
aMtrFldLineDist.SetSpinSize( 50 ); m_pMtrFldLineDist->SetSpinSize( 50 );
aMtrFldHelplineOverhang.SetSpinSize( 50 ); m_pMtrFldHelplineOverhang->SetSpinSize( 50 );
aMtrFldHelplineDist.SetSpinSize( 50 ); m_pMtrFldHelplineDist->SetSpinSize( 50 );
aMtrFldHelpline1Len.SetSpinSize( 50 ); m_pMtrFldHelpline1Len->SetSpinSize( 50 );
aMtrFldHelpline2Len.SetSpinSize( 50 ); m_pMtrFldHelpline2Len->SetSpinSize( 50 );
} }
aTsbAutoPosV.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); m_pTsbAutoPosV->SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) );
aTsbAutoPosH.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); m_pTsbAutoPosH->SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) );
// set background and border of iconchoicectrl // set background and border of iconchoicectrl
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
aCtlPreview.SetBackground ( rStyles.GetWindowColor() ); m_pCtlPreview->SetBackground ( rStyles.GetWindowColor() );
aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO); m_pCtlPreview->SetBorderStyle(WINDOW_BORDER_MONO);
Link aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) ); Link aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) );
aMtrFldLineDist.SetModifyHdl( aLink ); m_pMtrFldLineDist->SetModifyHdl( aLink );
aMtrFldHelplineOverhang.SetModifyHdl( aLink ); m_pMtrFldHelplineOverhang->SetModifyHdl( aLink );
aMtrFldHelplineDist.SetModifyHdl( aLink ); m_pMtrFldHelplineDist->SetModifyHdl( aLink );
aMtrFldHelpline1Len.SetModifyHdl( aLink ); m_pMtrFldHelpline1Len->SetModifyHdl( aLink );
aMtrFldHelpline2Len.SetModifyHdl( aLink ); m_pMtrFldHelpline2Len->SetModifyHdl( aLink );
aMtrFldDecimalPlaces.SetModifyHdl( aLink ); m_pMtrFldDecimalPlaces->SetModifyHdl( aLink );
aTsbBelowRefEdge.SetClickHdl( aLink ); m_pTsbBelowRefEdge->SetClickHdl( aLink );
aTsbParallel.SetClickHdl( aLink ); m_pTsbParallel->SetClickHdl( aLink );
aTsbShowUnit.SetClickHdl( aLink ); m_pTsbShowUnit->SetClickHdl( aLink );
aLbUnit.SetSelectHdl( aLink ); m_pLbUnit->SetSelectHdl( aLink );
aLbUnit.SetAccessibleName(GetNonMnemonicString(aTsbShowUnit.GetText()));
aCtlPosition.SetAccessibleRelationMemberOf( &aFlLabel );
aLbUnit.SetAccessibleRelationLabeledBy( &aTsbShowUnit );
} }
/************************************************************************* /*************************************************************************
...@@ -200,13 +190,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -200,13 +190,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue(); long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue();
SetMetricValue( aMtrFldLineDist, nValue, eUnit ); SetMetricValue( *m_pMtrFldLineDist, nValue, eUnit );
} }
else else
{ {
aMtrFldLineDist.SetText( String() ); m_pMtrFldLineDist->SetText( String() );
} }
aMtrFldLineDist.SaveValue(); m_pMtrFldLineDist->SaveValue();
// SdrMeasureHelplineOverhangItem // SdrMeasureHelplineOverhangItem
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG ); pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG );
...@@ -215,13 +205,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -215,13 +205,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue(); long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelplineOverhang, nValue, eUnit ); SetMetricValue( *m_pMtrFldHelplineOverhang, nValue, eUnit );
} }
else else
{ {
aMtrFldHelplineOverhang.SetText( String() ); m_pMtrFldHelplineOverhang->SetText( String() );
} }
aMtrFldHelplineOverhang.SaveValue(); m_pMtrFldHelplineOverhang->SaveValue();
// SdrMeasureHelplineDistItem // SdrMeasureHelplineDistItem
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST ); pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST );
...@@ -230,13 +220,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -230,13 +220,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue(); long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelplineDist, nValue, eUnit ); SetMetricValue( *m_pMtrFldHelplineDist, nValue, eUnit );
} }
else else
{ {
aMtrFldHelplineDist.SetText( String() ); m_pMtrFldHelplineDist->SetText( String() );
} }
aMtrFldHelplineDist.SaveValue(); m_pMtrFldHelplineDist->SaveValue();
// SdrMeasureHelpline1LenItem // SdrMeasureHelpline1LenItem
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN ); pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN );
...@@ -245,13 +235,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -245,13 +235,13 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue(); long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelpline1Len, nValue, eUnit ); SetMetricValue( *m_pMtrFldHelpline1Len, nValue, eUnit );
} }
else else
{ {
aMtrFldHelpline1Len.SetText( String() ); m_pMtrFldHelpline1Len->SetText( String() );
} }
aMtrFldHelpline1Len.SaveValue(); m_pMtrFldHelpline1Len->SaveValue();
// SdrMeasureHelpline2LenItem // SdrMeasureHelpline2LenItem
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN ); pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN );
...@@ -260,26 +250,26 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -260,26 +250,26 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue(); long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelpline2Len, nValue, eUnit ); SetMetricValue( *m_pMtrFldHelpline2Len, nValue, eUnit );
} }
else else
{ {
aMtrFldHelpline2Len.SetText( String() ); m_pMtrFldHelpline2Len->SetText( String() );
} }
aMtrFldHelpline2Len.SaveValue(); m_pMtrFldHelpline2Len->SaveValue();
// SdrMeasureBelowRefEdgeItem // SdrMeasureBelowRefEdgeItem
if( rAttrs.GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SFX_ITEM_DONTCARE ) 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 ); GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbBelowRefEdge.EnableTriState( sal_False ); m_pTsbBelowRefEdge->EnableTriState( sal_False );
} }
else else
{ {
aTsbBelowRefEdge.SetState( STATE_DONTKNOW ); m_pTsbBelowRefEdge->SetState( STATE_DONTKNOW );
} }
aTsbBelowRefEdge.SaveValue(); m_pTsbBelowRefEdge->SaveValue();
// SdrMeasureDecimalPlacesItem // SdrMeasureDecimalPlacesItem
pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES ); pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES );
...@@ -288,40 +278,40 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -288,40 +278,40 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( pItem ) if( pItem )
{ {
sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue(); sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue();
aMtrFldDecimalPlaces.SetValue( nValue ); m_pMtrFldDecimalPlaces->SetValue( nValue );
} }
else else
{ {
aMtrFldDecimalPlaces.SetText( String() ); m_pMtrFldDecimalPlaces->SetText( String() );
} }
aMtrFldDecimalPlaces.SaveValue(); m_pMtrFldDecimalPlaces->SaveValue();
// SdrMeasureTextRota90Item // SdrMeasureTextRota90Item
// Attention: negate ! // Attention: negate !
if( rAttrs.GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SFX_ITEM_DONTCARE ) 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 ); GetValue() ? STATE_NOCHECK : STATE_CHECK );
aTsbParallel.EnableTriState( sal_False ); m_pTsbParallel->EnableTriState( sal_False );
} }
else else
{ {
aTsbParallel.SetState( STATE_DONTKNOW ); m_pTsbParallel->SetState( STATE_DONTKNOW );
} }
aTsbParallel.SaveValue(); m_pTsbParallel->SaveValue();
// SdrMeasureShowUnitItem // SdrMeasureShowUnitItem
if( rAttrs.GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE ) 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 ); GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbShowUnit.EnableTriState( sal_False ); m_pTsbShowUnit->EnableTriState( sal_False );
} }
else else
{ {
aTsbShowUnit.SetState( STATE_DONTKNOW ); m_pTsbShowUnit->SetState( STATE_DONTKNOW );
} }
aTsbShowUnit.SaveValue(); m_pTsbShowUnit->SaveValue();
// SdrMeasureUnitItem // SdrMeasureUnitItem
if( rAttrs.GetItemState( SDRATTR_MEASUREUNIT ) != SFX_ITEM_DONTCARE ) if( rAttrs.GetItemState( SDRATTR_MEASUREUNIT ) != SFX_ITEM_DONTCARE )
...@@ -329,20 +319,20 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -329,20 +319,20 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs. long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs.
Get( SDRATTR_MEASUREUNIT ) ).GetValue(); 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; break;
} }
} }
} }
else else
{ {
aLbUnit.SetNoSelection(); m_pLbUnit->SetNoSelection();
} }
aLbUnit.SaveValue(); m_pLbUnit->SaveValue();
// Position // Position
if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE )
...@@ -352,8 +342,8 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -352,8 +342,8 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
{ {
if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE ) if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE )
{ {
aTsbAutoPosV.EnableTriState( sal_False ); m_pTsbAutoPosV->EnableTriState( sal_False );
aTsbAutoPosH.EnableTriState( sal_False ); m_pTsbAutoPosH->EnableTriState( sal_False );
SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos) SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos)
( ( const SdrMeasureTextHPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue(); ( ( const SdrMeasureTextHPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
...@@ -403,33 +393,33 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) ...@@ -403,33 +393,33 @@ void SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
if( eHPos == SDRMEASURE_TEXTHAUTO ) if( eHPos == SDRMEASURE_TEXTHAUTO )
{ {
aTsbAutoPosH.SetState( STATE_CHECK ); m_pTsbAutoPosH->SetState( STATE_CHECK );
nState = CS_NOHORZ; nState = CS_NOHORZ;
} }
if( eVPos == SDRMEASURE_TEXTVAUTO ) if( eVPos == SDRMEASURE_TEXTVAUTO )
{ {
aTsbAutoPosV.SetState( STATE_CHECK ); m_pTsbAutoPosV->SetState( STATE_CHECK );
nState |= CS_NOVERT; nState |= CS_NOVERT;
} }
aCtlPosition.SetState( nState ); m_pCtlPosition->SetState( nState );
aCtlPosition.SetActualRP( eRP ); m_pCtlPosition->SetActualRP( eRP );
} }
} }
} }
else else
{ {
aCtlPosition.Reset(); m_pCtlPosition->Reset();
aTsbAutoPosV.SetState( STATE_DONTKNOW ); m_pTsbAutoPosV->SetState( STATE_DONTKNOW );
aTsbAutoPosH.SetState( STATE_DONTKNOW ); m_pTsbAutoPosH->SetState( STATE_DONTKNOW );
} }
// put the attributes to the preview-control, // put the attributes to the preview-control,
// otherwise the control don't know about // otherwise the control don't know about
// the settings of the dialog (#67930) // the settings of the dialog (#67930)
ChangeAttrHdl_Impl( &aTsbShowUnit ); ChangeAttrHdl_Impl( m_pTsbShowUnit );
aCtlPreview.SetAttributes( rAttrs ); m_pCtlPreview->SetAttributes( rAttrs );
bPositionModified = sal_False; bPositionModified = sal_False;
} }
...@@ -446,77 +436,77 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) ...@@ -446,77 +436,77 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs)
sal_Int32 nValue; sal_Int32 nValue;
TriState eState; 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 ) ); rAttrs.Put( SdrMeasureLineDistItem( nValue ) );
bModified = sal_True; 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 ) ); rAttrs.Put( SdrMeasureHelplineOverhangItem( nValue ) );
bModified = sal_True; 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 ) ); rAttrs.Put( SdrMeasureHelplineDistItem( nValue ) );
bModified = sal_True; 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 ) ); rAttrs.Put( SdrMeasureHelpline1LenItem( nValue ) );
bModified = sal_True; 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 ) ); rAttrs.Put( SdrMeasureHelpline2LenItem( nValue ) );
bModified = sal_True; bModified = sal_True;
} }
eState = aTsbBelowRefEdge.GetState(); eState = m_pTsbBelowRefEdge->GetState();
if( eState != aTsbBelowRefEdge.GetSavedValue() ) if( eState != m_pTsbBelowRefEdge->GetSavedValue() )
{ {
rAttrs.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); rAttrs.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True; 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( rAttrs.Put(
SdrMeasureDecimalPlacesItem( SdrMeasureDecimalPlacesItem(
sal::static_int_cast< sal_Int16 >( nValue ) ) ); sal::static_int_cast< sal_Int16 >( nValue ) ) );
bModified = sal_True; bModified = sal_True;
} }
eState = aTsbParallel.GetState(); eState = m_pTsbParallel->GetState();
if( eState != aTsbParallel.GetSavedValue() ) if( eState != m_pTsbParallel->GetSavedValue() )
{ {
rAttrs.Put( SdrMeasureTextRota90Item( (sal_Bool) STATE_NOCHECK == eState ) ); rAttrs.Put( SdrMeasureTextRota90Item( (sal_Bool) STATE_NOCHECK == eState ) );
bModified = sal_True; bModified = sal_True;
} }
eState = aTsbShowUnit.GetState(); eState = m_pTsbShowUnit->GetState();
if( eState != aTsbShowUnit.GetSavedValue() ) if( eState != m_pTsbShowUnit->GetSavedValue() )
{ {
rAttrs.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); rAttrs.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True; bModified = sal_True;
} }
sal_uInt16 nPos = aLbUnit.GetSelectEntryPos(); sal_uInt16 nPos = m_pLbUnit->GetSelectEntryPos();
if( nPos != aLbUnit.GetSavedValue() ) if( nPos != m_pLbUnit->GetSavedValue() )
{ {
if( nPos != LISTBOX_ENTRY_NOTFOUND ) 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; FieldUnit _eUnit = (FieldUnit) nFieldUnit;
rAttrs.Put( SdrMeasureUnitItem( _eUnit ) ); rAttrs.Put( SdrMeasureUnitItem( _eUnit ) );
bModified = sal_True; bModified = sal_True;
...@@ -529,7 +519,7 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) ...@@ -529,7 +519,7 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs)
SdrMeasureTextVPos eVPos, eOldVPos; SdrMeasureTextVPos eVPos, eOldVPos;
SdrMeasureTextHPos eHPos, eOldHPos; SdrMeasureTextHPos eHPos, eOldHPos;
RECT_POINT eRP = aCtlPosition.GetActualRP(); RECT_POINT eRP = m_pCtlPosition->GetActualRP();
switch( eRP ) switch( eRP )
{ {
default: default:
...@@ -552,10 +542,10 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) ...@@ -552,10 +542,10 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs)
case RP_RB: eVPos = SDRMEASURE_BELOW; case RP_RB: eVPos = SDRMEASURE_BELOW;
eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
} }
if( aTsbAutoPosH.GetState() == STATE_CHECK ) if( m_pTsbAutoPosH->GetState() == STATE_CHECK )
eHPos = SDRMEASURE_TEXTHAUTO; eHPos = SDRMEASURE_TEXTHAUTO;
if( aTsbAutoPosV.GetState() == STATE_CHECK ) if( m_pTsbAutoPosV->GetState() == STATE_CHECK )
eVPos = SDRMEASURE_TEXTVAUTO; eVPos = SDRMEASURE_TEXTVAUTO;
if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE )
...@@ -605,8 +595,8 @@ void SvxMeasurePage::Construct() ...@@ -605,8 +595,8 @@ void SvxMeasurePage::Construct()
{ {
DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
aCtlPreview.pMeasureObj->SetModel( pView->GetModel() ); m_pCtlPreview->pMeasureObj->SetModel( pView->GetModel() );
aCtlPreview.Invalidate(); m_pCtlPreview->Invalidate();
} }
/************************************************************************* /*************************************************************************
...@@ -633,44 +623,44 @@ void SvxMeasurePage::PointChanged( Window* pWindow, RECT_POINT /*eRP*/ ) ...@@ -633,44 +623,44 @@ void SvxMeasurePage::PointChanged( Window* pWindow, RECT_POINT /*eRP*/ )
IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p ) 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_LT:
case RP_RT: case RP_RT:
aCtlPosition.SetActualRP( RP_MT ); m_pCtlPosition->SetActualRP( RP_MT );
break; break;
case RP_LM: case RP_LM:
case RP_RM: case RP_RM:
aCtlPosition.SetActualRP( RP_MM ); m_pCtlPosition->SetActualRP( RP_MM );
break; break;
case RP_LB: case RP_LB:
case RP_RB: case RP_RB:
aCtlPosition.SetActualRP( RP_MB ); m_pCtlPosition->SetActualRP( RP_MB );
break; break;
default: ;//prevent warning 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_LT:
case RP_LB: case RP_LB:
aCtlPosition.SetActualRP( RP_LM ); m_pCtlPosition->SetActualRP( RP_LM );
break; break;
case RP_MT: case RP_MT:
case RP_MB: case RP_MB:
aCtlPosition.SetActualRP( RP_MM ); m_pCtlPosition->SetActualRP( RP_MM );
break; break;
case RP_RT: case RP_RT:
case RP_RB: case RP_RB:
aCtlPosition.SetActualRP( RP_RM ); m_pCtlPosition->SetActualRP( RP_RM );
break; break;
default: ;//prevent warning default: ;//prevent warning
} }
...@@ -683,81 +673,81 @@ IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p ) ...@@ -683,81 +673,81 @@ IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p )
IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_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 ) ); 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) ); 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) ); 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 ) ); 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 ) ); aAttrSet.Put( SdrMeasureHelpline2LenItem( nValue ) );
} }
if( p == &aTsbBelowRefEdge ) if( p == m_pTsbBelowRefEdge )
{ {
TriState eState = aTsbBelowRefEdge.GetState(); TriState eState = m_pTsbBelowRefEdge->GetState();
if( eState != STATE_DONTKNOW ) if( eState != STATE_DONTKNOW )
aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) );
} }
if( p == &aMtrFldDecimalPlaces ) if( p == m_pMtrFldDecimalPlaces )
{ {
sal_Int16 nValue = sal::static_int_cast< sal_Int16 >( sal_Int16 nValue = sal::static_int_cast< sal_Int16 >(
aMtrFldDecimalPlaces.GetValue() ); m_pMtrFldDecimalPlaces->GetValue() );
aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) ); aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) );
} }
if( p == &aTsbParallel ) if( p == m_pTsbParallel )
{ {
TriState eState = aTsbParallel.GetState(); TriState eState = m_pTsbParallel->GetState();
if( eState != STATE_DONTKNOW ) if( eState != STATE_DONTKNOW )
aAttrSet.Put( SdrMeasureTextRota90Item( (sal_Bool) !STATE_CHECK == eState ) ); 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 ) if( eState != STATE_DONTKNOW )
aAttrSet.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); 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 ) 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; FieldUnit _eUnit = (FieldUnit) nFieldUnit;
aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) ); aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) );
} }
} }
if( p == &aTsbAutoPosV || p == &aTsbAutoPosH || p == &aCtlPosition ) if( p == m_pTsbAutoPosV || p == m_pTsbAutoPosH || p == m_pCtlPosition )
{ {
bPositionModified = sal_True; bPositionModified = sal_True;
// Position // Position
RECT_POINT eRP = aCtlPosition.GetActualRP(); RECT_POINT eRP = m_pCtlPosition->GetActualRP();
SdrMeasureTextVPos eVPos; SdrMeasureTextVPos eVPos;
SdrMeasureTextHPos eHPos; SdrMeasureTextHPos eHPos;
...@@ -786,27 +776,27 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) ...@@ -786,27 +776,27 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p )
CTL_STATE nState = 0; CTL_STATE nState = 0;
if( aTsbAutoPosH.GetState() == STATE_CHECK ) if( m_pTsbAutoPosH->GetState() == STATE_CHECK )
{ {
eHPos = SDRMEASURE_TEXTHAUTO; eHPos = SDRMEASURE_TEXTHAUTO;
nState = CS_NOHORZ; nState = CS_NOHORZ;
} }
if( aTsbAutoPosV.GetState() == STATE_CHECK ) if( m_pTsbAutoPosV->GetState() == STATE_CHECK )
{ {
eVPos = SDRMEASURE_TEXTVAUTO; eVPos = SDRMEASURE_TEXTVAUTO;
nState |= CS_NOVERT; nState |= CS_NOVERT;
} }
if( p == &aTsbAutoPosV || p == &aTsbAutoPosH ) if( p == m_pTsbAutoPosV || p == m_pTsbAutoPosH )
aCtlPosition.SetState( nState ); m_pCtlPosition->SetState( nState );
aAttrSet.Put( SdrMeasureTextVPosItem( eVPos ) ); aAttrSet.Put( SdrMeasureTextVPosItem( eVPos ) );
aAttrSet.Put( SdrMeasureTextHPosItem( eHPos ) ); aAttrSet.Put( SdrMeasureTextHPosItem( eHPos ) );
} }
aCtlPreview.SetAttributes( aAttrSet ); m_pCtlPreview->SetAttributes( aAttrSet );
aCtlPreview.Invalidate(); m_pCtlPreview->Invalidate();
return( 0L ); return( 0L );
} }
...@@ -817,16 +807,16 @@ void SvxMeasurePage::FillUnitLB() ...@@ -817,16 +807,16 @@ void SvxMeasurePage::FillUnitLB()
SvxStringArray aMetricArr( SVX_RES( RID_SVXSTR_FIELDUNIT_TABLE ) ); SvxStringArray aMetricArr( SVX_RES( RID_SVXSTR_FIELDUNIT_TABLE ) );
sal_IntPtr nUnit = FUNIT_NONE; sal_IntPtr nUnit = FUNIT_NONE;
String aStrMetric( CUI_RES( STR_MEASURE_AUTOMATIC ) ); OUString aStrMetric( m_pFtAutomatic->GetText());
sal_uInt16 nPos = aLbUnit.InsertEntry( aStrMetric ); sal_uInt16 nPos = m_pLbUnit->InsertEntry( aStrMetric );
aLbUnit.SetEntryData( nPos, (void*)nUnit ); m_pLbUnit->SetEntryData( nPos, (void*)nUnit );
for( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i ) for( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i )
{ {
aStrMetric = aMetricArr.GetStringByPos( i ); aStrMetric = aMetricArr.GetStringByPos( i );
nUnit = aMetricArr.GetValue( i ); nUnit = aMetricArr.GetValue( i );
nPos = aLbUnit.InsertEntry( aStrMetric ); nPos = m_pLbUnit->InsertEntry( aStrMetric );
aLbUnit.SetEntryData( nPos, (void*)nUnit ); m_pLbUnit->SetEntryData( nPos, (void*)nUnit );
} }
} }
void SvxMeasurePage::PageCreated (SfxAllItemSet aSet) void SvxMeasurePage::PageCreated (SfxAllItemSet aSet)
......
/* -*- 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: */
/* -*- 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: */
<?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>
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.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"> <object class="GtkBox" id="LineTabPage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -700,11 +715,11 @@ ...@@ -700,11 +715,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW"> <object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW:border">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child internal-child="accessible"> <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> <property name="AtkObject::accessible-name" translatable="yes">Example</property>
</object> </object>
</child> </child>
...@@ -716,21 +731,6 @@ ...@@ -716,21 +731,6 @@
</packing> </packing>
</child> </child>
</object> </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"> <object class="GtkListStore" id="liststoreCAP_STYLE">
<columns> <columns>
<!-- column-name gchararray1 --> <!-- column-name gchararray1 -->
......
...@@ -248,6 +248,9 @@ ...@@ -248,6 +248,9 @@
<glade-widget-class title="SvxXLinePreview" name="svxlo-SvxXLinePreview" <glade-widget-class title="SvxXLinePreview" name="svxlo-SvxXLinePreview"
generic-name="Line Preview Window" parent="GtkDrawingArea" generic-name="Line Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> 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" <glade-widget-class title="Shadow Preview" name="svxlo-SvxXShadowPreview"
generic-name="Shadow Preview Window" parent="GtkDrawingArea" generic-name="Shadow Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
......
...@@ -37,16 +37,16 @@ class SVX_DLLPUBLIC SvxXMeasurePreview : public Control ...@@ -37,16 +37,16 @@ class SVX_DLLPUBLIC SvxXMeasurePreview : public Control
friend class SvxMeasurePage; friend class SvxMeasurePage;
private: private:
const SfxItemSet& rAttrs;
SdrMeasureObj* pMeasureObj; SdrMeasureObj* pMeasureObj;
SdrModel* pModel; SdrModel* pModel;
public: public:
SvxXMeasurePreview( Window* pParent, const ResId& rResId, SvxXMeasurePreview(Window* pParent, const ResId& rResId, const SfxItemSet& rInAttrs);
const SfxItemSet& rInAttrs ); SvxXMeasurePreview(Window* pParent, WinBits nStyle);
~SvxXMeasurePreview(); ~SvxXMeasurePreview();
virtual void Paint( const Rectangle& rRect ); virtual void Paint(const Rectangle& rRect);
virtual void Resize();
virtual void MouseButtonDown( const MouseEvent& rMEvt ); virtual void MouseButtonDown( const MouseEvent& rMEvt );
void SetAttributes( const SfxItemSet& rInAttrs ); void SetAttributes( const SfxItemSet& rInAttrs );
......
...@@ -19,20 +19,14 @@ ...@@ -19,20 +19,14 @@
#include <svx/svdomeas.hxx> #include <svx/svdomeas.hxx>
#include <svx/svdmodel.hxx> #include <svx/svdmodel.hxx>
#include <vcl/builder.hxx>
#include "svx/measctrl.hxx" #include "svx/measctrl.hxx"
#include <svx/dialmgr.hxx> #include <svx/dialmgr.hxx>
#include "svx/dlgutil.hxx" #include "svx/dlgutil.hxx"
SvxXMeasurePreview::SvxXMeasurePreview SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent,const ResId& rResId,const SfxItemSet& rInAttrs)
( : Control ( pParent, rResId )
Window* pParent,
const ResId& rResId,
const SfxItemSet& rInAttrs
) :
Control ( pParent, rResId ),
rAttrs ( rInAttrs )
{ {
SetMapMode( MAP_100TH_MM ); SetMapMode( MAP_100TH_MM );
...@@ -60,6 +54,51 @@ SvxXMeasurePreview::SvxXMeasurePreview ...@@ -60,6 +54,51 @@ SvxXMeasurePreview::SvxXMeasurePreview
Invalidate(); 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() SvxXMeasurePreview::~SvxXMeasurePreview()
{ {
// No one is deleting the MeasureObj? This is not only an error but also // No one is deleting the MeasureObj? This is not only an error but also
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment