diff options
author | Manal Alhassoun <malhassoun@kacst.edu.sa> | 2013-11-07 15:12:10 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-12 12:07:33 +0000 |
commit | eb505c259d0d7bd05d1bb5be5a14ad8613c2a9c7 (patch) | |
tree | d1852eccb10ffb0a4e8a02e85540edadaa0f9955 /sfx2/source/dialog | |
parent | 12fd49a2701f4d23f23f0770bd40c8cd20b523c7 (diff) |
Convert New Style dialog to widget UI
Change-Id: Idaea69f674e1e84e3e1e649006c2d92176897fe0
Reviewed-on: https://gerrit.libreoffice.org/6607
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/newstyle.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/dialog/newstyle.hrc | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/newstyle.src | 36 |
3 files changed, 11 insertions, 53 deletions
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 2995a7111243..5f8e24e87425 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -31,7 +31,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl ) { (void)pControl; //unused - const OUString aName( aColBox.GetText() ); + const OUString aName( m_pColBox->GetText() ); SfxStyleSheetBase* pStyle = rPool.Find( aName, rPool.GetSearchFamily(), SFXSTYLEBIT_ALL ); if ( pStyle ) { @@ -54,7 +54,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl ) IMPL_LINK_INLINE_START( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) { - aOKBtn.Enable( !comphelper::string::remove(pBox->GetText(), ' ').isEmpty() ); + m_pOKBtn->Enable( !comphelper::string::remove(pBox->GetText(), ' ').isEmpty() ); return 0; } IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) @@ -63,28 +63,26 @@ IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool ) : - ModalDialog( pParent, SfxResId( DLG_NEW_STYLE_BY_EXAMPLE ) ), + ModalDialog( pParent, "CreateStyleDialog", "sfx/ui/newstyle.ui" ), - aColFL ( this, SfxResId( FL_COL ) ), - aColBox ( this, SfxResId( LB_COL ) ), - aOKBtn ( this, SfxResId( BT_OK ) ), - aCancelBtn ( this, SfxResId( BT_CANCEL ) ), aQueryOverwriteBox ( this, SfxResId( MSG_OVERWRITE ) ), rPool( rInPool ) { - FreeResource(); + get(m_pColBox, "stylename"); + m_pColBox->set_width_request(m_pColBox->approximate_char_width() * 25); + m_pColBox->set_height_request(m_pColBox->GetTextHeight() * 10); + get(m_pOKBtn, "ok"); - aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); - aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl)); - aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); -// aColBox.SetAccessibleName(SfxResId(FL_COL).toString()); + m_pOKBtn->SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); + m_pColBox->SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl)); + m_pColBox->SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); SfxStyleSheetBase *pStyle = rPool.First(); while ( pStyle ) { - aColBox.InsertEntry(pStyle->GetName()); + m_pColBox->InsertEntry(pStyle->GetName()); pStyle = rPool.Next(); } } diff --git a/sfx2/source/dialog/newstyle.hrc b/sfx2/source/dialog/newstyle.hrc index 0262c89d4da5..4725dbdb9d8a 100644 --- a/sfx2/source/dialog/newstyle.hrc +++ b/sfx2/source/dialog/newstyle.hrc @@ -17,10 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define BT_OK 100 -#define BT_CANCEL 101 -#define LB_COL 1 -#define FL_COL 2 #define MSG_OVERWRITE 3 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src index 8a8d147ed32a..375bac54ad4e 100644 --- a/sfx2/source/dialog/newstyle.src +++ b/sfx2/source/dialog/newstyle.src @@ -22,47 +22,11 @@ #include "newstyle.hrc" #include <sfx2/sfxcommands.h> -ModalDialog DLG_NEW_STYLE_BY_EXAMPLE -{ - HelpId = CMD_SID_STYLE_NEW_BY_EXAMPLE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 177 , 112 ) ; - Text [ en-US ] = "Create Style" ; - Moveable = TRUE ; - FixedLine FL_COL - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 109 , 8 ) ; - Text [ en-US ] = "Style name" ; - }; - ComboBox LB_COL - { - HelpID = "sfx2:ComboBox:DLG_NEW_STYLE_BY_EXAMPLE:LB_COL"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 94 , 92 ) ; - TabStop = TRUE ; - }; - OKButton BT_OK - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 121 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 121 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; QueryBox MSG_OVERWRITE { Buttons = WB_YES_NO ; DefButton = WB_DEF_NO ; Message [ en-US ] = "Style already exists. Overwrite?" ; }; -}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |