From 68e793d36dbdcae8d9eb77ef0b37c9daba49075d Mon Sep 17 00:00:00 2001 From: "Faisal M. Al-Otaibi" Date: Mon, 19 Aug 2013 13:26:52 +0300 Subject: Convert similarity search dialog to .ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: cui/UIConfig_cui.mk Change-Id: Ia628babd27ca29769a6a287f70367d8208c5cc59 Reviewed-on: https://gerrit.libreoffice.org/5510 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/UIConfig_cui.mk | 1 + cui/source/dialogs/srchxtra.cxx | 31 ++-- cui/source/dialogs/srchxtra.hrc | 9 -- cui/source/dialogs/srchxtra.src | 108 ------------- cui/source/inc/cuires.hrc | 3 - cui/source/inc/srchxtra.hxx | 24 +-- cui/uiconfig/ui/similaritysearchdialog.ui | 257 ++++++++++++++++++++++++++++++ 7 files changed, 276 insertions(+), 157 deletions(-) create mode 100644 cui/uiconfig/ui/similaritysearchdialog.ui diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 4e5296727673..9435977de9d1 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -104,6 +104,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/securityoptionsdialog \ cui/uiconfig/ui/select_persona_dialog \ cui/uiconfig/ui/shadowtabpage \ + cui/uiconfig/ui/similaritysearchdialog \ cui/uiconfig/ui/slantcornertabpage \ cui/uiconfig/ui/specialcharacters \ cui/uiconfig/ui/spellingdialog \ diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 4a6f443e81dd..bbe94bc85f6d 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -248,28 +248,17 @@ SvxSearchSimilarityDialog::SvxSearchSimilarityDialog sal_uInt16 nShorter, sal_uInt16 nLonger ) : - ModalDialog( pParent, CUI_RES( RID_SVXDLG_SEARCHSIMILARITY ) ), - - aFixedLine ( this, CUI_RES( FL_SIMILARITY ) ), - aOtherTxt ( this, CUI_RES( FT_OTHER ) ), - aOtherFld ( this, CUI_RES( NF_OTHER ) ), - aLongerTxt ( this, CUI_RES( FT_LONGER ) ), - aLongerFld ( this, CUI_RES( NF_LONGER ) ), - aShorterTxt ( this, CUI_RES( FT_SHORTER ) ), - aShorterFld ( this, CUI_RES( NF_SHORTER ) ), - aRelaxBox ( this, CUI_RES( CB_RELAX ) ), - - aOKBtn ( this, CUI_RES( BTN_ATTR_OK ) ), - aEscBtn ( this, CUI_RES( BTN_ATTR_CANCEL ) ), - aHelpBtn ( this, CUI_RES( BTN_ATTR_HELP ) ) - + ModalDialog( pParent, "SimilaritySearchDialog", "cui/ui/similaritysearchdialog.ui" ) { - FreeResource(); - - aOtherFld.SetValue( nOther ); - aShorterFld.SetValue( nShorter ); - aLongerFld.SetValue( nLonger ); - aRelaxBox.Check( bRelax ); + get( m_pOtherFld, "otherfld"); + get( m_pLongerFld, "longerfld"); + get( m_pShorterFld, "shorterfld"); + get( m_pRelaxBox, "relaxbox"); + + m_pOtherFld->SetValue( nOther ); + m_pShorterFld->SetValue( nShorter ); + m_pLongerFld->SetValue( nLonger ); + m_pRelaxBox->Check( bRelax ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/srchxtra.hrc b/cui/source/dialogs/srchxtra.hrc index ced02f3b9ac7..6bfe114e7bac 100644 --- a/cui/source/dialogs/srchxtra.hrc +++ b/cui/source/dialogs/srchxtra.hrc @@ -27,15 +27,6 @@ #define LB_ATTR 13 #define FL_ATTR 14 -#define CB_RELAX 15 -#define FT_OTHER 16 -#define NF_OTHER 17 -#define FT_SHORTER 18 -#define NF_SHORTER 19 -#define FT_LONGER 20 -#define NF_LONGER 21 -#define FL_SIMILARITY 22 - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/srchxtra.src b/cui/source/dialogs/srchxtra.src index 9c10335f7ceb..ec032f7d3fda 100644 --- a/cui/source/dialogs/srchxtra.src +++ b/cui/source/dialogs/srchxtra.src @@ -122,114 +122,6 @@ ModalDialog RID_SVXDLG_SEARCHATTR Pos = MAP_APPFONT ( 136 , 43 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; -}; - // RID_SVXDLG_SEARCHSIMILARITY ------------------------------------------- -ModalDialog RID_SVXDLG_SEARCHSIMILARITY -{ - HelpId = HID_SEARCHSIMILARITY ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 76 ) ; - Text [ en-US ] = "Similarity Search" ; - Moveable = TRUE ; - FixedText FT_OTHER - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "~Exchange characters" ; - }; - NumericField NF_OTHER - { - HelpID = "cui:NumericField:RID_SVXDLG_SEARCHSIMILARITY:NF_OTHER"; - Pos = MAP_APPFONT ( 86 , 14 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Border = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - First = 1 ; - Maximum = 30 ; - Last = 30 ; - Value = 1 ; - TabStop = TRUE ; - }; - FixedText FT_LONGER - { - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "~Add characters" ; - }; - NumericField NF_LONGER - { - HelpID = "cui:NumericField:RID_SVXDLG_SEARCHSIMILARITY:NF_LONGER"; - Pos = MAP_APPFONT ( 86 , 28 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Border = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - First = 1 ; - Maximum = 30 ; - Last = 30 ; - Value = 1 ; - TabStop = TRUE ; - }; - FixedText FT_SHORTER - { - Pos = MAP_APPFONT ( 12 , 46 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "~Remove characters" ; - }; - NumericField NF_SHORTER - { - HelpID = "cui:NumericField:RID_SVXDLG_SEARCHSIMILARITY:NF_SHORTER"; - Pos = MAP_APPFONT ( 86 , 44 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Border = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - First = 1 ; - Maximum = 30 ; - Last = 30 ; - Value = 1 ; - TabStop = TRUE ; - }; - CheckBox CB_RELAX - { - HelpID = "cui:CheckBox:RID_SVXDLG_SEARCHSIMILARITY:CB_RELAX"; - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - Text [ en-US ] = "~Combine" ; - TabStop = TRUE ; - }; - FixedLine FL_SIMILARITY - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Settings" ; - }; - OKButton BTN_ATTR_OK - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_ATTR_CANCEL - { - Pos = MAP_APPFONT ( 122 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_ATTR_HELP - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; }; // ********************************************************************** EOF diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index c7ef4780fd31..1a54c25d4326 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -283,9 +283,6 @@ // split cells #define RID_SVX_SPLITCELLDLG ( RID_SVX_START + 43 ) -// searching -#define RID_SVXDLG_SEARCHSIMILARITY (RID_SVX_START + 23) - // customize #define RID_SVXDLG_CUSTOMIZE (RID_SVX_START + 291) #define RID_SVXPAGE_MENUS (RID_SVX_START + 292) diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx index 871dfdbe36a5..3b982ca954dd 100644 --- a/cui/source/inc/srchxtra.hxx +++ b/cui/source/inc/srchxtra.hxx @@ -67,18 +67,10 @@ private: class SvxSearchSimilarityDialog : public ModalDialog { private: - FixedLine aFixedLine; - FixedText aOtherTxt; - NumericField aOtherFld; - FixedText aLongerTxt; - NumericField aLongerFld; - FixedText aShorterTxt; - NumericField aShorterFld; - CheckBox aRelaxBox; - - OKButton aOKBtn; - CancelButton aEscBtn; - HelpButton aHelpBtn; + NumericField* m_pOtherFld; + NumericField* m_pLongerFld; + NumericField* m_pShorterFld; + CheckBox* m_pRelaxBox; public: SvxSearchSimilarityDialog( Window* pParent, @@ -87,10 +79,10 @@ public: sal_uInt16 nShorter, sal_uInt16 nLonger ); - sal_uInt16 GetOther() { return (sal_uInt16)aOtherFld.GetValue(); } - sal_uInt16 GetShorter() { return (sal_uInt16)aShorterFld.GetValue(); } - sal_uInt16 GetLonger() { return (sal_uInt16)aLongerFld.GetValue(); } - sal_Bool IsRelaxed() { return aRelaxBox.IsChecked(); } + sal_uInt16 GetOther() { return (sal_uInt16)m_pOtherFld->GetValue(); } + sal_uInt16 GetShorter() { return (sal_uInt16)m_pShorterFld->GetValue(); } + sal_uInt16 GetLonger() { return (sal_uInt16)m_pLongerFld->GetValue(); } + sal_Bool IsRelaxed() { return m_pRelaxBox->IsChecked(); } }; diff --git a/cui/uiconfig/ui/similaritysearchdialog.ui b/cui/uiconfig/ui/similaritysearchdialog.ui new file mode 100644 index 000000000000..e1e4a7dac1dc --- /dev/null +++ b/cui/uiconfig/ui/similaritysearchdialog.ui @@ -0,0 +1,257 @@ + + + + + 30 + 1 + 1 + 10 + + + False + 6 + Similarity Search + dialog + + + False + 12 + + + False + vertical + start + + + gtk-ok + False + True + True + True + True + True + False + True + + + False + True + 0 + + + + + gtk-cancel + False + True + True + True + False + True + + + False + True + 1 + + + + + gtk-help + False + True + True + True + False + True + top + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + vertical + 6 + + + True + False + 6 + 12 + + + True + False + 0 + _Exchange characters + True + otherfld + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Add characters + True + longerfld + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + _Remove characters + True + + + 0 + 2 + 1 + 1 + + + + + _Combine + False + True + True + False + False + True + 0 + True + + + 0 + 3 + 1 + 1 + + + + + True + True + + True + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + True + True + + True + adjustment1 + + + 1 + 1 + 1 + 1 + + + + + True + True + + True + adjustment1 + + + 1 + 2 + 1 + 1 + + + + + + + + False + True + 0 + + + + + + + + + True + False + Settings + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit