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

convert mosaic dialog to .ui

Change-Id: Ibc723ca79fba89f24e04440fdbf4140a4e0655ad
üst 7911b70e
......@@ -73,6 +73,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/macroassignpage \
cui/uiconfig/ui/macroselectordialog \
cui/uiconfig/ui/messbox \
cui/uiconfig/ui/mosaicdialog \
cui/uiconfig/ui/movemenu \
cui/uiconfig/ui/namedialog \
cui/uiconfig/ui/newlibdialog \
......
......@@ -298,40 +298,26 @@ IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl)
// ----------------
GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges ) :
oldGraphicFilterDialog( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
maFtWidth ( this, CUI_RES( DLG_FILTERMOSAIC_FT_WIDTH ) ),
maMtrWidth ( this, CUI_RES( DLG_FILTERMOSAIC_MTR_WIDTH ) ),
maFtHeight ( this, CUI_RES( DLG_FILTERMOSAIC_FT_HEIGHT ) ),
maMtrHeight ( this, CUI_RES( DLG_FILTERMOSAIC_MTR_HEIGHT ) ),
maCbxEdges ( this, CUI_RES( DLG_FILTERMOSAIC_CBX_EDGES ) )
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges )
: GraphicFilterDialog(pParent, "MosaicDialog",
"cui/ui/mosaicdialog.ui", rGraphic)
{
FreeResource();
maMtrWidth.SetValue( nTileWidth );
maMtrWidth.SetLast( GetGraphicSizePixel().Width() );
maMtrWidth.SetModifyHdl( GetModifyHdl() );
get(mpMtrWidth, "width");
get(mpMtrHeight, "height");
get(mpCbxEdges, "edges");
maMtrHeight.SetValue( nTileHeight );
maMtrHeight.SetLast( GetGraphicSizePixel().Height() );
maMtrHeight.SetModifyHdl( GetModifyHdl() );
mpMtrWidth->SetValue( nTileWidth );
mpMtrWidth->SetLast( GetGraphicSizePixel().Width() );
mpMtrWidth->SetModifyHdl( GetModifyHdl() );
maCbxEdges.Check( bEnhanceEdges );
maCbxEdges.SetToggleHdl( GetModifyHdl() );
mpMtrHeight->SetValue( nTileHeight );
mpMtrHeight->SetLast( GetGraphicSizePixel().Height() );
mpMtrHeight->SetModifyHdl( GetModifyHdl() );
maMtrWidth.GrabFocus();
maFtWidth.SetAccessibleRelationMemberOf(&maFlParameter);
maMtrWidth.SetAccessibleRelationMemberOf(&maFlParameter);
maFtHeight.SetAccessibleRelationMemberOf(&maFlParameter);
maMtrHeight.SetAccessibleRelationMemberOf(&maFlParameter);
maCbxEdges.SetAccessibleRelationMemberOf(&maFlParameter);
}
mpCbxEdges->Check( bEnhanceEdges );
mpCbxEdges->SetToggleHdl( GetModifyHdl() );
// -----------------------------------------------------------------------------
GraphicFilterMosaic::~GraphicFilterMosaic()
{
mpMtrWidth->GrabFocus();
}
// -----------------------------------------------------------------------------
......
......@@ -30,16 +30,6 @@
#define CTL_PREVIEW 105
#define FL_PARAMETER 106
// --------------------
// - DLG_FILTERMOSAIC -
// --------------------
#define DLG_FILTERMOSAIC_FT_WIDTH 1
#define DLG_FILTERMOSAIC_MTR_WIDTH 2
#define DLG_FILTERMOSAIC_FT_HEIGHT 3
#define DLG_FILTERMOSAIC_MTR_HEIGHT 4
#define DLG_FILTERMOSAIC_CBX_EDGES 5
// --------------------
// - DLG_FILTEREMBOSS -
// --------------------
......
......@@ -23,113 +23,6 @@
#include "grfflt.hrc"
#include <svx/dialogs.hrc>
// --------------------
// - DLG_FILTERMOSAIC -
// --------------------
ModalDialog RID_SVX_GRFFILTER_DLG_MOSAIC
{
HelpID = CMD_SID_GRFFILTER_MOSAIC;
OutputSize = TRUE ;
Moveable = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 250, 100 ) ;
Text [ en-US ] = "Mosaic" ;
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_Y0 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
FixedText DLG_FILTERMOSAIC_FT_WIDTH
{
Pos = MAP_APPFONT ( 12, MA_Y0 ) ;
Size = MAP_APPFONT ( 77, 10 ) ;
Text [ en-US ] = "~Width" ;
};
#define MA_Y1 MA_Y0 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
MetricField DLG_FILTERMOSAIC_MTR_WIDTH
{
HelpID = "cui:MetricField:RID_SVX_GRFFILTER_DLG_MOSAIC:DLG_FILTERMOSAIC_MTR_WIDTH";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , MA_Y1 ) ;
Size = MAP_APPFONT ( 35 , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 999 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText [ en-US ] = " Pixel" ;
First = 1 ;
Last = 999 ;
SpinSize = 1 ;
};
#define MA_Y2 MA_Y1 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
FixedText DLG_FILTERMOSAIC_FT_HEIGHT
{
Pos = MAP_APPFONT ( 12, MA_Y2 ) ;
Size = MAP_APPFONT ( 77, 10 ) ;
Text [ en-US ] = "H~eight" ;
};
#define MA_Y3 MA_Y2 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
MetricField DLG_FILTERMOSAIC_MTR_HEIGHT
{
HelpID = "cui:MetricField:RID_SVX_GRFFILTER_DLG_MOSAIC:DLG_FILTERMOSAIC_MTR_HEIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( 12, MA_Y3 ) ;
Size = MAP_APPFONT ( 35, 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 1 ;
Maximum = 999 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText [ en-US ] = " Pixel" ;
First = 1 ;
Last = 999 ;
SpinSize = 1 ;
};
#define MA_Y4 MA_Y3 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_Y
CheckBox DLG_FILTERMOSAIC_CBX_EDGES
{
HelpID = "cui:CheckBox:RID_SVX_GRFFILTER_DLG_MOSAIC:DLG_FILTERMOSAIC_CBX_EDGES";
Pos = MAP_APPFONT ( 12, MA_Y4 ) ;
Size = MAP_APPFONT ( 91, 12 ) ;
TabStop = TRUE ;
Text [ en-US ] = "E~nhance edges" ;
};
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_FILTEREMBOSS -
// --------------------
......
......@@ -1544,21 +1544,10 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSol
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
sal_Bool bEnhanceEdges, sal_uInt32 nResId)
sal_Bool bEnhanceEdges)
{
oldGraphicFilterDialog* pDlg=NULL;
switch ( nResId )
{
case RID_SVX_GRFFILTER_DLG_MOSAIC :
pDlg = new GraphicFilterMosaic( pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges );
break;
default:
break;
}
if ( pDlg )
return new oldAbstractGraphicFilterDialog_Impl( pDlg );
return 0;
GraphicFilterDialog* pDlg = new GraphicFilterMosaic(pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges);
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( Window* pParent,
......
......@@ -674,7 +674,7 @@ public:
sal_Bool bInvert);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
sal_Bool bEnhanceEdges, sal_uInt32 nResId);
sal_Bool bEnhanceEdges);
virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
......
......@@ -159,26 +159,22 @@ public:
// - GraphicFilterMosaic -
// -----------------------
class GraphicFilterMosaic : public oldGraphicFilterDialog
class GraphicFilterMosaic : public GraphicFilterDialog
{
private:
FixedText maFtWidth;
MetricField maMtrWidth;
FixedText maFtHeight;
MetricField maMtrHeight;
CheckBox maCbxEdges;
MetricField* mpMtrWidth;
MetricField* mpMtrHeight;
CheckBox* mpCbxEdges;
public:
GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges );
~GraphicFilterMosaic();
GraphicFilterMosaic(Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges);
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
long GetTileWidth() const { return static_cast<long>(maMtrWidth.GetValue()); }
long GetTileHeight() const { return static_cast<long>(maMtrHeight.GetValue()); }
sal_Bool IsEnhanceEdges() const { return maCbxEdges.IsChecked(); }
long GetTileWidth() const { return static_cast<long>(mpMtrWidth->GetValue()); }
long GetTileHeight() const { return static_cast<long>(mpMtrHeight->GetValue()); }
sal_Bool IsEnhanceEdges() const { return mpCbxEdges->IsChecked(); }
};
// -------------------------
......
This diff is collapsed.
......@@ -98,7 +98,6 @@
#define RID_SVXPAGE_GRID (RID_SVX_START + 152)
// factory IDs of dialogs implemented in CUI
#define RID_SVX_GRFFILTER_DLG_MOSAIC (RID_SVX_START + 332)
#define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336)
#define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 )
......
......@@ -429,7 +429,7 @@ public:
sal_uInt8 nGreyThreshold, sal_Bool bInvert)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges, sal_uInt32 nResId)=0;
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges)=0;
virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
......
......@@ -166,7 +166,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterMosaic( pWindow, rGraphic, 4, 4, sal_False, RID_SVX_GRFFILTER_DLG_MOSAIC);
AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterMosaic(pWindow, rGraphic, 4, 4, sal_False);
DBG_ASSERT(aDlg, "Dialogdiet fail!");
if( aDlg->Execute() == RET_OK )
aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 );
......
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