From efc09e121ceffb0d2c1b841b809277bd6484f1a7 Mon Sep 17 00:00:00 2001 From: Csikós Tamás Date: Fri, 12 Jul 2013 11:16:44 +0200 Subject: modern .ui widgetlayout for frmpage/frmurlpage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia308fa393baffc7f456ba613cb216b427c450ca6 Reviewed-on: https://gerrit.libreoffice.org/4854 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/UIConfig_swriter.mk | 1 + sw/inc/helpid.h | 1 - sw/source/ui/frmdlg/frmpage.cxx | 67 ++++----- sw/source/ui/frmdlg/frmpage.hrc | 10 -- sw/source/ui/frmdlg/frmpage.src | 88 ------------ sw/source/ui/inc/frmpage.hxx | 17 +-- sw/uiconfig/swriter/ui/frmurlpage.ui | 266 +++++++++++++++++++++++++++++++++++ 7 files changed, 304 insertions(+), 146 deletions(-) create mode 100644 sw/uiconfig/swriter/ui/frmurlpage.ui diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 7096808754ad..4cd89abfb59a 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -88,6 +88,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/footnotepage \ sw/uiconfig/swriter/ui/footnoteareapage \ sw/uiconfig/swriter/ui/frmaddpage \ + sw/uiconfig/swriter/ui/frmurlpage \ sw/uiconfig/swriter/ui/indexentry \ sw/uiconfig/swriter/ui/inputfielddialog \ sw/uiconfig/swriter/ui/insertbookmark \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 062ae991a1c3..c82e46e35b83 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -151,7 +151,6 @@ #define HID_LAB_FMT "SW_HID_LAB_FMT" #define HID_ENV_ENV "SW_HID_ENV_ENV" #define HID_ENV_FMT "SW_HID_ENV_FMT" -#define HID_FRM_URL "SW_HID_FRM_URL" #define HID_COND_COLL "SW_HID_COND_COLL" #define HID_FLD_DB "SW_HID_FLD_DB" diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 210293f665fe..4240747b2a84 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2599,22 +2599,17 @@ void BmpWindow::SetGraphic(const Graphic& rGrf) Description: set URL and ImageMap at frames ***************************************************************************/ SwFrmURLPage::SwFrmURLPage( Window *pParent, const SfxItemSet &rSet ) : - SfxTabPage(pParent, SW_RES(TP_FRM_URL), rSet), - aHyperLinkFL (this, SW_RES( FL_HYPERLINK )), - aURLFT (this, SW_RES( FT_URL )), - aURLED (this, SW_RES( ED_URL )), - aSearchPB (this, SW_RES( PB_SEARCH )), - aNameFT (this, SW_RES( FT_NAME )), - aNameED (this, SW_RES( ED_NAME )), - aFrameFT (this, SW_RES( FT_FRAME )), - aFrameCB (this, SW_RES( CB_FRAME )), - - aImageFL (this, SW_RES( FL_IMAGE )), - aServerCB (this, SW_RES( CB_SERVER )), - aClientCB (this, SW_RES( CB_CLIENT )) + SfxTabPage(pParent, "FrmURLPage" , "modules/swriter/ui/frmurlpage.ui", rSet) { - FreeResource(); - aSearchPB.SetClickHdl(LINK(this, SwFrmURLPage, InsertFileHdl)); + get(pURLED,"url"); + get(pSearchPB,"search"); + get(pNameED,"name"); + get(pFrameCB,"frame"); + + get(pServerCB,"server"); + get(pClientCB,"client"); + + pSearchPB->SetClickHdl(LINK(this, SwFrmURLPage, InsertFileHdl)); } SwFrmURLPage::~SwFrmURLPage() @@ -2633,7 +2628,7 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet ) size_t nCount = pList->size(); for ( size_t i = 0; i < nCount; i++ ) { - aFrameCB.InsertEntry( *pList->at( i ) ); + pFrameCB->InsertEntry( *pList->at( i ) ); } for ( size_t i = nCount; i; ) { @@ -2646,24 +2641,24 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet ) if ( SFX_ITEM_SET == rSet.GetItemState( RES_URL, sal_True, &pItem ) ) { const SwFmtURL* pFmtURL = (const SwFmtURL*)pItem; - aURLED.SetText( INetURLObject::decode( pFmtURL->GetURL(), + pURLED->SetText( INetURLObject::decode( pFmtURL->GetURL(), INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 )); - aNameED.SetText( pFmtURL->GetName()); + pNameED->SetText( pFmtURL->GetName()); - aClientCB.Enable( pFmtURL->GetMap() != 0 ); - aClientCB.Check ( pFmtURL->GetMap() != 0 ); - aServerCB.Check ( pFmtURL->IsServerMap() ); + pClientCB->Enable( pFmtURL->GetMap() != 0 ); + pClientCB->Check ( pFmtURL->GetMap() != 0 ); + pServerCB->Check ( pFmtURL->IsServerMap() ); - aFrameCB.SetText(pFmtURL->GetTargetFrameName()); - aFrameCB.SaveValue(); + pFrameCB->SetText(pFmtURL->GetTargetFrameName()); + pFrameCB->SaveValue(); } else - aClientCB.Enable( sal_False ); + pClientCB->Enable( sal_False ); - aServerCB.SaveValue(); - aClientCB.SaveValue(); + pServerCB->SaveValue(); + pClientCB->SaveValue(); } sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) @@ -2677,27 +2672,27 @@ sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) pFmtURL = new SwFmtURL(); { - String sText = aURLED.GetText(); + String sText = pURLED->GetText(); if( pFmtURL->GetURL() != sText || - OUString(pFmtURL->GetName()) != aNameED.GetText() || - aServerCB.IsChecked() != pFmtURL->IsServerMap() ) + OUString(pFmtURL->GetName()) != pNameED->GetText() || + pServerCB->IsChecked() != pFmtURL->IsServerMap() ) { - pFmtURL->SetURL( sText, aServerCB.IsChecked() ); - pFmtURL->SetName( aNameED.GetText() ); + pFmtURL->SetURL( sText, pServerCB->IsChecked() ); + pFmtURL->SetName( pNameED->GetText() ); bModified = sal_True; } } - if(!aClientCB.IsChecked() && pFmtURL->GetMap() != 0) + if(!pClientCB->IsChecked() && pFmtURL->GetMap() != 0) { pFmtURL->SetMap(0); bModified = sal_True; } - if(OUString(pFmtURL->GetTargetFrameName()) != aFrameCB.GetText()) + if(OUString(pFmtURL->GetTargetFrameName()) != pFrameCB->GetText()) { - pFmtURL->SetTargetFrameName(aFrameCB.GetText()); + pFmtURL->SetTargetFrameName(pFrameCB->GetText()); bModified = sal_True; } rSet.Put(*pFmtURL); @@ -2717,7 +2712,7 @@ IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl) try { - String sTemp(aURLED.GetText()); + String sTemp(pURLED->GetText()); if(sTemp.Len()) xFP->setDisplayDirectory(sTemp); } @@ -2727,7 +2722,7 @@ IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl) } if( aDlgHelper.Execute() == ERRCODE_NONE ) { - aURLED.SetText( xFP->getFiles().getConstArray()[0] ); + pURLED->SetText( xFP->getFiles().getConstArray()[0] ); } return 0; diff --git a/sw/source/ui/frmdlg/frmpage.hrc b/sw/source/ui/frmdlg/frmpage.hrc index e44fc4271d8d..8e910992c6e3 100644 --- a/sw/source/ui/frmdlg/frmpage.hrc +++ b/sw/source/ui/frmdlg/frmpage.hrc @@ -89,25 +89,15 @@ #define ED_CONNECT 54 #define FL_CONNECT 55 #define FT_CONNECT 57 -#define FT_URL 58 -#define ED_URL 59 #define BMP_EXAMPLE 62 #define RB_MIRROR_ALL_PAGES 64 #define RB_MIRROR_LEFT_PAGES 65 #define RB_MIRROR_RIGHT_PAGES 66 -#define FL_HYPERLINK 94 -#define FT_FRAME 95 -#define CB_FRAME 96 -#define FL_IMAGE 97 -#define CB_SERVER 98 -#define CB_CLIENT 99 - #define CB_REL_WIDTH 100 #define CB_REL_HEIGHT 101 #define CB_FIXEDRATIO 102 -#define PB_SEARCH 103 #define CB_ANCHOR_ONLY 103 diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src index 9223bcecb9ae..55755915f352 100644 --- a/sw/source/ui/frmdlg/frmpage.src +++ b/sw/source/ui/frmdlg/frmpage.src @@ -617,92 +617,4 @@ String STR_EDIT_GRF { Text [ en-US ] = "Link" ; }; - -TabPage TP_FRM_URL -{ - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_FRM_URL ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - FixedText FT_URL - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "~URL" ; - }; - Edit ED_URL - { - HelpID = "sw:Edit:TP_FRM_URL:ED_URL"; - Pos = MAP_APPFONT ( 45 , 14 ) ; - Size = MAP_APPFONT ( 149 , 12 ) ; - Left = TRUE ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "~Name" ; - }; - Edit ED_NAME - { - HelpID = "sw:Edit:TP_FRM_URL:ED_NAME"; - Pos = MAP_APPFONT ( 45 , 30 ) ; - Size = MAP_APPFONT ( 149 , 12 ) ; - Left = TRUE ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_FRAME - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "Frame" ; - }; - ComboBox CB_FRAME - { - HelpID = "sw:ComboBox:TP_FRM_URL:CB_FRAME"; - Pos = MAP_APPFONT ( 45 , 46 ) ; - Size = MAP_APPFONT ( 89 , 50 ) ; - Left = TRUE ; - DropDown = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_SEARCH - { - HelpID = "sw:PushButton:TP_FRM_URL:PB_SEARCH"; - Pos = MAP_APPFONT ( 198 , 13 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Browse..." ; - }; - FixedLine FL_HYPERLINK - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Link to"; - }; - CheckBox CB_SERVER - { - HelpID = "sw:CheckBox:TP_FRM_URL:CB_SERVER"; - Pos = MAP_APPFONT ( 12 , 75 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Server-side image map"; - }; - CheckBox CB_CLIENT - { - HelpID = "sw:CheckBox:TP_FRM_URL:CB_CLIENT"; - Pos = MAP_APPFONT ( 12 , 89 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Client-side image map"; - }; - FixedLine FL_IMAGE - { - Pos = MAP_APPFONT ( 6 , 64 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Image map" ; - }; -}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx index 8b15ed67d351..4a7ab7deb540 100644 --- a/sw/source/ui/inc/frmpage.hxx +++ b/sw/source/ui/inc/frmpage.hxx @@ -241,19 +241,14 @@ public: class SwFrmURLPage : public SfxTabPage { // hyperlink - FixedLine aHyperLinkFL; - FixedText aURLFT; - Edit aURLED; - PushButton aSearchPB; - FixedText aNameFT; - Edit aNameED; - FixedText aFrameFT; - ComboBox aFrameCB; + Edit* pURLED; + PushButton* pSearchPB; + Edit* pNameED; + ComboBox* pFrameCB; // image map - FixedLine aImageFL; - CheckBox aServerCB; - CheckBox aClientCB; + CheckBox* pServerCB; + CheckBox* pClientCB; DECL_LINK(InsertFileHdl, void *); diff --git a/sw/uiconfig/swriter/ui/frmurlpage.ui b/sw/uiconfig/swriter/ui/frmurlpage.ui new file mode 100644 index 000000000000..b079044636ff --- /dev/null +++ b/sw/uiconfig/swriter/ui/frmurlpage.ui @@ -0,0 +1,266 @@ + + + + + True + False + 6 + vertical + 12 + + + True + False + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 6 + 12 + + + True + True + True + + + + 1 + 0 + 1 + 1 + + + + + True + True + True + + + + 1 + 1 + 1 + 1 + + + + + True + False + 0 + _URL: + True + url + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Name: + True + name + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + _Frame: + True + frame + + + 0 + 2 + 1 + 1 + + + + + True + False + start + + + _Browse... + True + True + True + True + + + False + True + 0 + + + + + 2 + 0 + 1 + 1 + + + + + True + False + True + True + 0 + 1 + + + False + + + + + 1 + 2 + 1 + 1 + + + + + + + + + + + + + + + True + False + Link to + + + + + + + + False + True + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 6 + 12 + + + _Server-side image map + True + True + False + True + True + 0 + True + + + 0 + 0 + 1 + 1 + + + + + _Client-side image map + True + True + False + True + True + 0 + True + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Image map + + + + + + + + False + True + 1 + + + + -- cgit