summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-31 16:37:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-31 21:21:38 +0000
commitc8cae05ee8cfa0742865224b31d344317ceb996f (patch)
treeba53827d2df5b6616bd6ee29d44c54ec4b7db7d8 /cui/source
parente70fb08305fdb3ad54c17f979c64996a7f043dcd (diff)
convert solarize dialog to .ui
Change-Id: I1aab18d8e0aa12d39584266a6657436ea100b521
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx25
-rw-r--r--cui/source/dialogs/grfflt.hrc8
-rw-r--r--cui/source/dialogs/grfflt.src82
-rw-r--r--cui/source/factory/dlgfact.cxx6
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/cuigrfflt.hxx17
6 files changed, 20 insertions, 120 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index ccf12762b604..9c0bd8a8807f 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -421,25 +421,18 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
// ------------------
GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
- sal_uInt8 cGreyThreshold, sal_Bool bInvert ) :
- oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
- maFtThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
- maMtrThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
- maCbxInvert ( this, CUI_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
+ sal_uInt8 cGreyThreshold, sal_Bool bInvert )
+ : GraphicFilterDialog(pParent, "SolarizeDialog",
+ "cui/ui/solarizedialog.ui", rGraphic)
{
- FreeResource();
-
- maMtrThreshold.SetValue( FRound( cGreyThreshold / 2.55 ) );
- maMtrThreshold.SetModifyHdl( GetModifyHdl() );
-
- maCbxInvert.Check( bInvert );
- maCbxInvert.SetToggleHdl( GetModifyHdl() );
-}
+ get(mpMtrThreshold, "value");
+ get(mpCbxInvert, "invert");
-// -----------------------------------------------------------------------------
+ mpMtrThreshold->SetValue( FRound( cGreyThreshold / 2.55 ) );
+ mpMtrThreshold->SetModifyHdl( GetModifyHdl() );
-GraphicFilterSolarize::~GraphicFilterSolarize()
-{
+ mpCbxInvert->Check( bInvert );
+ mpCbxInvert->SetToggleHdl( GetModifyHdl() );
}
// -----------------------------------------------------------------------------
diff --git a/cui/source/dialogs/grfflt.hrc b/cui/source/dialogs/grfflt.hrc
index da6abb3fe07c..5b820147987b 100644
--- a/cui/source/dialogs/grfflt.hrc
+++ b/cui/source/dialogs/grfflt.hrc
@@ -40,14 +40,6 @@
#define DLG_FILTERMOSAIC_MTR_HEIGHT 4
#define DLG_FILTERMOSAIC_CBX_EDGES 5
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-#define DLG_FILTERSOLARIZE_FT_THRESHOLD 1
-#define DLG_FILTERSOLARIZE_MTR_THRESHOLD 2
-#define DLG_FILTERSOLARIZE_CBX_INVERT 3
-
// -------------------
// - DLG_FILTERSEPIA -
// -------------------
diff --git a/cui/source/dialogs/grfflt.src b/cui/source/dialogs/grfflt.src
index 23192ecd8601..4b34f9011c84 100644
--- a/cui/source/dialogs/grfflt.src
+++ b/cui/source/dialogs/grfflt.src
@@ -130,88 +130,6 @@ ModalDialog RID_SVX_GRFFILTER_DLG_MOSAIC
};
};
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_SOLARIZE
-{
- HelpID = CMD_SID_GRFFILTER_SOLARIZE;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Solarization" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y5 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERSOLARIZE_FT_THRESHOLD
- {
- Pos = MAP_APPFONT ( 12, MA_Y5 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Threshold ~value" ;
- };
-#define MA_Y6 MA_Y5 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERSOLARIZE_MTR_THRESHOLD
- {
- HelpID = "cui:MetricField:RID_SVX_GRFFILTER_DLG_SOLARIZE:DLG_FILTERSOLARIZE_MTR_THRESHOLD";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y6 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 1 ;
- };
-#define MA_Y7 MA_Y6 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- CheckBox DLG_FILTERSOLARIZE_CBX_INVERT
- {
- HelpID = "cui:CheckBox:RID_SVX_GRFFILTER_DLG_SOLARIZE:DLG_FILTERSOLARIZE_CBX_INVERT";
- Pos = MAP_APPFONT ( 12, 46 ) ;
- Size = MAP_APPFONT ( 77, 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Invert" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
ModalDialog RID_SVX_GRFFILTER_DLG_SEPIA
{
HelpID = CMD_SID_GRFFILTER_SEPIA;
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index a1f2063e75d5..f751bb4e585c 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1544,10 +1544,10 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmo
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (Window* pParent,
- const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 )
+ const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert)
{
- oldGraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
- return new oldAbstractGraphicFilterDialog_Impl( pDlg );
+ GraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
+ return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMosaic (Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 4408c0327150..f45595274072 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -671,7 +671,7 @@ public:
sal_uInt32 nResId);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold,
- sal_Bool bInvert, sal_uInt32 nResId);
+ sal_Bool bInvert);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
sal_Bool bEnhanceEdges, sal_uInt32 nResId);
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index edd3143cc44d..79c836b78bf7 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -185,23 +185,20 @@ public:
// - GraphicFilterSolarize -
// -------------------------
-class GraphicFilterSolarize : public oldGraphicFilterDialog
+class GraphicFilterSolarize : public GraphicFilterDialog
{
private:
-
- FixedText maFtThreshold;
- MetricField maMtrThreshold;
- CheckBox maCbxInvert;
+ MetricField* mpMtrThreshold;
+ CheckBox* mpCbxInvert;
public:
- GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
+ GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
sal_uInt8 nGreyThreshold, sal_Bool bInvert );
- ~GraphicFilterSolarize();
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( maMtrThreshold.GetValue() * 2.55 ) ); }
- sal_Bool IsInvert() const { return maCbxInvert.IsChecked(); }
+ virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
+ sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( mpMtrThreshold->GetValue() * 2.55 ) ); }
+ sal_Bool IsInvert() const { return mpCbxInvert->IsChecked(); }
};
// ----------------------