diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 7e184a6ca433..6b068abd6c77 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -123,6 +123,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/positionsizedialog \ cui/uiconfig/ui/possizetabpage \ + cui/uiconfig/ui/posterdialog \ cui/uiconfig/ui/querychangelineenddialog \ cui/uiconfig/ui/querydeletebitmapdialog \ cui/uiconfig/ui/querydeletechartcolordialog \ diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 5551b2c3ca38..304db3a45c3c 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -516,24 +516,17 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, // - GraphicFilterPoster - // ----------------------- -GraphicFilterPoster::GraphicFilterPoster( Window* pParent, const Graphic& rGraphic, - sal_uInt16 nPosterCount ) : - oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ), - maFtPoster ( this, CUI_RES( DLG_FILTERPOSTER_FT_POSTER ) ), - maNumPoster ( this, CUI_RES( DLG_FILTERPOSTER_NUM_POSTER ) ) +GraphicFilterPoster::GraphicFilterPoster(Window* pParent, const Graphic& rGraphic, + sal_uInt16 nPosterCount) + : GraphicFilterDialog(pParent, "PosterDialog", + "cui/ui/posterdialog.ui", rGraphic) { - FreeResource(); + get(mpNumPoster, "value"); - maNumPoster.SetFirst( 2 ); - maNumPoster.SetLast( rGraphic.GetBitmapEx().GetBitCount() ); - maNumPoster.SetValue( nPosterCount ); - maNumPoster.SetModifyHdl( GetModifyHdl() ); -} - -// ----------------------------------------------------------------------------- - -GraphicFilterPoster::~GraphicFilterPoster() -{ + mpNumPoster->SetFirst( 2 ); + mpNumPoster->SetLast( rGraphic.GetBitmapEx().GetBitCount() ); + mpNumPoster->SetValue( nPosterCount ); + mpNumPoster->SetModifyHdl( GetModifyHdl() ); } // ----------------------------------------------------------------------------- diff --git a/cui/source/dialogs/grfflt.hrc b/cui/source/dialogs/grfflt.hrc index 40841090ae17..8e6e17127039 100644 --- a/cui/source/dialogs/grfflt.hrc +++ b/cui/source/dialogs/grfflt.hrc @@ -40,13 +40,6 @@ #define DLG_FILTERMOSAIC_MTR_HEIGHT 4 #define DLG_FILTERMOSAIC_CBX_EDGES 5 -// -------------------- -// - DLG_FILTERPOSTER - -// -------------------- - -#define DLG_FILTERPOSTER_FT_POSTER 1 -#define DLG_FILTERPOSTER_NUM_POSTER 2 - // -------------------- // - DLG_FILTEREMBOSS - // -------------------- diff --git a/cui/source/dialogs/grfflt.src b/cui/source/dialogs/grfflt.src index 57181a6ceccc..276f7e012793 100644 --- a/cui/source/dialogs/grfflt.src +++ b/cui/source/dialogs/grfflt.src @@ -130,76 +130,6 @@ ModalDialog RID_SVX_GRFFILTER_DLG_MOSAIC }; }; -// -------------------- -// - DLG_FILTERPOSTER - -// -------------------- - -ModalDialog RID_SVX_GRFFILTER_DLG_POSTER -{ - HelpID = CMD_SID_GRFFILTER_POSTER; - OutputSize = TRUE ; - Moveable = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 250, 100 ) ; - - Text [ en-US ] = "Posterize" ; - - 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_Y10 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP - FixedText DLG_FILTERPOSTER_FT_POSTER - { - Pos = MAP_APPFONT ( 12 , MA_Y10 ) ; - Size = MAP_APPFONT ( 77 , 10 ) ; - Text [ en-US ] = "Poster colors" ; - }; -#define MA_Y11 MA_Y10 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y - NumericField DLG_FILTERPOSTER_NUM_POSTER - { - HelpID = "cui:NumericField:RID_SVX_GRFFILTER_DLG_POSTER:DLG_FILTERPOSTER_NUM_POSTER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , MA_Y11 ) ; - Size = MAP_APPFONT ( 35 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 64 ; - StrictFormat = TRUE ; - First = 2 ; - Last = 64 ; - SpinSize = 1 ; - }; - 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 - // -------------------- diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index bd2abaa3ba8d..0dd0932e52fe 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1516,8 +1516,8 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos const Graphic& rGraphic, sal_uInt16 nCount) { - oldGraphicFilterDialog* pDlg = new GraphicFilterPoster( pParent, rGraphic, nCount ); - return new oldAbstractGraphicFilterDialog_Impl( pDlg ); + GraphicFilterDialog* pDlg = new GraphicFilterPoster( pParent, rGraphic, nCount ); + return new AbstractGraphicFilterDialog_Impl( pDlg ); } AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSepia (Window* pParent, diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx index 4fa7b3d57b8c..adbecbb04d98 100644 --- a/cui/source/inc/cuigrfflt.hxx +++ b/cui/source/inc/cuigrfflt.hxx @@ -223,21 +223,16 @@ public: // - GraphicFilterPoster - // ----------------------- -class GraphicFilterPoster : public oldGraphicFilterDialog +class GraphicFilterPoster : public GraphicFilterDialog { private: - - FixedText maFtPoster; - NumericField maNumPoster; - + NumericField* mpNumPoster; public: - - GraphicFilterPoster( Window* pParent, const Graphic& rGraphic, - sal_uInt16 nPosterColorCount ); - ~GraphicFilterPoster(); + GraphicFilterPoster( Window* pParent, const Graphic& rGraphic, + sal_uInt16 nPosterColorCount ); virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ); - sal_uInt16 GetPosterColorCount() const { return( (sal_uInt16) maNumPoster.GetValue() ); } + sal_uInt16 GetPosterColorCount() const { return( (sal_uInt16) mpNumPoster->GetValue() ); } }; // ----------------------- diff --git a/cui/uiconfig/ui/posterdialog.ui b/cui/uiconfig/ui/posterdialog.ui new file mode 100644 index 000000000000..a4c207f572e2 --- /dev/null +++ b/cui/uiconfig/ui/posterdialog.ui @@ -0,0 +1,187 @@ + + + + + + + 2 + 64 + 2 + 1 + 10 + + + False + 6 + Posterize + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 24 + + + True + False + True + True + + + 1 + 0 + 1 + 1 + + + + + True + False + 6 + + + True + True + adjustment1 + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + Poster colors + True + value + + + 0 + 0 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Parameters + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 4a9baabaed04..cf133f2b5ab3 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -98,7 +98,6 @@ #define RID_SVXPAGE_GRID (RID_SVX_START + 152) // factory IDs of dialogs implemented in CUI -#define RID_SVX_GRFFILTER_DLG_POSTER (RID_SVX_START + 335) #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 )