Kaydet (Commit) e001743a authored tarafından Caolán McNamara's avatar Caolán McNamara

convert crop page to .ui

Change-Id: I01946f979fc043c5b1ca2777f0af1769e2c8a362
üst a56bfe73
...@@ -65,7 +65,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ ...@@ -65,7 +65,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/tabpages/border.src \ cui/source/tabpages/border.src \
cui/source/tabpages/dstribut.src \ cui/source/tabpages/dstribut.src \
cui/source/tabpages/frmdirlbox.src \ cui/source/tabpages/frmdirlbox.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/page.src \ cui/source/tabpages/page.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/connectortabpage \ cui/uiconfig/ui/connectortabpage \
cui/uiconfig/ui/croppage \
cui/uiconfig/ui/cuiimapdlg \ cui/uiconfig/ui/cuiimapdlg \
cui/uiconfig/ui/dimensionlinestabpage \ cui/uiconfig/ui/dimensionlinestabpage \
cui/uiconfig/ui/editdictionarydialog \ cui/uiconfig/ui/editdictionarydialog \
......
...@@ -44,6 +44,12 @@ String RID_SVXSTR_ROW ...@@ -44,6 +44,12 @@ String RID_SVXSTR_ROW
Text [ en-US ] = "Insert Rows" ; Text [ en-US ] = "Insert Rows" ;
}; };
String RID_SVXSTR_PPI
{
Text [ x-comment ] = "PPI is pixel per inch, %1 is a number" ;
Text [ en-US ] = "(%1 PPI)" ;
};
String RID_SVXSTR_COL String RID_SVXSTR_COL
{ {
Text [ en-US ] = "Insert Columns" ; Text [ en-US ] = "Insert Columns" ;
......
...@@ -452,6 +452,8 @@ ...@@ -452,6 +452,8 @@
#define RID_SVXSTR_CHG_SMARTART (RID_SVX_START + 1251) #define RID_SVXSTR_CHG_SMARTART (RID_SVX_START + 1251)
#define RID_SVXSTR_PPI (RID_SVX_START + 1252)
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -26,23 +26,17 @@ ...@@ -26,23 +26,17 @@
#include <vcl/graph.hxx> #include <vcl/graph.hxx>
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
class SvxCropExample : public Window
class SvxGrfCropPage : public SfxTabPage
{ {
using Window::CalcZoom;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
class SvxCropExample : public Window
{
Size aFrameSize; Size aFrameSize;
Point aTopLeft, aBottomRight; Point aTopLeft, aBottomRight;
Graphic aGrf; Graphic aGrf;
public: public:
SvxCropExample( Window* pPar, const ResId& rResId ); SvxCropExample( Window* pPar, WinBits nStyle );
virtual void Paint( const Rectangle& rRect ); virtual void Paint( const Rectangle& rRect );
virtual Size GetOptimalSize() const;
void SetTopLeft( const Point& rNew ) { aTopLeft = rNew; } void SetTopLeft( const Point& rNew ) { aTopLeft = rNew; }
void SetTop( long nVal ) { aTopLeft.X() = nVal; } void SetTop( long nVal ) { aTopLeft.X() = nVal; }
...@@ -53,36 +47,36 @@ class SvxGrfCropPage : public SfxTabPage ...@@ -53,36 +47,36 @@ class SvxGrfCropPage : public SfxTabPage
void SetFrameSize( const Size& rSz ); void SetFrameSize( const Size& rSz );
void SetGraphic( const Graphic& rGrf ) { aGrf = rGrf; } void SetGraphic( const Graphic& rGrf ) { aGrf = rGrf; }
const Graphic& GetGraphic() const { return aGrf; } const Graphic& GetGraphic() const { return aGrf; }
}; };
FixedLine aCropFL; class SvxGrfCropPage : public SfxTabPage
RadioButton aZoomConstRB; {
RadioButton aSizeConstRB; using Window::CalcZoom;
FixedText aLeftFT; using TabPage::ActivatePage;
MetricField aLeftMF; using TabPage::DeactivatePage;
FixedText aRightFT;
MetricField aRightMF; VclContainer* m_pCropFrame;
FixedText aTopFT; RadioButton* m_pZoomConstRB;
MetricField aTopMF; RadioButton* m_pSizeConstRB;
FixedText aBottomFT; MetricField* m_pLeftMF;
MetricField aBottomMF; MetricField* m_pRightMF;
MetricField* m_pTopMF;
FixedLine aZoomFL; MetricField* m_pBottomMF;
FixedText aWidthZoomFT;
MetricField aWidthZoomMF; VclContainer* m_pScaleFrame;
FixedText aHeightZoomFT; MetricField* m_pWidthZoomMF;
MetricField aHeightZoomMF; MetricField* m_pHeightZoomMF;
FixedLine aSizeFL; VclContainer* m_pSizeFrame;
FixedText aWidthFT; MetricField* m_pWidthMF;
MetricField aWidthMF; MetricField* m_pHeightMF;
FixedText aHeightFT;
MetricField aHeightMF; VclContainer* m_pOrigSizeGrid;
FixedText aOrigSizeFT; FixedText* m_pOrigSizeFT;
PushButton aOrigSizePB; PushButton* m_pOrigSizePB;
// Example // Example
SvxCropExample aExampleWN; SvxCropExample* m_pExampleWN;
Timer aTimer; Timer aTimer;
......
...@@ -211,7 +211,6 @@ ...@@ -211,7 +211,6 @@
#define HID_OFAPAGE_AUTOCOMPLETE_OPTIONS "CUI_HID_OFAPAGE_AUTOCOMPLETE_OPTIONS" #define HID_OFAPAGE_AUTOCOMPLETE_OPTIONS "CUI_HID_OFAPAGE_AUTOCOMPLETE_OPTIONS"
#define HID_PAGE_DISTRIBUTE "CUI_HID_PAGE_DISTRIBUTE" #define HID_PAGE_DISTRIBUTE "CUI_HID_PAGE_DISTRIBUTE"
#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"
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
#include <editeng/brushitem.hxx> #include <editeng/brushitem.hxx>
#include <grfpage.hxx> #include <grfpage.hxx>
#include <svx/grfcrop.hxx> #include <svx/grfcrop.hxx>
#include <grfpage.hrc>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <cuires.hrc> #include <cuires.hrc>
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#include <vcl/builder.hxx>
#define CM_1_TO_TWIP 567 #define CM_1_TO_TWIP 567
#define TWIP_TO_INCH 1440 #define TWIP_TO_INCH 1440
...@@ -48,86 +48,76 @@ static inline long lcl_GetValue( MetricField& rMetric, FieldUnit eUnit ) ...@@ -48,86 +48,76 @@ static inline long lcl_GetValue( MetricField& rMetric, FieldUnit eUnit )
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
SvxGrfCropPage::SvxGrfCropPage ( Window *pParent, const SfxItemSet &rSet ) SvxGrfCropPage::SvxGrfCropPage ( Window *pParent, const SfxItemSet &rSet )
: SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_GRFCROP ), rSet ), : SfxTabPage(pParent, "CropPage", "cui/ui/croppage.ui", rSet)
aCropFL( this, CUI_RES( FL_CROP )), , pLastCropField(0)
aZoomConstRB( this, CUI_RES( RB_ZOOMCONST)), , bInitialized(false)
aSizeConstRB( this, CUI_RES( RB_SIZECONST)), , bSetOrigSize(false)
aLeftFT( this, CUI_RES( FT_LEFT )),
aLeftMF( this, CUI_RES( MF_LEFT )),
aRightFT( this, CUI_RES( FT_RIGHT )),
aRightMF( this, CUI_RES( MF_RIGHT )),
aTopFT( this, CUI_RES( FT_TOP )),
aTopMF( this, CUI_RES( MF_TOP )),
aBottomFT( this, CUI_RES( FT_BOTTOM )),
aBottomMF( this, CUI_RES( MF_BOTTOM )),
aZoomFL( this, CUI_RES( FL_ZOOM )),
aWidthZoomFT( this, CUI_RES( FT_WIDTHZOOM )),
aWidthZoomMF( this, CUI_RES( MF_WIDTHZOOM )),
aHeightZoomFT( this, CUI_RES( FT_HEIGHTZOOM)),
aHeightZoomMF( this, CUI_RES( MF_HEIGHTZOOM)),
aSizeFL( this, CUI_RES( FL_SIZE )),
aWidthFT( this, CUI_RES( FT_WIDTH )),
aWidthMF( this, CUI_RES( MF_WIDTH )),
aHeightFT( this, CUI_RES( FT_HEIGHT )),
aHeightMF( this, CUI_RES( MF_HEIGHT )),
aOrigSizeFT( this, CUI_RES(FT_ORIG_SIZE)),
aOrigSizePB( this, CUI_RES( PB_ORGSIZE )),
aExampleWN( this, CUI_RES( WN_BSP )),
pLastCropField(0),
bInitialized(sal_False),
bSetOrigSize(sal_False)
{ {
FreeResource(); get(m_pCropFrame, "cropframe");
get(m_pScaleFrame, "scaleframe");
get(m_pSizeFrame, "sizeframe");
get(m_pOrigSizeGrid, "origsizegrid");
get(m_pZoomConstRB, "keepscale");
get(m_pSizeConstRB, "keepsize");
get(m_pOrigSizeFT, "origsizeft");
get(m_pOrigSizePB, "origsize");
get(m_pLeftMF, "left");
get(m_pRightMF, "right");
get(m_pTopMF, "top");
get(m_pBottomMF, "bottom");
get(m_pWidthZoomMF, "widthzoom");
get(m_pHeightZoomMF, "heightzoom");
get(m_pWidthMF, "width");
get(m_pHeightMF, "height");
get(m_pExampleWN, "preview");
SetExchangeSupport(); SetExchangeSupport();
// set the correct metric // set the correct metric
const FieldUnit eMetric = GetModuleFieldUnit( rSet ); const FieldUnit eMetric = GetModuleFieldUnit( rSet );
SetFieldUnit( aWidthMF, eMetric ); SetFieldUnit( *m_pWidthMF, eMetric );
SetFieldUnit( aHeightMF, eMetric ); SetFieldUnit( *m_pHeightMF, eMetric );
SetFieldUnit( aLeftMF, eMetric ); SetFieldUnit( *m_pLeftMF, eMetric );
SetFieldUnit( aRightMF, eMetric ); SetFieldUnit( *m_pRightMF, eMetric );
SetFieldUnit( aTopMF , eMetric ); SetFieldUnit( *m_pTopMF , eMetric );
SetFieldUnit( aBottomMF, eMetric ); SetFieldUnit( *m_pBottomMF, eMetric );
Link aLk = LINK(this, SvxGrfCropPage, SizeHdl); Link aLk = LINK(this, SvxGrfCropPage, SizeHdl);
aWidthMF.SetModifyHdl( aLk ); m_pWidthMF->SetModifyHdl( aLk );
aHeightMF.SetModifyHdl( aLk ); m_pHeightMF->SetModifyHdl( aLk );
aLk = LINK(this, SvxGrfCropPage, ZoomHdl); aLk = LINK(this, SvxGrfCropPage, ZoomHdl);
aWidthZoomMF.SetModifyHdl( aLk ); m_pWidthZoomMF->SetModifyHdl( aLk );
aHeightZoomMF.SetModifyHdl( aLk ); m_pHeightZoomMF->SetModifyHdl( aLk );
aLk = LINK(this, SvxGrfCropPage, CropHdl); aLk = LINK(this, SvxGrfCropPage, CropHdl);
aLeftMF.SetDownHdl( aLk ); m_pLeftMF->SetDownHdl( aLk );
aRightMF.SetDownHdl( aLk ); m_pRightMF->SetDownHdl( aLk );
aTopMF.SetDownHdl( aLk ); m_pTopMF->SetDownHdl( aLk );
aBottomMF.SetDownHdl( aLk ); m_pBottomMF->SetDownHdl( aLk );
aLeftMF.SetUpHdl( aLk ); m_pLeftMF->SetUpHdl( aLk );
aRightMF.SetUpHdl( aLk ); m_pRightMF->SetUpHdl( aLk );
aTopMF.SetUpHdl( aLk ); m_pTopMF->SetUpHdl( aLk );
aBottomMF.SetUpHdl( aLk ); m_pBottomMF->SetUpHdl( aLk );
aLk = LINK(this, SvxGrfCropPage, CropModifyHdl); aLk = LINK(this, SvxGrfCropPage, CropModifyHdl);
aLeftMF.SetModifyHdl( aLk ); m_pLeftMF->SetModifyHdl( aLk );
aRightMF.SetModifyHdl( aLk ); m_pRightMF->SetModifyHdl( aLk );
aTopMF.SetModifyHdl( aLk ); m_pTopMF->SetModifyHdl( aLk );
aBottomMF.SetModifyHdl( aLk ); m_pBottomMF->SetModifyHdl( aLk );
aLk = LINK(this, SvxGrfCropPage, CropLoseFocusHdl); aLk = LINK(this, SvxGrfCropPage, CropLoseFocusHdl);
aLeftMF.SetLoseFocusHdl( aLk ); m_pLeftMF->SetLoseFocusHdl( aLk );
aRightMF.SetLoseFocusHdl( aLk ); m_pRightMF->SetLoseFocusHdl( aLk );
aTopMF.SetLoseFocusHdl( aLk ); m_pTopMF->SetLoseFocusHdl( aLk );
aBottomMF.SetLoseFocusHdl( aLk ); m_pBottomMF->SetLoseFocusHdl( aLk );
aLk = LINK(this, SvxGrfCropPage, OrigSizeHdl); aLk = LINK(this, SvxGrfCropPage, OrigSizeHdl);
aOrigSizePB.SetClickHdl( aLk ); m_pOrigSizePB->SetClickHdl( aLk );
aTimer.SetTimeoutHdl(LINK(this, SvxGrfCropPage, Timeout)); aTimer.SetTimeoutHdl(LINK(this, SvxGrfCropPage, Timeout));
aTimer.SetTimeout( 1500 ); aTimer.SetTimeout( 1500 );
aOrigSizePB.SetAccessibleRelationLabeledBy( &aOrigSizeFT );
} }
SvxGrfCropPage::~SvxGrfCropPage() SvxGrfCropPage::~SvxGrfCropPage()
...@@ -149,10 +139,10 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) ...@@ -149,10 +139,10 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet )
SID_ATTR_GRAF_KEEP_ZOOM ), sal_True, &pItem )) SID_ATTR_GRAF_KEEP_ZOOM ), sal_True, &pItem ))
{ {
if( ((const SfxBoolItem*)pItem)->GetValue() ) if( ((const SfxBoolItem*)pItem)->GetValue() )
aZoomConstRB.Check(); m_pZoomConstRB->Check();
else else
aSizeConstRB.Check(); m_pSizeConstRB->Check();
aZoomConstRB.SaveValue(); m_pZoomConstRB->SaveValue();
} }
sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP ); sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
...@@ -162,22 +152,22 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) ...@@ -162,22 +152,22 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet )
SvxGrfCrop* pCrop = (SvxGrfCrop*)pItem; SvxGrfCrop* pCrop = (SvxGrfCrop*)pItem;
aExampleWN.SetLeft( pCrop->GetLeft()); m_pExampleWN->SetLeft( pCrop->GetLeft());
aExampleWN.SetRight( pCrop->GetRight()); m_pExampleWN->SetRight( pCrop->GetRight());
aExampleWN.SetTop( pCrop->GetTop()); m_pExampleWN->SetTop( pCrop->GetTop());
aExampleWN.SetBottom( pCrop->GetBottom()); m_pExampleWN->SetBottom( pCrop->GetBottom());
aLeftMF.SetValue( aLeftMF.Normalize( pCrop->GetLeft()), eUnit ); m_pLeftMF->SetValue( m_pLeftMF->Normalize( pCrop->GetLeft()), eUnit );
aRightMF.SetValue( aRightMF.Normalize( pCrop->GetRight()), eUnit ); m_pRightMF->SetValue( m_pRightMF->Normalize( pCrop->GetRight()), eUnit );
aTopMF.SetValue( aTopMF.Normalize( pCrop->GetTop()), eUnit ); m_pTopMF->SetValue( m_pTopMF->Normalize( pCrop->GetTop()), eUnit );
aBottomMF.SetValue( aBottomMF.Normalize( pCrop->GetBottom()), eUnit ); m_pBottomMF->SetValue( m_pBottomMF->Normalize( pCrop->GetBottom()), eUnit );
} }
else else
{ {
aLeftMF.SetValue( 0 ); m_pLeftMF->SetValue( 0 );
aRightMF.SetValue( 0 ); m_pRightMF->SetValue( 0 );
aTopMF.SetValue( 0 ); m_pTopMF->SetValue( 0 );
aBottomMF.SetValue( 0 ); m_pBottomMF->SetValue( 0 );
} }
nW = rPool.GetWhich( SID_ATTR_PAGE_SIZE ); nW = rPool.GetWhich( SID_ATTR_PAGE_SIZE );
...@@ -188,13 +178,13 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) ...@@ -188,13 +178,13 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet )
aPageSize = ((const SvxSizeItem*)pItem)->GetSize(); aPageSize = ((const SvxSizeItem*)pItem)->GetSize();
sal_Int64 nTmp = aHeightMF.Normalize(aPageSize.Height()); sal_Int64 nTmp = m_pHeightMF->Normalize(aPageSize.Height());
aHeightMF.SetMax( nTmp, eUnit ); m_pHeightMF->SetMax( nTmp, eUnit );
nTmp = aWidthMF.Normalize(aPageSize.Width()); nTmp = m_pWidthMF->Normalize(aPageSize.Width());
aWidthMF.SetMax( nTmp, eUnit ); m_pWidthMF->SetMax( nTmp, eUnit );
nTmp = aWidthMF.Normalize( 23 ); nTmp = m_pWidthMF->Normalize( 23 );
aHeightMF.SetMin( nTmp, eUnit ); m_pHeightMF->SetMin( nTmp, eUnit );
aWidthMF.SetMin( nTmp, eUnit ); m_pWidthMF->SetMin( nTmp, eUnit );
} }
else else
{ {
...@@ -225,8 +215,8 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) ...@@ -225,8 +215,8 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet )
if( aOrigSize.Width() && aOrigSize.Height() ) if( aOrigSize.Width() && aOrigSize.Height() )
{ {
CalcMinMaxBorder(); CalcMinMaxBorder();
aExampleWN.SetGraphic( *pGrf ); m_pExampleWN->SetGraphic( *pGrf );
aExampleWN.SetFrameSize( aOrigSize ); m_pExampleWN->SetFrameSize( aOrigSize );
bFound = sal_True; bFound = sal_True;
if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() ) if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() )
...@@ -244,8 +234,8 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet) ...@@ -244,8 +234,8 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet)
{ {
const SfxItemPool& rPool = *rSet.GetPool(); const SfxItemPool& rPool = *rSet.GetPool();
sal_Bool bModified = sal_False; sal_Bool bModified = sal_False;
if( aWidthMF.GetSavedValue() != aWidthMF.GetText() || if( m_pWidthMF->GetSavedValue() != m_pWidthMF->GetText() ||
aHeightMF.GetSavedValue() != aHeightMF.GetText() ) m_pHeightMF->GetSavedValue() != m_pHeightMF->GetText() )
{ {
sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE ); sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE );
FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
...@@ -263,13 +253,13 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet) ...@@ -263,13 +253,13 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet)
aSz = (const SvxSizeItem&)GetItemSet().Get( nW ); aSz = (const SvxSizeItem&)GetItemSet().Get( nW );
Size aTmpSz( aSz.GetSize() ); Size aTmpSz( aSz.GetSize() );
if( aWidthMF.GetText() != aWidthMF.GetSavedValue() ) if( m_pWidthMF->GetText() != m_pWidthMF->GetSavedValue() )
aTmpSz.Width() = lcl_GetValue( aWidthMF, eUnit ); aTmpSz.Width() = lcl_GetValue( *m_pWidthMF, eUnit );
if( aHeightMF.GetText() != aHeightMF.GetSavedValue() ) if( m_pHeightMF->GetText() != m_pHeightMF->GetSavedValue() )
aTmpSz.Height() = lcl_GetValue( aHeightMF, eUnit ); aTmpSz.Height() = lcl_GetValue( *m_pHeightMF, eUnit );
aSz.SetSize( aTmpSz ); aSz.SetSize( aTmpSz );
aWidthMF.SaveValue(); m_pWidthMF->SaveValue();
aHeightMF.SaveValue(); m_pHeightMF->SaveValue();
bModified |= 0 != rSet.Put( aSz ); bModified |= 0 != rSet.Put( aSz );
...@@ -279,25 +269,25 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet) ...@@ -279,25 +269,25 @@ sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet)
SID_ATTR_GRAF_FRMSIZE_PERCENT ), Size( 0, 0 )) ); SID_ATTR_GRAF_FRMSIZE_PERCENT ), Size( 0, 0 )) );
} }
} }
if( aLeftMF.IsModified() || aRightMF.IsModified() || if( m_pLeftMF->IsModified() || m_pRightMF->IsModified() ||
aTopMF.IsModified() || aBottomMF.IsModified() ) m_pTopMF->IsModified() || m_pBottomMF->IsModified() )
{ {
sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP ); sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
SvxGrfCrop* pNew = (SvxGrfCrop*)rSet.Get( nW ).Clone(); SvxGrfCrop* pNew = (SvxGrfCrop*)rSet.Get( nW ).Clone();
pNew->SetLeft( lcl_GetValue( aLeftMF, eUnit ) ); pNew->SetLeft( lcl_GetValue( *m_pLeftMF, eUnit ) );
pNew->SetRight( lcl_GetValue( aRightMF, eUnit ) ); pNew->SetRight( lcl_GetValue( *m_pRightMF, eUnit ) );
pNew->SetTop( lcl_GetValue( aTopMF, eUnit ) ); pNew->SetTop( lcl_GetValue( *m_pTopMF, eUnit ) );
pNew->SetBottom( lcl_GetValue( aBottomMF, eUnit ) ); pNew->SetBottom( lcl_GetValue( *m_pBottomMF, eUnit ) );
bModified |= 0 != rSet.Put( *pNew ); bModified |= 0 != rSet.Put( *pNew );
delete pNew; delete pNew;
} }
if( aZoomConstRB.GetSavedValue() != aZoomConstRB.IsChecked() ) if( m_pZoomConstRB->GetSavedValue() != m_pZoomConstRB->IsChecked() )
{ {
bModified |= 0 != rSet.Put( SfxBoolItem( rPool.GetWhich( bModified |= 0 != rSet.Put( SfxBoolItem( rPool.GetWhich(
SID_ATTR_GRAF_KEEP_ZOOM), aZoomConstRB.IsChecked() ) ); SID_ATTR_GRAF_KEEP_ZOOM), m_pZoomConstRB->IsChecked() ) );
} }
bInitialized = sal_False; bInitialized = sal_False;
...@@ -323,34 +313,34 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet) ...@@ -323,34 +313,34 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
nOldWidth = aSize.Width(); nOldWidth = aSize.Width();
nOldHeight = aSize.Height(); nOldHeight = aSize.Height();
sal_Int64 nWidth = aWidthMF.Normalize(nOldWidth); sal_Int64 nWidth = m_pWidthMF->Normalize(nOldWidth);
sal_Int64 nHeight = aHeightMF.Normalize(nOldHeight); sal_Int64 nHeight = m_pHeightMF->Normalize(nOldHeight);
if (nWidth != aWidthMF.GetValue(FUNIT_TWIP)) if (nWidth != m_pWidthMF->GetValue(FUNIT_TWIP))
{ {
if(!bReset) if(!bReset)
{ {
// value was changed by wrap-tabpage and has to // value was changed by wrap-tabpage and has to
// be set with modify-flag // be set with modify-flag
aWidthMF.SetUserValue(nWidth, FUNIT_TWIP); m_pWidthMF->SetUserValue(nWidth, FUNIT_TWIP);
} }
else else
aWidthMF.SetValue(nWidth, FUNIT_TWIP); m_pWidthMF->SetValue(nWidth, FUNIT_TWIP);
} }
aWidthMF.SaveValue(); m_pWidthMF->SaveValue();
if (nHeight != aHeightMF.GetValue(FUNIT_TWIP)) if (nHeight != m_pHeightMF->GetValue(FUNIT_TWIP))
{ {
if (!bReset) if (!bReset)
{ {
// value was changed by wrap-tabpage and has to // value was changed by wrap-tabpage and has to
// be set with modify-flag // be set with modify-flag
aHeightMF.SetUserValue(nHeight, FUNIT_TWIP); m_pHeightMF->SetUserValue(nHeight, FUNIT_TWIP);
} }
else else
aHeightMF.SetValue(nHeight, FUNIT_TWIP); m_pHeightMF->SetValue(nHeight, FUNIT_TWIP);
} }
aHeightMF.SaveValue(); m_pHeightMF->SaveValue();
bInitialized = sal_True; bInitialized = sal_True;
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_False, &pItem ) ) if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_False, &pItem ) )
...@@ -369,13 +359,13 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet) ...@@ -369,13 +359,13 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
const Graphic* pGrf = rBrush.GetGraphic(referer); const Graphic* pGrf = rBrush.GetGraphic(referer);
if( pGrf ) if( pGrf )
{ {
aExampleWN.SetGraphic( *pGrf ); m_pExampleWN->SetGraphic( *pGrf );
aOrigSize = GetGrfOrigSize( *pGrf ); aOrigSize = GetGrfOrigSize( *pGrf );
if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() > 1 && aOrigSize.Height() > 1) { if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() > 1 && aOrigSize.Height() > 1) {
Bitmap aBitmap = pGrf->GetBitmap(); Bitmap aBitmap = pGrf->GetBitmap();
aOrigPixelSize = aBitmap.GetSizePixel(); aOrigPixelSize = aBitmap.GetSizePixel();
} }
aExampleWN.SetFrameSize(aOrigSize); m_pExampleWN->SetFrameSize(aOrigSize);
GraphicHasChanged( aOrigSize.Width() && aOrigSize.Height() ); GraphicHasChanged( aOrigSize.Width() && aOrigSize.Height() );
CalcMinMaxBorder(); CalcMinMaxBorder();
} }
...@@ -404,19 +394,19 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField ) ...@@ -404,19 +394,19 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField )
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
if( pField == &aWidthZoomMF ) if( pField == m_pWidthZoomMF )
{ {
long nLRBorders = lcl_GetValue(aLeftMF, eUnit) long nLRBorders = lcl_GetValue(*m_pLeftMF, eUnit)
+lcl_GetValue(aRightMF, eUnit); +lcl_GetValue(*m_pRightMF, eUnit);
aWidthMF.SetValue( aWidthMF.Normalize( m_pWidthMF->SetValue( m_pWidthMF->Normalize(
((aOrigSize.Width() - nLRBorders) * pField->GetValue())/100L), ((aOrigSize.Width() - nLRBorders) * pField->GetValue())/100L),
eUnit); eUnit);
} }
else else
{ {
long nULBorders = lcl_GetValue(aTopMF, eUnit) long nULBorders = lcl_GetValue(*m_pTopMF, eUnit)
+lcl_GetValue(aBottomMF, eUnit); +lcl_GetValue(*m_pBottomMF, eUnit);
aHeightMF.SetValue( aHeightMF.Normalize( m_pHeightMF->SetValue( m_pHeightMF->Normalize(
((aOrigSize.Height() - nULBorders ) * pField->GetValue())/100L) , ((aOrigSize.Height() - nULBorders ) * pField->GetValue())/100L) ,
eUnit ); eUnit );
} }
...@@ -435,28 +425,28 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField ) ...@@ -435,28 +425,28 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField )
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
Size aSize( lcl_GetValue(aWidthMF, eUnit), Size aSize( lcl_GetValue(*m_pWidthMF, eUnit),
lcl_GetValue(aHeightMF, eUnit) ); lcl_GetValue(*m_pHeightMF, eUnit) );
if(pField == &aWidthMF) if(pField == m_pWidthMF)
{ {
long nWidth = aOrigSize.Width() - long nWidth = aOrigSize.Width() -
( lcl_GetValue(aLeftMF, eUnit) + ( lcl_GetValue(*m_pLeftMF, eUnit) +
lcl_GetValue(aRightMF, eUnit) ); lcl_GetValue(*m_pRightMF, eUnit) );
if(!nWidth) if(!nWidth)
nWidth++; nWidth++;
sal_uInt16 nZoom = (sal_uInt16)( aSize.Width() * 100L / nWidth); sal_uInt16 nZoom = (sal_uInt16)( aSize.Width() * 100L / nWidth);
aWidthZoomMF.SetValue(nZoom); m_pWidthZoomMF->SetValue(nZoom);
} }
else else
{ {
long nHeight = aOrigSize.Height() - long nHeight = aOrigSize.Height() -
( lcl_GetValue(aTopMF, eUnit) + ( lcl_GetValue(*m_pTopMF, eUnit) +
lcl_GetValue(aBottomMF, eUnit)); lcl_GetValue(*m_pBottomMF, eUnit));
if(!nHeight) if(!nHeight)
nHeight++; nHeight++;
sal_uInt16 nZoom = (sal_uInt16)( aSize.Height() * 100L/ nHeight); sal_uInt16 nZoom = (sal_uInt16)( aSize.Height() * 100L/ nHeight);
aHeightZoomMF.SetValue(nZoom); m_pHeightZoomMF->SetValue(nZoom);
} }
return 0; return 0;
...@@ -473,66 +463,66 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField ) ...@@ -473,66 +463,66 @@ IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
sal_Bool bZoom = aZoomConstRB.IsChecked(); sal_Bool bZoom = m_pZoomConstRB->IsChecked();
if( pField == &aLeftMF || pField == &aRightMF ) if( pField == m_pLeftMF || pField == m_pRightMF )
{ {
long nLeft = lcl_GetValue( aLeftMF, eUnit ); long nLeft = lcl_GetValue( *m_pLeftMF, eUnit );
long nRight = lcl_GetValue( aRightMF, eUnit ); long nRight = lcl_GetValue( *m_pRightMF, eUnit );
long nWidthZoom = static_cast<long>(aWidthZoomMF.GetValue()); long nWidthZoom = static_cast<long>(m_pWidthZoomMF->GetValue());
if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom ) if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
/ 100 >= aPageSize.Width() ) ) / 100 >= aPageSize.Width() ) )
{ {
if(pField == &aLeftMF) if(pField == m_pLeftMF)
{ {
nLeft = aOrigSize.Width() - nLeft = aOrigSize.Width() -
( aPageSize.Width() * 100 / nWidthZoom + nRight ); ( aPageSize.Width() * 100 / nWidthZoom + nRight );
aLeftMF.SetValue( aLeftMF.Normalize( nLeft ), eUnit ); m_pLeftMF->SetValue( m_pLeftMF->Normalize( nLeft ), eUnit );
} }
else else
{ {
nRight = aOrigSize.Width() - nRight = aOrigSize.Width() -
( aPageSize.Width() * 100 / nWidthZoom + nLeft ); ( aPageSize.Width() * 100 / nWidthZoom + nLeft );
aRightMF.SetValue( aRightMF.Normalize( nRight ), eUnit ); m_pRightMF->SetValue( m_pRightMF->Normalize( nRight ), eUnit );
} }
} }
aExampleWN.SetLeft(nLeft); m_pExampleWN->SetLeft(nLeft);
aExampleWN.SetRight(nRight); m_pExampleWN->SetRight(nRight);
if(bZoom) if(bZoom)
{ {
// scale stays, recompute width // scale stays, recompute width
ZoomHdl(&aWidthZoomMF); ZoomHdl(m_pWidthZoomMF);
} }
} }
else else
{ {
long nTop = lcl_GetValue( aTopMF, eUnit ); long nTop = lcl_GetValue( *m_pTopMF, eUnit );
long nBottom = lcl_GetValue( aBottomMF, eUnit ); long nBottom = lcl_GetValue( *m_pBottomMF, eUnit );
long nHeightZoom = static_cast<long>(aHeightZoomMF.GetValue()); long nHeightZoom = static_cast<long>(m_pHeightZoomMF->GetValue());
if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom) if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom)
/ 100 >= aPageSize.Height())) / 100 >= aPageSize.Height()))
{ {
if(pField == &aTopMF) if(pField == m_pTopMF)
{ {
nTop = aOrigSize.Height() - nTop = aOrigSize.Height() -
( aPageSize.Height() * 100 / nHeightZoom + nBottom); ( aPageSize.Height() * 100 / nHeightZoom + nBottom);
aTopMF.SetValue( aWidthMF.Normalize( nTop ), eUnit ); m_pTopMF->SetValue( m_pWidthMF->Normalize( nTop ), eUnit );
} }
else else
{ {
nBottom = aOrigSize.Height() - nBottom = aOrigSize.Height() -
( aPageSize.Height() * 100 / nHeightZoom + nTop); ( aPageSize.Height() * 100 / nHeightZoom + nTop);
aBottomMF.SetValue( aWidthMF.Normalize( nBottom ), eUnit ); m_pBottomMF->SetValue( m_pWidthMF->Normalize( nBottom ), eUnit );
} }
} }
aExampleWN.SetTop( nTop ); m_pExampleWN->SetTop( nTop );
aExampleWN.SetBottom( nBottom ); m_pExampleWN->SetBottom( nBottom );
if(bZoom) if(bZoom)
{ {
// scale stays, recompute height // scale stays, recompute height
ZoomHdl(&aHeightZoomMF); ZoomHdl(m_pHeightZoomMF);
} }
} }
aExampleWN.Invalidate(); m_pExampleWN->Invalidate();
// size and border changed -> recompute scale // size and border changed -> recompute scale
if(!bZoom) if(!bZoom)
CalcZoom(); CalcZoom();
...@@ -551,15 +541,15 @@ IMPL_LINK_NOARG(SvxGrfCropPage, OrigSizeHdl) ...@@ -551,15 +541,15 @@ IMPL_LINK_NOARG(SvxGrfCropPage, OrigSizeHdl)
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
long nWidth = aOrigSize.Width() - long nWidth = aOrigSize.Width() -
lcl_GetValue( aLeftMF, eUnit ) - lcl_GetValue( *m_pLeftMF, eUnit ) -
lcl_GetValue( aRightMF, eUnit ); lcl_GetValue( *m_pRightMF, eUnit );
aWidthMF.SetValue( aWidthMF.Normalize( nWidth ), eUnit ); m_pWidthMF->SetValue( m_pWidthMF->Normalize( nWidth ), eUnit );
long nHeight = aOrigSize.Height() - long nHeight = aOrigSize.Height() -
lcl_GetValue( aTopMF, eUnit ) - lcl_GetValue( *m_pTopMF, eUnit ) -
lcl_GetValue( aBottomMF, eUnit ); lcl_GetValue( *m_pBottomMF, eUnit );
aHeightMF.SetValue( aHeightMF.Normalize( nHeight ), eUnit ); m_pHeightMF->SetValue( m_pHeightMF->Normalize( nHeight ), eUnit );
aWidthZoomMF.SetValue(100); m_pWidthZoomMF->SetValue(100);
aHeightZoomMF.SetValue(100); m_pHeightZoomMF->SetValue(100);
bSetOrigSize = sal_True; bSetOrigSize = sal_True;
return 0; return 0;
} }
...@@ -574,22 +564,22 @@ void SvxGrfCropPage::CalcZoom() ...@@ -574,22 +564,22 @@ void SvxGrfCropPage::CalcZoom()
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
long nWidth = lcl_GetValue( aWidthMF, eUnit ); long nWidth = lcl_GetValue( *m_pWidthMF, eUnit );
long nHeight = lcl_GetValue( aHeightMF, eUnit ); long nHeight = lcl_GetValue( *m_pHeightMF, eUnit );
long nLRBorders = lcl_GetValue( aLeftMF, eUnit ) + long nLRBorders = lcl_GetValue( *m_pLeftMF, eUnit ) +
lcl_GetValue( aRightMF, eUnit ); lcl_GetValue( *m_pRightMF, eUnit );
long nULBorders = lcl_GetValue( aTopMF, eUnit ) + long nULBorders = lcl_GetValue( *m_pTopMF, eUnit ) +
lcl_GetValue( aBottomMF, eUnit ); lcl_GetValue( *m_pBottomMF, eUnit );
sal_uInt16 nZoom = 0; sal_uInt16 nZoom = 0;
long nDen; long nDen;
if( (nDen = aOrigSize.Width() - nLRBorders) > 0) if( (nDen = aOrigSize.Width() - nLRBorders) > 0)
nZoom = (sal_uInt16)((( nWidth * 1000L / nDen )+5)/10); nZoom = (sal_uInt16)((( nWidth * 1000L / nDen )+5)/10);
aWidthZoomMF.SetValue(nZoom); m_pWidthZoomMF->SetValue(nZoom);
if( (nDen = aOrigSize.Height() - nULBorders) > 0) if( (nDen = aOrigSize.Height() - nULBorders) > 0)
nZoom = (sal_uInt16)((( nHeight * 1000L / nDen )+5)/10); nZoom = (sal_uInt16)((( nHeight * 1000L / nDen )+5)/10);
else else
nZoom = 0; nZoom = 0;
aHeightZoomMF.SetValue(nZoom); m_pHeightZoomMF->SetValue(nZoom);
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -602,23 +592,23 @@ void SvxGrfCropPage::CalcMinMaxBorder() ...@@ -602,23 +592,23 @@ void SvxGrfCropPage::CalcMinMaxBorder()
DBG_ASSERT( pPool, "Wo ist der Pool" ); DBG_ASSERT( pPool, "Wo ist der Pool" );
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) ) ); SID_ATTR_GRAF_CROP ) ) );
long nR = lcl_GetValue(aRightMF, eUnit ); long nR = lcl_GetValue(*m_pRightMF, eUnit );
long nMinWidth = (aOrigSize.Width() * 10) /11; long nMinWidth = (aOrigSize.Width() * 10) /11;
long nMin = nMinWidth - (nR >= 0 ? nR : 0); long nMin = nMinWidth - (nR >= 0 ? nR : 0);
aLeftMF.SetMax( aLeftMF.Normalize(nMin), eUnit ); m_pLeftMF->SetMax( m_pLeftMF->Normalize(nMin), eUnit );
long nL = lcl_GetValue(aLeftMF, eUnit ); long nL = lcl_GetValue(*m_pLeftMF, eUnit );
nMin = nMinWidth - (nL >= 0 ? nL : 0); nMin = nMinWidth - (nL >= 0 ? nL : 0);
aRightMF.SetMax( aRightMF.Normalize(nMin), eUnit ); m_pRightMF->SetMax( m_pRightMF->Normalize(nMin), eUnit );
long nUp = lcl_GetValue( aTopMF, eUnit ); long nUp = lcl_GetValue( *m_pTopMF, eUnit );
long nMinHeight = (aOrigSize.Height() * 10) /11; long nMinHeight = (aOrigSize.Height() * 10) /11;
nMin = nMinHeight - (nUp >= 0 ? nUp : 0); nMin = nMinHeight - (nUp >= 0 ? nUp : 0);
aBottomMF.SetMax( aBottomMF.Normalize(nMin), eUnit ); m_pBottomMF->SetMax( m_pBottomMF->Normalize(nMin), eUnit );
long nLow = lcl_GetValue(aBottomMF, eUnit ); long nLow = lcl_GetValue(*m_pBottomMF, eUnit );
nMin = nMinHeight - (nLow >= 0 ? nLow : 0); nMin = nMinHeight - (nLow >= 0 ? nLow : 0);
aTopMF.SetMax( aTopMF.Normalize(nMin), eUnit ); m_pTopMF->SetMax( m_pTopMF->Normalize(nMin), eUnit );
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
description: set spinsize to 1/20 of the original size, description: set spinsize to 1/20 of the original size,
...@@ -634,46 +624,46 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound ) ...@@ -634,46 +624,46 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound )
FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
SID_ATTR_GRAF_CROP ) )); SID_ATTR_GRAF_CROP ) ));
sal_Int64 nSpin = aLeftMF.Normalize(aOrigSize.Width()) / 20; sal_Int64 nSpin = m_pLeftMF->Normalize(aOrigSize.Width()) / 20;
nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0, nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0,
eUnit, aLeftMF.GetUnit()); eUnit, m_pLeftMF->GetUnit());
// if the margin is too big, it is set to 1/3 on both pages // if the margin is too big, it is set to 1/3 on both pages
long nR = lcl_GetValue( aRightMF, eUnit ); long nR = lcl_GetValue( *m_pRightMF, eUnit );
long nL = lcl_GetValue( aLeftMF, eUnit ); long nL = lcl_GetValue( *m_pLeftMF, eUnit );
if((nL + nR) < - aOrigSize.Width()) if((nL + nR) < - aOrigSize.Width())
{ {
long nVal = aOrigSize.Width() / -3; long nVal = aOrigSize.Width() / -3;
aRightMF.SetValue( aRightMF.Normalize( nVal ), eUnit ); m_pRightMF->SetValue( m_pRightMF->Normalize( nVal ), eUnit );
aLeftMF.SetValue( aLeftMF.Normalize( nVal ), eUnit ); m_pLeftMF->SetValue( m_pLeftMF->Normalize( nVal ), eUnit );
aExampleWN.SetLeft(nVal); m_pExampleWN->SetLeft(nVal);
aExampleWN.SetRight(nVal); m_pExampleWN->SetRight(nVal);
} }
long nUp = lcl_GetValue(aTopMF, eUnit ); long nUp = lcl_GetValue(*m_pTopMF, eUnit );
long nLow = lcl_GetValue(aBottomMF, eUnit ); long nLow = lcl_GetValue(*m_pBottomMF, eUnit );
if((nUp + nLow) < - aOrigSize.Height()) if((nUp + nLow) < - aOrigSize.Height())
{ {
long nVal = aOrigSize.Height() / -3; long nVal = aOrigSize.Height() / -3;
aTopMF.SetValue( aTopMF.Normalize( nVal ), eUnit ); m_pTopMF->SetValue( m_pTopMF->Normalize( nVal ), eUnit );
aBottomMF.SetValue( aBottomMF.Normalize( nVal ), eUnit ); m_pBottomMF->SetValue( m_pBottomMF->Normalize( nVal ), eUnit );
aExampleWN.SetTop(nVal); m_pExampleWN->SetTop(nVal);
aExampleWN.SetBottom(nVal); m_pExampleWN->SetBottom(nVal);
} }
aLeftMF.SetSpinSize(nSpin); m_pLeftMF->SetSpinSize(nSpin);
aRightMF.SetSpinSize(nSpin); m_pRightMF->SetSpinSize(nSpin);
nSpin = aTopMF.Normalize(aOrigSize.Height()) / 20; nSpin = m_pTopMF->Normalize(aOrigSize.Height()) / 20;
nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0, nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0,
eUnit, aLeftMF.GetUnit() ); eUnit, m_pLeftMF->GetUnit() );
aTopMF.SetSpinSize(nSpin); m_pTopMF->SetSpinSize(nSpin);
aBottomMF.SetSpinSize(nSpin); m_pBottomMF->SetSpinSize(nSpin);
// display original size // display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() ); const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
MetricField aFld(this, WB_HIDE); MetricField aFld(this, WB_HIDE);
SetFieldUnit( aFld, eMetric ); SetFieldUnit( aFld, eMetric );
aFld.SetDecimalDigits( aWidthMF.GetDecimalDigits() ); aFld.SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
aFld.SetMax( LONG_MAX - 1 ); aFld.SetMax( LONG_MAX - 1 );
aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit ); aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
...@@ -689,7 +679,7 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound ) ...@@ -689,7 +679,7 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound )
sal_Int32 ay = sal_Int32(floor((float)aOrigPixelSize.Height() / sal_Int32 ay = sal_Int32(floor((float)aOrigPixelSize.Height() /
((float)aOrigSize.Height()/TWIP_TO_INCH)+0.5)); ((float)aOrigSize.Height()/TWIP_TO_INCH)+0.5));
sTemp += " "; sTemp += " ";
sTemp += CUI_RESSTR( STR_PPI ); sTemp += CUI_RESSTR( RID_SVXSTR_PPI );
OUString sPPI = OUString::number(ax); OUString sPPI = OUString::number(ax);
if (abs(ax - ay) > 1) { if (abs(ax - ay) > 1) {
sPPI += OUString( sal_Unicode (0x00D7) ); sPPI += OUString( sal_Unicode (0x00D7) );
...@@ -697,29 +687,14 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound ) ...@@ -697,29 +687,14 @@ void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound )
} }
sTemp = sTemp.replaceAll("%1", sPPI); sTemp = sTemp.replaceAll("%1", sPPI);
} }
aOrigSizeFT.SetText( sTemp ); m_pOrigSizeFT->SetText( sTemp );
} }
aLeftFT .Enable(bFound);
aLeftMF .Enable(bFound); m_pCropFrame->Enable(bFound);
aRightFT .Enable(bFound); m_pScaleFrame->Enable(bFound);
aRightMF .Enable(bFound); m_pSizeFrame->Enable(bFound);
aTopFT .Enable(bFound); m_pOrigSizeGrid->Enable(bFound);
aTopMF .Enable(bFound); m_pZoomConstRB->Enable(bFound);
aBottomFT .Enable(bFound);
aBottomMF .Enable(bFound);
aSizeConstRB .Enable(bFound);
aZoomConstRB .Enable(bFound);
aWidthFT .Enable(bFound);
aWidthMF .Enable(bFound);
aHeightFT .Enable(bFound);
aHeightMF .Enable(bFound);
aWidthZoomFT .Enable(bFound);
aWidthZoomMF .Enable(bFound);
aHeightZoomFT .Enable(bFound);
aHeightZoomMF .Enable(bFound);
aExampleWN .Enable(bFound);
aOrigSizePB .Enable(bFound);
aOrigSizeFT .Enable(bFound);
} }
IMPL_LINK_NOARG(SvxGrfCropPage, Timeout) IMPL_LINK_NOARG(SvxGrfCropPage, Timeout)
...@@ -761,18 +736,32 @@ Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const ...@@ -761,18 +736,32 @@ Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const
/*****************************************************************/ /*****************************************************************/
SvxGrfCropPage::SvxCropExample::SvxCropExample( Window* pPar, SvxCropExample::SvxCropExample( Window* pPar, WinBits nStyle )
const ResId& rResId ) : Window( pPar, nStyle)
: Window( pPar, rResId ), , aFrameSize( OutputDevice::LogicToLogic(
aFrameSize( OutputDevice::LogicToLogic(
Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ), Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ),
MapMode( MAP_TWIP ), GetMapMode() )), MapMode( MAP_TWIP ), GetMapMode() ))
aTopLeft(0,0), aBottomRight(0,0) , aTopLeft(0,0)
, aBottomRight(0,0)
{ {
SetBorderStyle( WINDOW_BORDER_MONO ); SetBorderStyle( WINDOW_BORDER_MONO );
} }
void SvxGrfCropPage::SvxCropExample::Paint( const Rectangle& ) Size SvxCropExample::GetOptimalSize() const
{
return LogicToPixel(Size(78, 78), MAP_APPFONT);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxCropExample(Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = 0;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
return new SvxCropExample(pParent, nWinStyle);
}
void SvxCropExample::Paint( const Rectangle& )
{ {
Size aWinSize( PixelToLogic(GetOutputSizePixel() )); Size aWinSize( PixelToLogic(GetOutputSizePixel() ));
SetLineColor(); SetLineColor();
...@@ -797,7 +786,7 @@ void SvxGrfCropPage::SvxCropExample::Paint( const Rectangle& ) ...@@ -797,7 +786,7 @@ void SvxGrfCropPage::SvxCropExample::Paint( const Rectangle& )
DrawRect( aRect ); DrawRect( aRect );
} }
void SvxGrfCropPage::SvxCropExample::SetFrameSize( const Size& rSz ) void SvxCropExample::SetFrameSize( const Size& rSz )
{ {
aFrameSize = rSz; aFrameSize = rSz;
if(!aFrameSize.Width()) if(!aFrameSize.Width())
......
/* -*- 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 FT_BOTTOM 1
#define FT_HEIGHT 2
#define FT_HEIGHTZOOM 3
#define FT_LEFT 4
#define FT_ORIG_SIZE 5
#define FT_RIGHT 6
#define FT_TOP 7
#define FT_WIDTH 8
#define FT_WIDTHZOOM 9
#define FL_CROP 10
#define FL_SIZE 12
#define FL_ZOOM 13
#define MF_BOTTOM 14
#define MF_HEIGHT 15
#define MF_HEIGHTZOOM 16
#define MF_LEFT 17
#define MF_RIGHT 18
#define MF_TOP 19
#define MF_WIDTH 20
#define MF_WIDTHZOOM 21
#define PB_ORGSIZE 22
#define RB_SIZECONST 23
#define RB_ZOOMCONST 24
#define WN_BSP 25
#define STR_PPI 2600
/* 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 "helpid.hrc"
#include "grfpage.hrc"
#include <svx/dialogs.hrc>
/************************************************************/
/* */
/* */
/* Crop-Page */
/* */
/* */
/************************************************************/
TabPage RID_SVXPAGE_GRFCROP
{
Hide = TRUE ;
HelpID = HID_SVXPAGE_GRFCROP;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedLine FL_CROP
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text [ en-US ] = "Crop" ;
};
FixedText FT_LEFT
{
Pos = MAP_APPFONT ( 12 , 44 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "~Left" ;
};
MetricField MF_LEFT
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_LEFT";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 42 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Text = "12,99" ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = -9999 ;
Maximum = 9999 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 0 ;
Last = 9999 ;
SpinSize = 10 ;
};
FixedText FT_RIGHT
{
Pos = MAP_APPFONT ( 12 , 60 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "~Right" ;
};
MetricField MF_RIGHT
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_RIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 58 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = -9999 ;
Maximum = 9999 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 0 ;
Last = 9999 ;
SpinSize = 10 ;
};
FixedText FT_TOP
{
Pos = MAP_APPFONT ( 94 , 44 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "~Top" ;
};
MetricField MF_TOP
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_TOP";
Border = TRUE ;
Pos = MAP_APPFONT ( 124 , 42 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Text = "12,99" ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = -9999 ;
Maximum = 9999 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 0 ;
Last = 9999 ;
SpinSize = 10 ;
};
FixedText FT_BOTTOM
{
Pos = MAP_APPFONT ( 94 , 60 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "~Bottom" ;
};
MetricField MF_BOTTOM
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_BOTTOM";
Border = TRUE ;
Pos = MAP_APPFONT ( 124 , 58 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = -9999 ;
Maximum = 9999 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 0 ;
Last = 9999 ;
SpinSize = 10 ;
};
RadioButton RB_SIZECONST
{
HelpID = "cui:RadioButton:RID_SVXPAGE_GRFCROP:RB_SIZECONST";
Pos = MAP_APPFONT ( 12 , 28 ) ;
Size = MAP_APPFONT ( 152 , 10 ) ;
Text [ en-US ] = "Keep image si~ze" ;
};
RadioButton RB_ZOOMCONST
{
HelpID = "cui:RadioButton:RID_SVXPAGE_GRFCROP:RB_ZOOMCONST";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 152 , 10 ) ;
Check = TRUE ;
Text [ en-US ] = "Keep ~scale" ;
};
Window WN_BSP
{
Pos = MAP_APPFONT ( 176 , 6 ) ;
Size = MAP_APPFONT ( 78 , 78 ) ;
Border = TRUE ;
};
FixedLine FL_ZOOM
{
Pos = MAP_APPFONT ( 6, 76 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text [ en-US ] = "Scale" ;
};
FixedText FT_WIDTHZOOM
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 89 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "~Width" ;
};
MetricField MF_WIDTHZOOM
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_WIDTHZOOM";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 87 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Text = "12,99" ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 9999 ;
First = 5 ;
Last = 1000 ;
Maximum = 9999 ;
Value = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 10 ;
};
FixedText FT_HEIGHTZOOM
{
Pos = MAP_APPFONT ( 12 , 105 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Text [ en-US ] = "H~eight" ;
Left = TRUE ;
};
MetricField MF_HEIGHTZOOM
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_HEIGHTZOOM";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 103 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 9999 ;
First = 5 ;
Last = 1000 ;
Maximum = 9999 ;
Value = 100 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 10 ;
};
FixedLine FL_SIZE
{
Pos = MAP_APPFONT ( 6 , 121 ) ;
Size = MAP_APPFONT ( 164 , 8 ) ;
Text [ en-US ] = "Image size" ;
};
FixedText FT_WIDTH
{
Pos = MAP_APPFONT ( 12 , 134 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "~Width" ;
};
MetricField MF_WIDTH
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_WIDTH";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 132 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Text = "12,99" ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 20000 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 5 ;
Last = 20000 ;
SpinSize = 10 ;
};
FixedText FT_HEIGHT
{
Pos = MAP_APPFONT ( 12 , 150 ) ;
Size = MAP_APPFONT ( 28 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "H~eight" ;
};
MetricField MF_HEIGHT
{
HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_HEIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 148 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 20000 ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
First = 5 ;
Last = 20000 ;
SpinSize = 10 ;
};
FixedText FT_ORIG_SIZE
{
Pos = MAP_APPFONT ( 176 , 132 ) ;
Size = MAP_APPFONT ( 74 , 8 ) ;
};
PushButton PB_ORGSIZE
{
HelpID = "cui:PushButton:RID_SVXPAGE_GRFCROP:PB_ORGSIZE";
Pos = MAP_APPFONT ( 176 , 143 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Original Size" ;
};
};
String STR_PPI
{
Text [ x-comment ] = "PPI is pixel per inch, %1 is a number" ;
Text [ en-US ] = "(%1 PPI)" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">-99.989999999999995</property>
<property name="upper">99.989999999999995</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="lower">1</property>
<property name="upper">9999</property>
<property name="value">100</property>
<property name="step_increment">10</property>
<property name="page_increment">100</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="lower">0.050000000000000003</property>
<property name="upper">200</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkGrid" id="CropPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<property name="column_spacing">18</property>
<child>
<object class="GtkFrame" id="cropframe">
<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="alignment4">
<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="grid10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">18</property>
<child>
<object class="GtkRadioButton" id="keepscale">
<property name="label" translatable="yes">Keep _scale</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">keepsize</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="keepsize">
<property name="label" translatable="yes">Keep image si_ze</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">keepscale</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<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="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Left</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">left:0.00cm</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="GtkSpinButton" id="left:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</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="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Right</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">right:0.00cm</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="GtkSpinButton" id="right:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</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>
</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="GtkGrid" id="grid2">
<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="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Top</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">top:0.00cm</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="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Bottom</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">bottom:0.00cm</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="GtkSpinButton" id="top:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</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="bottom:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</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>
</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>
</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="label" translatable="yes">Crop</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</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="GtkFrame" id="scaleframe">
<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="grid4">
<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="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Width</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">widthzoom:0%</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="GtkSpinButton" id="widthzoom:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment2</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="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Height</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">heightzoom:0%</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="GtkSpinButton" id="heightzoom:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment2</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>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Scale</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</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="GtkFrame" id="sizeframe">
<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="GtkGrid" id="grid3">
<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="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Width</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">width:0.00cm</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="GtkSpinButton" id="width:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment3</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="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Height</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">height:0.00cm</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="GtkSpinButton" id="height:0.00cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment3</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>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Image size</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</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="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="cuilo-SvxCropExample" id="preview:border">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="hexpand">True</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="GtkGrid" id="origsizegrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">end</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="origsizeft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">origsize</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="GtkButton" id="origsize">
<property name="label" translatable="yes">_Original Size</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</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>
</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>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">3</property>
</packing>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="label2"/>
<widget name="label3"/>
<widget name="label4"/>
<widget name="label5"/>
<widget name="label6"/>
<widget name="label7"/>
<widget name="label8"/>
<widget name="label9"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup2">
<widgets>
<widget name="left:0.00cm"/>
<widget name="right:0.00cm"/>
<widget name="top:0.00cm"/>
<widget name="bottom:0.00cm"/>
<widget name="widthzoom:0%"/>
<widget name="heightzoom:0%"/>
<widget name="width:0.00cm"/>
<widget name="height:0.00cm"/>
</widgets>
</object>
</interface>
...@@ -543,6 +543,10 @@ ...@@ -543,6 +543,10 @@
generic-name="ClientBox" parent="GtkDrawingArea" generic-name="ClientBox" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="CropExample" name="cuilo-SvxCropExample"
generic-name="CropExample" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView" <glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView"
generic-name="Icon View" parent="GtkIconView" generic-name="Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/> icon-name="widget-gtk-iconview"/>
......
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