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/newstyle.cxx | |
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/newstyle.cxx')
-rw-r--r-- | sfx2/source/dialog/newstyle.cxx | 24 |
1 files changed, 11 insertions, 13 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(); } } |