diff options
author | Palenik Mihály <palenik.mihaly@gmail.com> | 2014-03-21 11:34:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 12:24:57 +0000 |
commit | 7209372b00ad922e6e398c0a92dd098cca1d436a (patch) | |
tree | f22e9e03555b9e3c6d98f3611ea7d47c900f3141 /svx/source/tbxctrls | |
parent | Remove unnecessary dynamic_cast (diff) | |
download | core-7209372b00ad922e6e398c0a92dd098cca1d436a.tar.gz core-7209372b00ad922e6e398c0a92dd098cca1d436a.zip |
Convert RID_SVX_MDLG_FONTWORK_GALLERY to .ui
Change-Id: I18c02b6c1f9ea9642d3f04092f7df4dcc9d92990
Reviewed-on: https://gerrit.libreoffice.org/8689
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.cxx | 36 | ||||
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.src | 61 |
2 files changed, 17 insertions, 80 deletions
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"; |