diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-08-04 20:49:22 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-06 07:18:21 +0000 |
commit | 0651e83da75b36ec95e9a895c746174831df53dd (patch) | |
tree | 2185955b184a3657093bcf92ced31fbe66d438c9 /cui | |
parent | e289eb655fb0d750b09c74dfd9811ab27243a207 (diff) |
Convert line end tab page to widget UI
Change-Id: If7317c33142d0854a4e10953e1a8bbcb0403ec59
Reviewed-on: https://gerrit.libreoffice.org/5282
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/cuitabline.hxx | 20 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 2 | ||||
-rw-r--r-- | cui/source/tabpages/tabline.hrc | 6 | ||||
-rw-r--r-- | cui/source/tabpages/tabline.src | 118 | ||||
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 227 | ||||
-rw-r--r-- | cui/uiconfig/ui/lineendstabpage.ui | 262 |
7 files changed, 373 insertions, 263 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index ec5667a3a5c8..7bf6e5dcce9f 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -41,6 +41,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/insertplugin \ cui/uiconfig/ui/insertrowcolumn \ cui/uiconfig/ui/linetabpage \ + cui/uiconfig/ui/lineendstabpage \ cui/uiconfig/ui/macroselectordialog \ cui/uiconfig/ui/messbox \ cui/uiconfig/ui/namedialog \ diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index 58329cd9b601..59f8de118b87 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -332,18 +332,14 @@ class SvxLineEndDefTabPage : public SfxTabPage using TabPage::DeactivatePage; private: - FixedLine aFlTip; - FixedText aFTTitle; - Edit aEdtName; - FixedText aFTLineEndStyle; - LineEndLB aLbLineEnds; - PushButton aBtnAdd; - PushButton aBtnModify; - PushButton aBtnDelete; - ImageButton aBtnLoad; - ImageButton aBtnSave; - FixedInfo aFiTip; - SvxXLinePreview aCtlPreview; + Edit* m_pEdtName; + LineEndLB* m_pLbLineEnds; + PushButton* m_pBtnAdd; + PushButton* m_pBtnModify; + PushButton* m_pBtnDelete; + PushButton* m_pBtnLoad; + PushButton* m_pBtnSave; + SvxXLinePreview* m_pCtlPreview; const SfxItemSet& rOutAttrs; const SdrObject* pPolyObj; diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index b0de4ee13aa2..1af46d5534ab 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -242,7 +242,7 @@ #define HID_SVXPAGE_SWPOSSIZE "CUI_HID_SVXPAGE_SWPOSSIZE" #define HID_TPSHADOW_CTRL "CUI_HID_TPSHADOW_CTRL" -#define HID_LINE_ENDDEF "CUI_HID_LINE_ENDDEF" + #define HID_LINE_DEF "CUI_HID_LINE_DEF" #define HID_SPELLDLG_SETWORD "CUI_HID_SPELLDLG_SETWORD" diff --git a/cui/source/tabpages/tabline.hrc b/cui/source/tabpages/tabline.hrc index 9492a14a4c32..ddee01a85f23 100644 --- a/cui/source/tabpages/tabline.hrc +++ b/cui/source/tabpages/tabline.hrc @@ -48,11 +48,5 @@ #define BTN_DELETE 3 #define BTN_LOAD 5 #define BTN_SAVE 6 -#define EDT_NAME 1 -#define LB_LINEENDS 1 -#define FL_TIP 1 -#define FI_TIP 10 -#define FT_LINE_END_STYLE 11 -#define FT_TITLE 12 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tabline.src b/cui/source/tabpages/tabline.src index 258e595219a7..4b0b257b71bb 100644 --- a/cui/source/tabpages/tabline.src +++ b/cui/source/tabpages/tabline.src @@ -300,124 +300,6 @@ TabPage RID_SVXPAGE_LINE_DEF }; }; -// Defining LineEnds -------------------- - -TabPage RID_SVXPAGE_LINEEND_DEF -{ - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - HelpId = HID_LINE_ENDDEF ; - Hide = TRUE ; - Text [ en-US ] = "Arrowheads" ; - - FixedLine FL_TIP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Organize arrow styles" ; - }; - FixedText FI_TIP - { - Pos = MAP_APPFONT ( 6 , 123 ) ; - Size = MAP_APPFONT ( 252 , 8 ) ; - Text [ en-US ] = "Add a selected object to create new arrow styles." ; - WordBreak = TRUE ; - }; - - FixedText FT_LINE_END_STYLE - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 84 , 8 ) ; - Text [ en-US ] = "Arrow style" ; - }; - Edit EDT_NAME - { - HelpID = "cui:Edit:RID_SVXPAGE_LINEEND_DEF:EDT_NAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 98 , 14 ) ; - Size = MAP_APPFONT ( 87 , 12 ) ; - TabStop = TRUE ; - }; - FixedText FT_TITLE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 84 , 8 ) ; - Text [ en-US ] = "~Title" ; - }; - ListBox LB_LINEENDS - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINEEND_DEF:LB_LINEENDS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 98 , 30 ) ; - Size = MAP_APPFONT ( 87 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_ADD"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_MODIFY"; - Pos = MAP_APPFONT ( 198 , 34 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_DELETE"; - Pos = MAP_APPFONT ( 198 , 54 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINEEND_DEF:BTN_LOAD"; - Pos = MAP_APPFONT ( 198 , 74 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Arrow Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINEEND_DEF:BTN_SAVE"; - Pos = MAP_APPFONT ( 198 , 96 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Arrow Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; - - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 135 ) ; - Size = MAP_APPFONT ( 248 , 40 ) ; - }; - -}; // RID_SVXDLG_LINE ---------------------------------------------------------- TabDialog RID_SVXDLG_LINE { diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 6756aec1840d..e5af02595a40 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -54,23 +54,12 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage const SfxItemSet& rInAttrs ) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_LINEEND_DEF ), rInAttrs ), - - aFlTip ( this, CUI_RES( FL_TIP ) ), - aFTTitle ( this, CUI_RES( FT_TITLE ) ), - aEdtName ( this, CUI_RES( EDT_NAME ) ), - aFTLineEndStyle ( this, CUI_RES( FT_LINE_END_STYLE ) ), - aLbLineEnds ( this, CUI_RES( LB_LINEENDS ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - aFiTip ( this, CUI_RES( FI_TIP ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - + SfxTabPage( pParent + , "LineEndPage" + , "cui/ui/lineendstabpage.ui" + , rInAttrs ), rOutAttrs ( rInAttrs ), - pPolyObj( NULL ), + pPolyObj ( NULL ), pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), aXLStyle ( XLINE_SOLID ), @@ -78,9 +67,16 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage aXColor ( String(), COL_BLACK ), aXLineAttr ( pXPool ), rXLSet ( aXLineAttr.GetItemSet() ), - pLineEndList( NULL ) + pLineEndList ( NULL ) { - FreeResource(); + get(m_pEdtName,"EDT_NAME"); + get(m_pLbLineEnds,"LB_LINEENDS"); + get(m_pBtnAdd,"BTN_ADD"); + get(m_pBtnModify,"BTN_MODIFY"); + get(m_pBtnDelete,"BTN_DELETE"); + get(m_pBtnLoad,"BTN_LOAD"); + get(m_pBtnSave,"BTN_SAVE"); + get(m_pCtlPreview,"CTL_PREVIEW"); // this page needs ExchangeSupport SetExchangeSupport(); @@ -88,29 +84,20 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage rXLSet.Put( aXLStyle ); rXLSet.Put( aXWidth ); rXLSet.Put( aXColor ); - rXLSet.Put( XLineStartWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) ); - rXLSet.Put( XLineEndWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) ); + rXLSet.Put( XLineStartWidthItem( m_pCtlPreview->GetOutputSize().Height() / 2 ) ); + rXLSet.Put( XLineEndWidthItem( m_pCtlPreview->GetOutputSize().Height() / 2 ) ); // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aBtnAdd.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl ) ); - - aLbLineEnds.SetSelectHdl( - LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) ); - - aBtnAdd.SetAccessibleRelationMemberOf(&aFlTip); - aBtnModify.SetAccessibleRelationMemberOf(&aFlTip); - aBtnDelete.SetAccessibleRelationMemberOf(&aFlTip); + m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet()); + + m_pBtnAdd->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickAddHdl_Impl ) ); + m_pBtnModify->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl ) ); + m_pBtnDelete->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl ) ); + m_pBtnLoad->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl ) ); + m_pBtnSave->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl ) ); + + m_pLbLineEnds->SetSelectHdl( LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) ); + } //------------------------------------------------------------------------ @@ -123,7 +110,7 @@ SvxLineEndDefTabPage::~SvxLineEndDefTabPage() void SvxLineEndDefTabPage::Construct() { - aLbLineEnds.Fill( pLineEndList ); + m_pLbLineEnds->Fill( pLineEndList ); bool bCreateArrowPossible = true; @@ -144,7 +131,7 @@ void SvxLineEndDefTabPage::Construct() } if( !bCreateArrowPossible ) - aBtnAdd.Disable(); + m_pBtnAdd->Disable(); } // ----------------------------------------------------------------------- @@ -158,7 +145,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& ) { if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND ) { - aLbLineEnds.SelectEntryPos( *pPosLineEndLb ); + m_pLbLineEnds->SelectEntryPos( *pPosLineEndLb ); SelectLineEndHdl_Impl( this ); } INetURLObject aURL( pLineEndList->GetPath() ); @@ -187,22 +174,21 @@ int SvxLineEndDefTabPage::DeactivatePage( SfxItemSet* _pSet ) void SvxLineEndDefTabPage::CheckChanges_Impl() { - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); + sal_uInt16 nPos = m_pLbLineEnds->GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { - String aString = aEdtName.GetText(); + OUString aString = m_pEdtName->GetText(); - if( aString != aLbLineEnds.GetSelectEntry() ) + if( aString != m_pLbLineEnds->GetSelectEntry() ) { - QueryBox aQueryBox( GetParentDialog(), WinBits( WB_YES_NO | WB_DEF_NO ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_LINEEND ) ); + QueryBox aQueryBox( GetParentDialog(), WinBits( WB_YES_NO | WB_DEF_NO ), CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_LINEEND ) ); if ( aQueryBox.Execute() == RET_YES ) ClickModifyHdl_Impl( this ); } } - nPos = aLbLineEnds.GetSelectEntryPos(); + nPos = m_pLbLineEnds->GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) *pPosLineEndLb = nPos; @@ -218,7 +204,7 @@ sal_Bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet& rSet ) { CheckChanges_Impl(); - long nPos = aLbLineEnds.GetSelectEntryPos(); + long nPos = m_pLbLineEnds->GetSelectEntryPos(); XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); rSet.Put( XLineStartItem( pEntry->GetName(), pEntry->GetLineEnd() ) ); @@ -232,45 +218,44 @@ sal_Bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet& rSet ) void SvxLineEndDefTabPage::Reset( const SfxItemSet& ) { - aLbLineEnds.SelectEntryPos( 0 ); + m_pLbLineEnds->SelectEntryPos( 0 ); // Update lineend if( pLineEndList->Count() > 0 ) { - int nPos = aLbLineEnds.GetSelectEntryPos(); + int nPos = m_pLbLineEnds->GetSelectEntryPos(); XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - aEdtName.SetText( aLbLineEnds.GetSelectEntry() ); + m_pEdtName->SetText( m_pLbLineEnds->GetSelectEntry() ); - rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) ); - rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) ); + rXLSet.Put( XLineStartItem( OUString(), pEntry->GetLineEnd() ) ); + rXLSet.Put( XLineEndItem( OUString(), pEntry->GetLineEnd() ) ); // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); + m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet()); - aCtlPreview.Invalidate(); + m_pCtlPreview->Invalidate(); } // determine button state if( pLineEndList->Count() ) { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); + m_pBtnModify->Enable(); + m_pBtnDelete->Enable(); + m_pBtnSave->Enable(); } else { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); + m_pBtnModify->Disable(); + m_pBtnDelete->Disable(); + m_pBtnSave->Disable(); } } // ----------------------------------------------------------------------- -SfxTabPage* SvxLineEndDefTabPage::Create( Window* pWindow, - const SfxItemSet& rSet ) +SfxTabPage* SvxLineEndDefTabPage::Create( Window* pWindow, const SfxItemSet& rSet ) { return( new SvxLineEndDefTabPage( pWindow, rSet ) ); } @@ -281,19 +266,19 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) { if( pLineEndList->Count() > 0 ) { - int nPos = aLbLineEnds.GetSelectEntryPos(); + int nPos = m_pLbLineEnds->GetSelectEntryPos(); XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - aEdtName.SetText( aLbLineEnds.GetSelectEntry() ); + m_pEdtName->SetText( m_pLbLineEnds->GetSelectEntry() ); - rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) ); - rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) ); + rXLSet.Put( XLineStartItem( OUString(), pEntry->GetLineEnd() ) ); + rXLSet.Put( XLineEndItem( OUString(), pEntry->GetLineEnd() ) ); // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); + m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet()); - aCtlPreview.Invalidate(); + m_pCtlPreview->Invalidate(); // Is not set before, in order to only take the new style, // if there is an entry selected in the ListBox @@ -306,7 +291,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) long SvxLineEndDefTabPage::ChangePreviewHdl_Impl( void* ) { - aCtlPreview.Invalidate(); + m_pCtlPreview->Invalidate(); return( 0L ); } @@ -314,13 +299,13 @@ long SvxLineEndDefTabPage::ChangePreviewHdl_Impl( void* ) IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl) { - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); + sal_uInt16 nPos = m_pLbLineEnds->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { ResMgr& rMgr = CUI_MGR(); - String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); - String aName( aEdtName.GetText() ); + OUString aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); + String aName( m_pEdtName->GetText() ); long nCount = pLineEndList->Count(); sal_Bool bDifferent = sal_True; @@ -332,8 +317,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl) // if yes, repeat and demand a new name if ( !bDifferent ) { - WarningBox aWarningBox( GetParentDialog(), WinBits( WB_OK ), - String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); + WarningBox aWarningBox( GetParentDialog(), WinBits( WB_OK ), OUString( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); aWarningBox.Execute(); @@ -367,12 +351,12 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl) { const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - aEdtName.SetText( aName ); + m_pEdtName->SetText( aName ); const XLineEndEntry aEntry(pEntry->GetLineEnd(), aName); - aLbLineEnds.Modify( aEntry, nPos, pLineEndList->GetUiBitmap( nPos ) ); - aLbLineEnds.SelectEntryPos( nPos ); + m_pLbLineEnds->Modify( aEntry, nPos, pLineEndList->GetUiBitmap( nPos ) ); + m_pLbLineEnds->SelectEntryPos( nPos ); *pnLineEndListState |= CT_MODIFIED; @@ -415,16 +399,15 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon)); // normalize - aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix( - -aNewRange.getMinX(), -aNewRange.getMinY())); + aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix( -aNewRange.getMinX(), -aNewRange.getMinY())); SdrObject::Free( pConvPolyObj ); XLineEndEntry* pEntry; ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_LINEEND ) ); - String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); + OUString aNewName( SVX_RES( RID_SVXSTR_LINEEND ) ); + OUString aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); String aName; long nCount = pLineEndList->Count(); @@ -469,8 +452,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) pLineEndList->Insert( pEntry, nLineEndCount ); // add to the ListBox - aLbLineEnds.Append( *pEntry, pLineEndList->GetUiBitmap( nLineEndCount ) ); - aLbLineEnds.SelectEntryPos( aLbLineEnds.GetEntryCount() - 1 ); + m_pLbLineEnds->Append( *pEntry, pLineEndList->GetUiBitmap( nLineEndCount ) ); + m_pLbLineEnds->SelectEntryPos( m_pLbLineEnds->GetEntryCount() - 1 ); *pnLineEndListState |= CT_MODIFIED; @@ -478,7 +461,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) } else { - WarningBox aBox( GetParentDialog(), WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); + WarningBox aBox( GetParentDialog(), WinBits( WB_OK ), OUString( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); aBox.Execute(); } @@ -486,14 +469,14 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) delete pDlg; } else - aBtnAdd.Disable(); + m_pBtnAdd->Disable(); // determine button state if ( pLineEndList->Count() ) { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); + m_pBtnModify->Enable(); + m_pBtnDelete->Enable(); + m_pBtnSave->Enable(); } return( 0L ); } @@ -502,18 +485,17 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl) { - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); + sal_uInt16 nPos = m_pLbLineEnds->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - QueryBox aQueryBox( GetParentDialog(), WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_LINEEND ) ) ); + QueryBox aQueryBox( GetParentDialog(), WinBits( WB_YES_NO | WB_DEF_NO ), OUString( CUI_RES( RID_SVXSTR_ASK_DEL_LINEEND ) ) ); if ( aQueryBox.Execute() == RET_YES ) { delete pLineEndList->Remove( nPos ); - aLbLineEnds.RemoveEntry( nPos ); - aLbLineEnds.SelectEntryPos( 0 ); + m_pLbLineEnds->RemoveEntry( nPos ); + m_pLbLineEnds->SelectEntryPos( 0 ); SelectLineEndHdl_Impl( this ); *pPageType = 0; // LineEnd shall not be taken over @@ -526,9 +508,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl) // determine button state if( !pLineEndList->Count() ) { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); + m_pBtnModify->Disable(); + m_pBtnDelete->Disable(); + m_pBtnSave->Disable(); } return( 0L ); } @@ -542,8 +524,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) if ( *pnLineEndListState & CT_MODIFIED ) { - nReturn = WarningBox( GetParentDialog(), WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); + nReturn = WarningBox( GetParentDialog(), WinBits( WB_YES_NO_CANCEL ), OUString( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); if ( nReturn == RET_YES ) pLineEndList->Save(); @@ -551,10 +532,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) if ( nReturn != RET_CANCEL ) { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( "*.soe" ); + ::sfx2::FileDialogHelper aDlg(com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.soe" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -567,15 +546,14 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) aPathURL.removeSegment(); aPathURL.removeFinalSlash(); - XLineEndListRef pLeList = XPropertyList::CreatePropertyList( - XLINE_END_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ) )->AsLineEndList(); + XLineEndListRef pLeList = XPropertyList::CreatePropertyList(XLINE_END_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ) )->AsLineEndList(); pLeList->SetName( aURL.getName() ); if( pLeList->Load() ) { pLineEndList = pLeList; ( (SvxLineTabDialog*) GetParentDialog() )->SetNewLineEndList( pLineEndList ); - aLbLineEnds.Clear(); - aLbLineEnds.Fill( pLineEndList ); + m_pLbLineEnds->Clear(); + m_pLbLineEnds->Fill( pLineEndList ); Reset( rOutAttrs ); pLineEndList->SetName( aURL.getName() ); @@ -584,23 +562,22 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) *pnLineEndListState &= ~CT_MODIFIED; } else - ErrorBox( GetParentDialog(), WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); + ErrorBox( GetParentDialog(), WinBits( WB_OK ), OUString( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); } } // determine button state if ( pLineEndList->Count() ) { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); + m_pBtnModify->Enable(); + m_pBtnDelete->Enable(); + m_pBtnSave->Enable(); } else { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); + m_pBtnModify->Disable(); + m_pBtnDelete->Disable(); + m_pBtnSave->Disable(); } return( 0L ); } @@ -609,9 +586,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( "*.soe" ); + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); + OUString aStrFilterType( "*.soe" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); @@ -622,7 +598,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) aFile.Append( pLineEndList->GetName() ); if( aFile.getExtension().isEmpty() ) - aFile.SetExtension( OUString("soe") ); + aFile.SetExtension( "soe" ); } aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -644,8 +620,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) } else { - ErrorBox( GetParentDialog(), WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); + ErrorBox( GetParentDialog(), WinBits( WB_OK ), OUString( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); } } return( 0L ); @@ -657,10 +632,10 @@ void SvxLineEndDefTabPage::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - sal_uInt16 nOldSelect = aLbLineEnds.GetSelectEntryPos(); - aLbLineEnds.Clear(); - aLbLineEnds.Fill( pLineEndList ); - aLbLineEnds.SelectEntryPos( nOldSelect ); + sal_uInt16 nOldSelect = m_pLbLineEnds->GetSelectEntryPos(); + m_pLbLineEnds->Clear(); + m_pLbLineEnds->Fill( pLineEndList ); + m_pLbLineEnds->SelectEntryPos( nOldSelect ); } } diff --git a/cui/uiconfig/ui/lineendstabpage.ui b/cui/uiconfig/ui/lineendstabpage.ui new file mode 100644 index 000000000000..505c08fd0e35 --- /dev/null +++ b/cui/uiconfig/ui/lineendstabpage.ui @@ -0,0 +1,262 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">res/sc05501.png</property> + </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">res/sc05502.png</property> + </object> + <object class="GtkFrame" id="LineEndPage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</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="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="FT_TITLE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Title:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">EDT_NAME</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="GtkLabel" id="FT_LINE_END_STYLE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Arrow _style:</property> + <property name="use_underline">True</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="GtkEntry" id="EDT_NAME"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">•</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="svxlo-LineEndLB" id="LB_LINEENDS"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="BTN_ADD"> + <property name="label">gtk-add</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="use_underline">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="BTN_MODIFY"> + <property name="label" translatable="yes">_Modify</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="use_underline">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="BTN_DELETE"> + <property name="label">gtk-delete</property> + <property name="visible">True</property> + <property name="can_focus">False</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> + <child> + <object class="GtkButton" id="BTN_LOAD"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Load arrow styles</property> + <property name="tooltip_text" translatable="yes">Load arrow styles</property> + <property name="halign">center</property> + <property name="hexpand">True</property> + <property name="image">image1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="BTN_SAVE"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Save arrow styles</property> + <property name="tooltip_text" translatable="yes">Save arrow styles</property> + <property name="halign">center</property> + <property name="hexpand">True</property> + <property name="image">image2</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="FI_TIP"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Add a selected object to create new arrow styles.</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">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="xalign">0</property> + <property name="label" translatable="yes">Organize arrow styles</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> +</interface> |