diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-31 16:37:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-31 21:21:38 +0000 |
commit | c8cae05ee8cfa0742865224b31d344317ceb996f (patch) | |
tree | ba53827d2df5b6616bd6ee29d44c54ec4b7db7d8 /cui | |
parent | e70fb08305fdb3ad54c17f979c64996a7f043dcd (diff) |
convert solarize dialog to .ui
Change-Id: I1aab18d8e0aa12d39584266a6657436ea100b521
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/dialogs/cuigrfflt.cxx | 25 | ||||
-rw-r--r-- | cui/source/dialogs/grfflt.hrc | 8 | ||||
-rw-r--r-- | cui/source/dialogs/grfflt.src | 82 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 6 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/cuigrfflt.hxx | 17 | ||||
-rw-r--r-- | cui/uiconfig/ui/solarizedialog.ui | 202 |
8 files changed, 223 insertions, 120 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index d647970acfe9..d7b2fc65f914 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -148,6 +148,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/similaritysearchdialog \ cui/uiconfig/ui/slantcornertabpage \ cui/uiconfig/ui/smoothdialog \ + cui/uiconfig/ui/solarizedialog \ cui/uiconfig/ui/specialcharacters \ cui/uiconfig/ui/spellingdialog \ cui/uiconfig/ui/spelloptionsdialog \ 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(); } }; // ---------------------- diff --git a/cui/uiconfig/ui/solarizedialog.ui b/cui/uiconfig/ui/solarizedialog.ui new file mode 100644 index 000000000000..c1f7c92554f0 --- /dev/null +++ b/cui/uiconfig/ui/solarizedialog.ui @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkDialog" id="SolarizeDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Solarization</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</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="hexpand">True</property> + <property name="vexpand">True</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="hexpand">True</property> + <property name="vexpand">True</property> + <property name="column_spacing">24</property> + <child> + <object class="cuilo-GraphicPreviewWindow" id="preview"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</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="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkSpinButton" id="value:0%"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="adjustment">adjustment1</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="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Threshold _value</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">value: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="GtkCheckButton" id="invert"> + <property name="label" translatable="yes">_Invert</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> + </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> + </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> + </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">Parameters</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> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> |