diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-22 14:10:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-22 14:11:59 +0000 |
commit | 07b303bc14d33619782fcfef0c7d94b14b1a1e55 (patch) | |
tree | bc713524e8400a69da77202ee869d9e5a4dc05ff | |
parent | e854d5d678982c120657b29c4fb20ef38ba76b27 (diff) |
convert RID_SVXFLOAT_EXTRUSION_LIGHTING resource to strings and images
Change-Id: Id3fbaf931bcb08785d76c8404cd77f22440d8de9
-rw-r--r-- | include/svx/dialogs.hrc | 13 | ||||
-rw-r--r-- | svx/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.cxx | 61 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.hrc | 12 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.src | 352 |
5 files changed, 216 insertions, 223 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index e8fd38c32955..c95447cd5eb3 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -880,8 +880,6 @@ #define RID_SVX_EXTRUSION_BAR (RID_SVX_START + 986) #define RID_SVX_FONTWORK_BAR (RID_SVX_START + 987) -#define RID_SVXFLOAT_EXTRUSION_LIGHTING (RID_SVX_START + 989) - #define RID_SVXSTR_EXTRUSION_COLOR (RID_SVX_START + 991) #define RID_SVXSTR_DEPTH_0 (RID_SVX_START + 992) @@ -1077,9 +1075,18 @@ #define RID_SVXSTR_DIRECTION (RID_SVX_START + 1320) // needs 10 resource ids #define RID_SVXSTR_PERSPECTIVE (RID_SVX_START + 1330) #define RID_SVXSTR_PARALLEL (RID_SVX_START + 1331) +#define RID_SVXSTR_BRIGHT (RID_SVX_START + 1332) +#define RID_SVXSTR_NORMAL (RID_SVX_START + 1333) +#define RID_SVXSTR_DIM (RID_SVX_START + 1334) +#define RID_SVXIMG_LIGHT_OFF (RID_SVX_START + 1335) // needs 10 resource ids +#define RID_SVXIMG_LIGHT_ON (RID_SVX_START + 1345) // needs 10 resource ids +#define RID_SVXIMG_LIGHT_PREVIEW (RID_SVX_START + 1355) // needs 10 resource ids +#define RID_SVXIMG_LIGHTING_BRIGHT (RID_SVX_START + 1365) +#define RID_SVXIMG_LIGHTING_NORMAL (RID_SVX_START + 1366) +#define RID_SVXIMG_LIGHTING_DIM (RID_SVX_START + 1367) // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!! -#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1332) +#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1368) // if we have _a_lot_ time, we should group the resource ids by type, instead // of grouping them by semantics. The reason is that resource ids have to be diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index 7a8e9bc2676d..588ec7d9d4d2 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -65,7 +65,6 @@ #define HID_GALLERY_RENAME "SVX_HID_GALLERY_RENAME" #define HID_GALLERY_THEMELIST "SVX_HID_GALLERY_THEMELIST" #define HID_GALLERY_WINDOW "SVX_HID_GALLERY_WINDOW" -#define HID_MENU_EXTRUSION_LIGHTING "SVX_HID_MENU_EXTRUSION_LIGHTING" #define HID_MNU_FUNC_AVG "SVX_HID_MNU_FUNC_AVG" #define HID_MNU_FUNC_COUNT "SVX_HID_MNU_FUNC_COUNT" #define HID_MNU_FUNC_COUNT2 "SVX_HID_MNU_FUNC_COUNT2" diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index bd6baeda09e9..bb0062f4ad64 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -509,45 +509,41 @@ Reference< XInterface > SAL_CALL SAL_CALL ExtrusionDepthController_createInstanc return *new ExtrusionDepthController( comphelper::getComponentContext(rSMgr) ); } - - OUString SAL_CALL ExtrusionDepthController::getImplementationName( ) throw (RuntimeException, std::exception) { return ExtrusionDepthController_getImplementationName(); } - - Sequence< OUString > SAL_CALL ExtrusionDepthController::getSupportedServiceNames( ) throw (RuntimeException, std::exception) { return ExtrusionDepthController_getSupportedServiceNames(); } -ExtrusionLightingWindow::ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, vcl::Window* pParentWindow ) -: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_LIGHTING )) -, mrController( rController ) -, maImgBright( SVX_RES( IMG_LIGHTING_BRIGHT ) ) -, maImgNormal( SVX_RES( IMG_LIGHTING_NORMAL ) ) -, maImgDim( SVX_RES( IMG_LIGHTING_DIM ) ) -, mnLevel( 0 ) -, mbLevelEnabled( false ) -, mnDirection( FROM_FRONT ) -, mbDirectionEnabled( false ) -, msExtrusionLightingDirection( ".uno:ExtrusionLightingDirection" ) -, msExtrusionLightingIntensity( ".uno:ExtrusionLightingIntensity" ) -{ - sal_uInt16 i; - for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ ) +ExtrusionLightingWindow::ExtrusionLightingWindow(svt::ToolboxController& rController, + const css::uno::Reference<css::frame::XFrame >& rFrame, + vcl::Window* pParentWindow) + : ToolbarMenu(rFrame, pParentWindow, WB_MOVEABLE|WB_CLOSEABLE|WB_HIDE|WB_3DLOOK) + , mrController(rController) + , maImgBright(SVX_RES(RID_SVXIMG_LIGHTING_BRIGHT)) + , maImgNormal(SVX_RES(RID_SVXIMG_LIGHTING_NORMAL)) + , maImgDim(SVX_RES(RID_SVXIMG_LIGHTING_DIM)) + , mnLevel(0) + , mbLevelEnabled(false) + , mnDirection(FROM_FRONT) + , mbDirectionEnabled(false) + , msExtrusionLightingDirection(".uno:ExtrusionLightingDirection") + , msExtrusionLightingIntensity(".uno:ExtrusionLightingIntensity") +{ + for (sal_uInt16 i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; ++i) { if( i != FROM_FRONT ) { - maImgLightingOff[ i ] = Image( SVX_RES( IMG_LIGHT_OFF + i ) ); - maImgLightingOn[ i ] = Image( SVX_RES( IMG_LIGHT_ON + i ) ); + maImgLightingOff[i] = Image(SVX_RES(RID_SVXIMG_LIGHT_OFF + i)); + maImgLightingOn[i] = Image(SVX_RES(RID_SVXIMG_LIGHT_ON + i)); } - maImgLightingPreview[i] = Image( SVX_RES( IMG_LIGHT_PREVIEW + i ) ); + maImgLightingPreview[i] = Image(SVX_RES(RID_SVXIMG_LIGHT_PREVIEW + i)); } - SetHelpId( HID_MENU_EXTRUSION_LIGHTING ); SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) ); mpLightingSet = createEmptyValueSetControl(); @@ -557,7 +553,7 @@ ExtrusionLightingWindow::ExtrusionLightingWindow( svt::ToolboxController& rContr mpLightingSet->SetColCount( 3 ); mpLightingSet->EnableFullItemMode( false ); - for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ ) + for (sal_uInt16 i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; ++i) { if( i != FROM_FRONT ) { @@ -570,36 +566,29 @@ ExtrusionLightingWindow::ExtrusionLightingWindow( svt::ToolboxController& rContr } mpLightingSet->SetOutputSizePixel( Size( 72, 72 ) ); - appendEntry( 3, mpLightingSet ); + appendEntry(3, mpLightingSet); appendSeparator(); - appendEntry( 0, SVX_RESSTR( STR_BRIGHT ), maImgBright ); - appendEntry( 1, SVX_RESSTR( STR_NORMAL ), maImgNormal ); - appendEntry( 2, SVX_RESSTR( STR_DIM ), maImgDim ); + appendEntry(0, SVX_RESSTR(RID_SVXSTR_BRIGHT), maImgBright); + appendEntry(1, SVX_RESSTR(RID_SVXSTR_NORMAL), maImgNormal); + appendEntry(2, SVX_RESSTR(RID_SVXSTR_DIM), maImgDim); SetOutputSizePixel( getMenuSize() ); - FreeResource(); - AddStatusListener( msExtrusionLightingDirection ); AddStatusListener( msExtrusionLightingIntensity ); } - - void ExtrusionLightingWindow::implSetIntensity( int nLevel, bool bEnabled ) { mnLevel = nLevel; mbLevelEnabled = bEnabled; - int i = 0; - for( i = 0; i < 3; i++ ) + for (int i = 0; i < 3; ++i) { checkEntry( i, (i == nLevel) && bEnabled ); enableEntry( i, bEnabled ); } } - - void ExtrusionLightingWindow::implSetDirection( int nDirection, bool bEnabled ) { mnDirection = nDirection; diff --git a/svx/source/tbxctrls/extrusioncontrols.hrc b/svx/source/tbxctrls/extrusioncontrols.hrc index 07b9ca367496..2ed1970bcf34 100644 --- a/svx/source/tbxctrls/extrusioncontrols.hrc +++ b/svx/source/tbxctrls/extrusioncontrols.hrc @@ -39,16 +39,4 @@ #define DIRECTION_S 7 #define DIRECTION_SE 8 -#define STR_BRIGHT 15 -#define STR_NORMAL 16 -#define STR_DIM 17 - -#define IMG_LIGHT_OFF 50 // needs 10 resource ids -#define IMG_LIGHT_ON 60 // needs 10 resource ids -#define IMG_LIGHT_PREVIEW 70 // needs 10 resource ids - -#define IMG_LIGHTING_BRIGHT 110 -#define IMG_LIGHTING_NORMAL 111 -#define IMG_LIGHTING_DIM 112 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/extrusioncontrols.src b/svx/source/tbxctrls/extrusioncontrols.src index 2c74bd42f6f1..157cc9048104 100644 --- a/svx/source/tbxctrls/extrusioncontrols.src +++ b/svx/source/tbxctrls/extrusioncontrols.src @@ -143,177 +143,187 @@ String RID_SVXSTR_DIRECTION + DIRECTION_SE Text [ en-US ] = "Extrusion South-East"; }; -DockingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING -{ - HelpID = "svx:DockingWindow:RID_SVXFLOAT_EXTRUSION_LIGHTING"; - Border = FALSE ; - Hide = TRUE ; - SVLook = TRUE ; - Sizeable = FALSE ; - Moveable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - - Text [ en-US ] = "Extrusion Lighting" ; - - Image IMG_LIGHT_OFF + FROM_TOP_LEFT - { - ImageBitmap = Bitmap { File = "lightofffromtopleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_TOP - { - ImageBitmap = Bitmap { File = "lightofffromtop_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_TOP_RIGHT - { - ImageBitmap = Bitmap { File = "lightofffromtopright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_LEFT - { - ImageBitmap = Bitmap { File = "lightofffromleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_RIGHT - { - ImageBitmap = Bitmap { File = "lightofffromright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_BOTTOM_LEFT - { - ImageBitmap = Bitmap { File = "lightofffrombottomleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_BOTTOM - { - ImageBitmap = Bitmap { File = "lightofffrombottom_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_OFF + FROM_BOTTOM_RIGHT - { - ImageBitmap = Bitmap { File = "lightofffrombottomright_22.bmp"; }; - MASKCOLOR - }; - - Image IMG_LIGHT_ON + FROM_TOP_LEFT - { - ImageBitmap = Bitmap { File = "lightonfromtopleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_TOP - { - ImageBitmap = Bitmap { File = "lightonfromtop_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_TOP_RIGHT - { - ImageBitmap = Bitmap { File = "lightonfromtopright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_LEFT - { - ImageBitmap = Bitmap { File = "lightonfromleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_RIGHT - { - ImageBitmap = Bitmap { File = "lightonfromright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_BOTTOM_LEFT - { - ImageBitmap = Bitmap { File = "lightonfrombottomleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_BOTTOM - { - ImageBitmap = Bitmap { File = "lightonfrombottom_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_ON + FROM_BOTTOM_RIGHT - { - ImageBitmap = Bitmap { File = "lightonfrombottomright_22.bmp"; }; - MASKCOLOR - }; - - Image IMG_LIGHT_PREVIEW + FROM_TOP_LEFT - { - ImageBitmap = Bitmap { File = "lightfromtopleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_TOP - { - ImageBitmap = Bitmap { File = "lightfromtop_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_TOP_RIGHT - { - ImageBitmap = Bitmap { File = "lightfromtopright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_LEFT - { - ImageBitmap = Bitmap { File = "lightfromleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_RIGHT - { - ImageBitmap = Bitmap { File = "lightfromright_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_FRONT - { - ImageBitmap = Bitmap { File = "lightfromfront_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_BOTTOM_LEFT - { - ImageBitmap = Bitmap { File = "lightfrombottomleft_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_BOTTOM - { - ImageBitmap = Bitmap { File = "lightfrombottom_22.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHT_PREVIEW + FROM_BOTTOM_RIGHT - { - ImageBitmap = Bitmap { File = "lightfrombottomright_22.bmp"; }; - MASKCOLOR - }; - - Image IMG_LIGHTING_BRIGHT - { - ImageBitmap = Bitmap { File = "brightlit_16.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHTING_NORMAL - { - ImageBitmap = Bitmap { File = "normallit_16.bmp"; }; - MASKCOLOR - }; - Image IMG_LIGHTING_DIM - { - ImageBitmap = Bitmap { File = "dimlit_16.bmp"; }; - MASKCOLOR - }; - - String STR_BRIGHT - { - Text [ en-US ] = "~Bright"; - }; - - String STR_NORMAL - { - Text [ en-US ] = "~Normal"; - }; - - String STR_DIM - { - Text [ en-US ] = "~Dim"; - }; +Image RID_SVXIMG_LIGHT_OFF + FROM_TOP_LEFT +{ + ImageBitmap = Bitmap { File = "lightofffromtopleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_TOP +{ + ImageBitmap = Bitmap { File = "lightofffromtop_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_TOP_RIGHT +{ + ImageBitmap = Bitmap { File = "lightofffromtopright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_LEFT +{ + ImageBitmap = Bitmap { File = "lightofffromleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightofffromright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_BOTTOM_LEFT +{ + ImageBitmap = Bitmap { File = "lightofffrombottomleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_BOTTOM +{ + ImageBitmap = Bitmap { File = "lightofffrombottom_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_OFF + FROM_BOTTOM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightofffrombottomright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_TOP_LEFT +{ + ImageBitmap = Bitmap { File = "lightonfromtopleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_TOP +{ + ImageBitmap = Bitmap { File = "lightonfromtop_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_TOP_RIGHT +{ + ImageBitmap = Bitmap { File = "lightonfromtopright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_LEFT +{ + ImageBitmap = Bitmap { File = "lightonfromleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightonfromright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_BOTTOM_LEFT +{ + ImageBitmap = Bitmap { File = "lightonfrombottomleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_BOTTOM +{ + ImageBitmap = Bitmap { File = "lightonfrombottom_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_ON + FROM_BOTTOM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightonfrombottomright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_TOP_LEFT +{ + ImageBitmap = Bitmap { File = "lightfromtopleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_TOP +{ + ImageBitmap = Bitmap { File = "lightfromtop_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_TOP_RIGHT +{ + ImageBitmap = Bitmap { File = "lightfromtopright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_LEFT +{ + ImageBitmap = Bitmap { File = "lightfromleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightfromright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_FRONT +{ + ImageBitmap = Bitmap { File = "lightfromfront_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_BOTTOM_LEFT +{ + ImageBitmap = Bitmap { File = "lightfrombottomleft_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_BOTTOM +{ + ImageBitmap = Bitmap { File = "lightfrombottom_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHT_PREVIEW + FROM_BOTTOM_RIGHT +{ + ImageBitmap = Bitmap { File = "lightfrombottomright_22.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHTING_BRIGHT +{ + ImageBitmap = Bitmap { File = "brightlit_16.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHTING_NORMAL +{ + ImageBitmap = Bitmap { File = "normallit_16.bmp"; }; + MASKCOLOR +}; + +Image RID_SVXIMG_LIGHTING_DIM +{ + ImageBitmap = Bitmap { File = "dimlit_16.bmp"; }; + MASKCOLOR +}; + +String RID_SVXSTR_BRIGHT +{ + Text [ en-US ] = "~Bright"; +}; + +String RID_SVXSTR_NORMAL +{ + Text [ en-US ] = "~Normal"; +}; + +String RID_SVXSTR_DIM +{ + Text [ en-US ] = "~Dim"; }; String RID_SVXSTR_WIREFRAME |