diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-18 16:14:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:48 +0100 |
commit | 4d173556cfa07620c1ea7bd1ee044df02267879b (patch) | |
tree | 9d838af587c725fc00e1c1022577e6cb88f00ded /cui/source/tabpages | |
parent | d23a61c697a81174a74fcbd78b43bd4482562af3 (diff) |
convert hard-coded layout of two-lines tabpage to .ui
Change-Id: I87da59af50420993303111dae0ec4456ae15cc20
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 90 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.hrc | 14 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.src | 89 |
3 files changed, 34 insertions, 159 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index d21457ba86f7..791f895896d3 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -193,6 +193,12 @@ SvxCharBasePage::SvxCharBasePage( Window* pParent, const ResId& rResId, const Sf { } +SvxCharBasePage::SvxCharBasePage( Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription, const SfxItemSet& rItemset) + : SfxTabPage( pParent, rID, rUIXMLDescription, rItemset ) + , m_bPreviewBackgroundToCharacter( sal_False ) +{ +} + void SvxCharBasePage::makeWidgets(Window *pParent, const ResId& rResId, sal_uInt16 nResIdPrewievWin, sal_uInt16 nResIdFontTypeFT) { @@ -3580,62 +3586,37 @@ void SvxCharPositionPage::PageCreated (SfxAllItemSet aSet) // class SvxCharTwoLinesPage ------------------------------------------------ SvxCharTwoLinesPage::SvxCharTwoLinesPage(Window* pParent, const SfxItemSet& rInSet) - : SvxCharBasePage(pParent, CUI_RES(RID_SVXPAGE_CHAR_TWOLINES), rInSet) - , m_aBox(this, false, 7) - , m_aGrid(&m_aBox) - , m_aSwitchOnLine(&m_aGrid, CUI_RES(FL_SWITCHON)) - , m_aTwoLinesBtn(&m_aGrid, CUI_RES(CB_TWOLINES)) - , m_aEncloseLine(&m_aGrid, CUI_RES(FL_ENCLOSE)) - , m_aStartBracketFT(&m_aGrid, CUI_RES(FT_STARTBRACKET)) - , m_aStartBracketLB(&m_aGrid, CUI_RES(ED_STARTBRACKET)) - , m_aEndBracketFT(&m_aGrid, CUI_RES(FT_ENDBRACKET)) - , m_aEndBracketLB(&m_aGrid, CUI_RES(ED_ENDBRACKET)) + : SvxCharBasePage(pParent, "TwoLinesPage", "cui/ui/twolinespage.ui", rInSet) , m_nStartBracketPosition( 0 ) , m_nEndBracketPosition( 0 ) { - m_aBox.set_expand(true); + get(m_pTwoLinesBtn, "twolines"); + get(m_pEnclosingFrame, "enclosing"); + get(m_pStartBracketLB, "startbracket"); + get(m_pEndBracketLB, "endbracket"); - m_aGrid.set_column_spacing(7); - m_aGrid.set_row_spacing(2); + get(m_pPreviewWin, "preview"); - setGridAttach(m_aSwitchOnLine, 0, 0, 2); - setGridAttach(m_aTwoLinesBtn, 0, 1); - setGridAttach(m_aEncloseLine, 0, 2, 2); - setGridAttach(m_aStartBracketFT, 0, 3); - setGridAttach(m_aEndBracketFT, 1, 3); - setGridAttach(m_aStartBracketLB, 0, 4); - setGridAttach(m_aEndBracketLB, 1, 4); - - makeWidgets(&m_aBox, CUI_RES(RID_SVXPAGE_CHAR_TWOLINES), WIN_TWOLINES_PREVIEW, FT_TWOLINES_FONTTYPE); - FreeResource(); Initialize(); } SvxCharTwoLinesPage::~SvxCharTwoLinesPage() { - delete m_pPreviewWin, m_pPreviewWin = NULL; - delete m_pFontTypeFT, m_pFontTypeFT = NULL; + m_pPreviewWin = NULL; //to-do, when all of these tab pages are converted to .ui this and the parent delete can go } // ----------------------------------------------------------------------- void SvxCharTwoLinesPage::Initialize() { - Size aSize = m_aStartBracketLB.GetSizePixel(); - aSize.Height() = m_aStartBracketLB.CalcSize( 1, 6 ).Height(); - m_aStartBracketLB.SetSizePixel( aSize ); - aSize = m_aEndBracketLB.GetSizePixel(); - aSize.Height() = m_aEndBracketLB.CalcSize( 1, 6 ).Height(); - m_aEndBracketLB.SetSizePixel( aSize ); - - m_aTwoLinesBtn.Check( sal_False ); + m_pTwoLinesBtn->Check( sal_False ); TwoLinesHdl_Impl( NULL ); - m_aTwoLinesBtn.SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) ); + m_pTwoLinesBtn->SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) ); Link aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); - m_aStartBracketLB.SetSelectHdl( aLink ); - m_aEndBracketLB.SetSelectHdl( aLink ); + m_pStartBracketLB->SetSelectHdl( aLink ); + m_pEndBracketLB->SetSelectHdl( aLink ); SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); @@ -3650,7 +3631,7 @@ void SvxCharTwoLinesPage::Initialize() void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox ) { - bool bStart = pBox == &m_aStartBracketLB; + bool bStart = pBox == m_pStartBracketLB; //SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); //if(pFact) { @@ -3676,7 +3657,7 @@ void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox ) void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart ) { sal_uInt16 nEntryPos = 0; - ListBox* pBox = bStart ? &m_aStartBracketLB : &m_aEndBracketLB; + ListBox* pBox = bStart ? m_pStartBracketLB : m_pEndBracketLB; if ( 0 == cBracket ) pBox->SelectEntryPos(0); else @@ -3713,11 +3694,8 @@ void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart ) IMPL_LINK_NOARG(SvxCharTwoLinesPage, TwoLinesHdl_Impl) { - sal_Bool bChecked = m_aTwoLinesBtn.IsChecked(); - m_aStartBracketFT.Enable( bChecked ); - m_aStartBracketLB.Enable( bChecked ); - m_aEndBracketFT.Enable( bChecked ); - m_aEndBracketLB.Enable( bChecked ); + sal_Bool bChecked = m_pTwoLinesBtn->IsChecked(); + m_pEnclosingFrame->Enable( bChecked ); UpdatePreview_Impl(); return 0; @@ -3732,7 +3710,7 @@ IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox ) SelectCharacter( pBox ); else { - bool bStart = pBox == &m_aStartBracketLB; + bool bStart = pBox == m_pStartBracketLB; if( bStart ) m_nStartBracketPosition = nPos; else @@ -3776,14 +3754,14 @@ sal_uInt16* SvxCharTwoLinesPage::GetRanges() void SvxCharTwoLinesPage::Reset( const SfxItemSet& rSet ) { - m_aTwoLinesBtn.Check( sal_False ); + m_pTwoLinesBtn->Check( sal_False ); sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES ); SfxItemState eState = rSet.GetItemState( nWhich ); if ( eState >= SFX_ITEM_DONTCARE ) { const SvxTwoLinesItem& rItem = (SvxTwoLinesItem&)rSet.Get( nWhich ); - m_aTwoLinesBtn.Check( rItem.GetValue() ); + m_pTwoLinesBtn->Check( rItem.GetValue() ); if ( rItem.GetValue() ) { @@ -3804,11 +3782,11 @@ sal_Bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet ) sal_Bool bModified = sal_False, bChanged = sal_True; sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES ); const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_TWO_LINES ); - sal_Bool bOn = m_aTwoLinesBtn.IsChecked(); - sal_Unicode cStart = ( bOn && m_aStartBracketLB.GetSelectEntryPos() > 0 ) - ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0; - sal_Unicode cEnd = ( bOn && m_aEndBracketLB.GetSelectEntryPos() > 0 ) - ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0; + sal_Bool bOn = m_pTwoLinesBtn->IsChecked(); + sal_Unicode cStart = ( bOn && m_pStartBracketLB->GetSelectEntryPos() > 0 ) + ? m_pStartBracketLB->GetSelectEntry().GetChar(0) : 0; + sal_Unicode cEnd = ( bOn && m_pEndBracketLB->GetSelectEntryPos() > 0 ) + ? m_pEndBracketLB->GetSelectEntry().GetChar(0) : 0; if ( pOld ) { @@ -3831,12 +3809,12 @@ sal_Bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet ) void SvxCharTwoLinesPage::UpdatePreview_Impl() { - sal_Unicode cStart = m_aStartBracketLB.GetSelectEntryPos() > 0 - ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0; - sal_Unicode cEnd = m_aEndBracketLB.GetSelectEntryPos() > 0 - ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0; + sal_Unicode cStart = m_pStartBracketLB->GetSelectEntryPos() > 0 + ? m_pStartBracketLB->GetSelectEntry().GetChar(0) : 0; + sal_Unicode cEnd = m_pEndBracketLB->GetSelectEntryPos() > 0 + ? m_pEndBracketLB->GetSelectEntry().GetChar(0) : 0; m_pPreviewWin->SetBrackets(cStart, cEnd); - m_pPreviewWin->SetTwoLines(m_aTwoLinesBtn.IsChecked()); + m_pPreviewWin->SetTwoLines(m_pTwoLinesBtn->IsChecked()); m_pPreviewWin->Invalidate(); } // ----------------------------------------------------------------------- diff --git a/cui/source/tabpages/chardlg.hrc b/cui/source/tabpages/chardlg.hrc index 91a54e3a57ac..0108f75dc133 100644 --- a/cui/source/tabpages/chardlg.hrc +++ b/cui/source/tabpages/chardlg.hrc @@ -147,20 +147,6 @@ #define WIN_POS_PREVIEW 331 #define FT_POS_FONTTYPE 332 -// TwoLinesPage ------------------------------------------------------------- - -#define FL_SWITCHON 400 -#define CB_TWOLINES 401 - -#define FL_ENCLOSE 410 -#define FT_STARTBRACKET 411 -#define ED_STARTBRACKET 412 -#define FT_ENDBRACKET 413 -#define ED_ENDBRACKET 414 - -#define WIN_TWOLINES_PREVIEW 421 -#define FT_TWOLINES_FONTTYPE 422 - #define FT_WEST_NAME_NOCJK 423 #define LB_WEST_NAME_NOCJK 424 #define FT_WEST_STYLE_NOCJK 425 diff --git a/cui/source/tabpages/chardlg.src b/cui/source/tabpages/chardlg.src index 74b17139afcf..c1a925f6fd76 100644 --- a/cui/source/tabpages/chardlg.src +++ b/cui/source/tabpages/chardlg.src @@ -927,92 +927,3 @@ TabPage RID_SVXPAGE_CHAR_POSITION Hide = TRUE; }; }; - -TabPage RID_SVXPAGE_CHAR_TWOLINES -{ - HelpId = HID_SVXPAGE_CHAR_TWOLINES ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Hide = TRUE ; - FixedLine FL_SWITCHON - { - Pos = MAP_APPFONT ( 6 , 3 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Double-lined" ; - }; - CheckBox CB_TWOLINES - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_TWOLINES:CB_TWOLINES"; - Pos = MAP_APPFONT ( 12 , 14 ); - Size = MAP_APPFONT ( 236 , 10 ); - Text [ en-US ] = "~Write in double lines" ; - TabStop = TRUE; - }; - FixedLine FL_ENCLOSE - { - Pos = MAP_APPFONT ( 6 , 30 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Enclosing character" ; - }; - FixedText FT_STARTBRACKET - { - Pos = MAP_APPFONT ( 12 , 41 ); - Size = MAP_APPFONT ( 90 , 8 ); - Text [ en-US ] = "I~nitial character" ; - }; - ListBox ED_STARTBRACKET - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_TWOLINES:ED_STARTBRACKET"; - Pos = MAP_APPFONT ( 12 , 52 ); - Size = MAP_APPFONT ( 90 , 72 ); - TabStop = TRUE; - Border = TRUE; - StringList [ en-US ] = - { - < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ; - < "(" ; CHRDLG_ENCLOSE_ROUND ; > ; - < "[" ; CHRDLG_ENCLOSE_SQUARE ; > ; - < "<" ; CHRDLG_ENCLOSE_POINTED ; > ; - < "{" ; CHRDLG_ENCLOSE_CURVED ; > ; - < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ; - }; - }; - FixedText FT_ENDBRACKET - { - Pos = MAP_APPFONT ( 108 , 41 ); - Size = MAP_APPFONT ( 90 , 8 ); - Text [ en-US ] = "Final charact~er" ; - }; - ListBox ED_ENDBRACKET - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_TWOLINES:ED_ENDBRACKET"; - Pos = MAP_APPFONT ( 108 , 52 ); - Size = MAP_APPFONT ( 90 , 72 ); - TabStop = TRUE; - Border = TRUE; - StringList [ en-US ] = - { - < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ; - < ")" ; CHRDLG_ENCLOSE_ROUND ; > ; - < "]" ; CHRDLG_ENCLOSE_SQUARE ; > ; - < ">" ; CHRDLG_ENCLOSE_POINTED ; > ; - < "}" ; CHRDLG_ENCLOSE_CURVED ; > ; - < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ; - }; - }; - Window WIN_TWOLINES_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 149 ) ; - Size = MAP_APPFONT ( 248 , 37 ) ; - Text [ en-US ] = "Example" ; - }; - FixedText FT_TWOLINES_FONTTYPE - { - Pos = MAP_APPFONT ( 6 , 168 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - Hide = TRUE; - }; -}; - - // ********************************************************************** EOF |