From 7209372b00ad922e6e398c0a92dd098cca1d436a Mon Sep 17 00:00:00 2001 From: Palenik Mihály Date: Fri, 21 Mar 2014 11:34:55 +0100 Subject: Convert RID_SVX_MDLG_FONTWORK_GALLERY to .ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I18c02b6c1f9ea9642d3f04092f7df4dcc9d92990 Reviewed-on: https://gerrit.libreoffice.org/8689 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- svx/UIConfig_svx.mk | 1 + svx/inc/fontworkgallery.hrc | 9 --- svx/inc/helpid.hrc | 1 - svx/source/tbxctrls/fontworkgallery.cxx | 36 +++++---- svx/source/tbxctrls/fontworkgallery.src | 61 --------------- svx/uiconfig/ui/fontworkgallerydialog.ui | 124 +++++++++++++++++++++++++++++++ 6 files changed, 142 insertions(+), 90 deletions(-) create mode 100644 svx/uiconfig/ui/fontworkgallerydialog.ui (limited to 'svx') diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 731169894a3f..8f30b32eefbc 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -25,6 +25,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/deletefooterdialog \ svx/uiconfig/ui/extrustiondepthdialog \ svx/uiconfig/ui/findreplacedialog \ + svx/uiconfig/ui/fontworkgallerydialog \ svx/uiconfig/ui/fontworkspacingdialog \ svx/uiconfig/ui/headfootformatpage \ svx/uiconfig/ui/linkwarndialog \ diff --git a/svx/inc/fontworkgallery.hrc b/svx/inc/fontworkgallery.hrc index 4946a8ce4be0..115abb4f0245 100644 --- a/svx/inc/fontworkgallery.hrc +++ b/svx/inc/fontworkgallery.hrc @@ -18,15 +18,6 @@ */ #include -#define FL_FAVORITES 1 -#define CTL_FAVORITES 2 -#define BTN_OK 3 -#define BTN_CANCEL 4 -#define BTN_HELP 9 - -#define STR_CLICK_TO_ADD_TEXT 1 - - #define STR_ALIGN_LEFT 1 #define STR_ALIGN_CENTER 2 #define STR_ALIGN_RIGHT 3 diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index 0c1f040be84c..c868e8cdb363 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -44,7 +44,6 @@ #define HID_CONTDLG_TOOLBOX "SVX_HID_CONTDLG_TOOLBOX" #define HID_CONTDLG_UNDO "SVX_HID_CONTDLG_UNDO" #define HID_CONTDLG_WORKPLACE "SVX_HID_CONTDLG_WORKPLACE" -#define HID_CTL_FONTWORK_FAVORITES "SVX_HID_CTL_FONTWORK_FAVORITES" #define HID_CTRL3D_HSCROLL "SVX_HID_CTRL3D_HSCROLL" #define HID_CTRL3D_SWITCHER "SVX_HID_CTRL3D_SWITCHER" #define HID_CTRL3D_VSCROLL "SVX_HID_CTRL3D_VSCROLL" diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 29cfb35ee34c..ea03126902b9 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -72,27 +72,25 @@ const int nLineCount = 4; |* Svx3DWin - FloatingWindow \************************************************************************/ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, Window* pParent, sal_uInt16 /*nSID*/ ) : - ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ), - maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ), - maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ), - maOKButton ( this, SVX_RES( BTN_OK ) ), - maCancelButton ( this, SVX_RES( BTN_CANCEL ) ), - maHelpButton ( this, SVX_RES( BTN_HELP ) ), + ModalDialog(pParent, "FontworkGalleryDialog", "svx/ui/fontworkgallerydialog.ui" ), mnThemeId ( 0xffff ), mpSdrView ( pSdrView ), mpModel ( (FmFormModel*)pSdrView->GetModel() ), - maStrClickToAddText ( SVX_RESSTR( STR_CLICK_TO_ADD_TEXT ) ), mppSdrObject ( NULL ), mpDestModel ( NULL ) { - FreeResource(); + get(mpOKButton, "ok"); + get(mpCtlFavorites, "ctlFavorites"); + Size aSize(LogicToPixel(Size(200, 200), MAP_APPFONT)); + mpCtlFavorites->set_width_request(aSize.Width()); + mpCtlFavorites->set_height_request(aSize.Height()); - maCtlFavorites.SetDoubleClickHdl( LINK( this, FontWorkGalleryDialog, DoubleClickFavoriteHdl ) ); - maOKButton.SetClickHdl( LINK( this, FontWorkGalleryDialog, ClickOKHdl ) ); + mpCtlFavorites->SetDoubleClickHdl( LINK( this, FontWorkGalleryDialog, DoubleClickFavoriteHdl ) ); + mpOKButton->SetClickHdl( LINK( this, FontWorkGalleryDialog, ClickOKHdl ) ); - maCtlFavorites.SetColCount( nColCount ); - maCtlFavorites.SetLineCount( nLineCount ); - maCtlFavorites.SetExtraSpacing( 3 ); + mpCtlFavorites->SetColCount( nColCount ); + mpCtlFavorites->SetLineCount( nLineCount ); + mpCtlFavorites->SetExtraSpacing( 3 ); initFavorites( GALLERY_THEME_FONTWORK ); fillFavorites( GALLERY_THEME_FONTWORK ); @@ -162,7 +160,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId) { mnThemeId = nThemeId; - Size aThumbSize( maCtlFavorites.GetSizePixel() ); + Size aThumbSize( mpCtlFavorites->GetSizePixel() ); aThumbSize.Width() /= nColCount; aThumbSize.Height() /= nLineCount; aThumbSize.Width() -= 12; @@ -173,12 +171,12 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId) // ValueSet Favoriten if( nFavCount > (nColCount * nLineCount) ) { - WinBits nWinBits = maCtlFavorites.GetStyle(); + WinBits nWinBits = mpCtlFavorites->GetStyle(); nWinBits |= WB_VSCROLL; - maCtlFavorites.SetStyle( nWinBits ); + mpCtlFavorites->SetStyle( nWinBits ); } - maCtlFavorites.Clear(); + mpCtlFavorites->Clear(); sal_uInt32 nFavorite; for( nFavorite = 1; nFavorite <= nFavCount; nFavorite++ ) @@ -187,7 +185,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId) aStr += " "; aStr += OUString::number((sal_Int32)nFavorite); Image aThumbImage( maFavoritesHorizontal[nFavorite-1] ); - maCtlFavorites.InsertItem( (sal_uInt16)nFavorite, aThumbImage, aStr ); + mpCtlFavorites->InsertItem( (sal_uInt16)nFavorite, aThumbImage, aStr ); } } @@ -199,7 +197,7 @@ void FontWorkGalleryDialog::SetSdrObjectRef( SdrObject** ppSdrObject, SdrModel* void FontWorkGalleryDialog::insertSelectedFontwork() { - sal_uInt16 nItemId = maCtlFavorites.GetSelectItemId(); + sal_uInt16 nItemId = mpCtlFavorites->GetSelectItemId(); if( nItemId > 0 ) { diff --git a/svx/source/tbxctrls/fontworkgallery.src b/svx/source/tbxctrls/fontworkgallery.src index 9e049a97c037..dbefa6020655 100644 --- a/svx/source/tbxctrls/fontworkgallery.src +++ b/svx/source/tbxctrls/fontworkgallery.src @@ -22,69 +22,8 @@ #include "fontworkgallery.hrc" #include "svtools/controldims.hrc" -#define WIDTH 256 -#define HEIGHT 256 - #define MASKCOLOR MaskColor = Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }; -ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY -{ - HelpID = "svx:ModalDialog:RID_SVX_MDLG_FONTWORK_GALLERY"; - OutputSize = TRUE; - SVLook = TRUE ; - Moveable = TRUE; - Closeable = TRUE; - - Size = MAP_APPFONT( WIDTH, HEIGHT ); - - Text [ en-US ] = "Fontwork Gallery" ; - - FixedLine FL_FAVORITES - { - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( WIDTH - 6 , 8 ) ; - Text [ en-US ] = "Select a Fontwork style:" ; - }; - Control CTL_FAVORITES - { - HelpId = HID_CTL_FONTWORK_FAVORITES ; - Border = FALSE ; - Pos = MAP_APPFONT ( 3 , 14 ) ; - Size = MAP_APPFONT ( WIDTH - 6, - HEIGHT - RSC_CD_PUSHBUTTON_HEIGHT - - 6 - RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - OkButton BTN_OK - { - Pos = MAP_APPFONT ( WIDTH - 3 * RSC_CD_PUSHBUTTON_WIDTH - 9 , - HEIGHT - 3 - RSC_CD_PUSHBUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH, - RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( WIDTH - 2 * RSC_CD_PUSHBUTTON_WIDTH - 6 , - HEIGHT - 3 - RSC_CD_PUSHBUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH, - RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( WIDTH - 1 * RSC_CD_PUSHBUTTON_WIDTH - 3 , - HEIGHT - 3 - RSC_CD_PUSHBUTTON_HEIGHT ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH, - RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - String STR_CLICK_TO_ADD_TEXT - { - Text [ en-US ] = "Click to edit text" ; - }; -}; - DockingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT { HelpID = "svx:DockingWindow:RID_SVXFLOAT_FONTWORK_ALIGNMENT"; diff --git a/svx/uiconfig/ui/fontworkgallerydialog.ui b/svx/uiconfig/ui/fontworkgallerydialog.ui new file mode 100644 index 000000000000..0a52026a8182 --- /dev/null +++ b/svx/uiconfig/ui/fontworkgallerydialog.ui @@ -0,0 +1,124 @@ + + + + + + + False + 6 + Fontwork Gallery + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + False + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + False + True + True + True + True + + + False + True + 1 + + + + + gtk-help + False + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + + + + + + + True + False + Select a Fontwork style + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit