diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-12-08 19:33:42 -0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-09 20:32:52 +0000 |
commit | 56e1133f724896aec3f5b5c409fb5917a3b13eb4 (patch) | |
tree | 480f9aa58416a1caedc6c2a08cad85dda553962c /chart2 | |
parent | 9f87de91cee05656808a98ab1bd65ad9509ef7df (diff) |
Convert chart 3D scene illumination to .ui
Change-Id: I55e56196818e181d16e74ae93376ff4ff1c4c395
Reviewed-on: https://gerrit.libreoffice.org/6998
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/AllLangResTarget_chartcontroller.mk | 1 | ||||
-rw-r--r-- | chart2/UIConfig_chart2.mk | 1 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/Strings.src | 10 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 164 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc | 40 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx | 41 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.src | 172 | ||||
-rw-r--r-- | chart2/source/inc/Strings.hrc | 3 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_3D_SceneIllumination.ui | 331 |
9 files changed, 415 insertions, 348 deletions
diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk index 5a64ac812801..a3affa32b52b 100644 --- a/chart2/AllLangResTarget_chartcontroller.mk +++ b/chart2/AllLangResTarget_chartcontroller.mk @@ -45,7 +45,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ chart2/source/controller/dialogs/Strings_Scale.src \ chart2/source/controller/dialogs/Strings.src \ chart2/source/controller/dialogs/Strings_Statistic.src \ - chart2/source/controller/dialogs/tp_3D_SceneIllumination.src \ chart2/source/controller/dialogs/tp_AxisLabel.src \ chart2/source/controller/dialogs/tp_ChartType.src \ chart2/source/controller/dialogs/tp_DataLabel.src \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 7bf377e2f9ea..a146bf93bcc4 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -39,6 +39,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/titlerotationtabpage \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ + chart2/uiconfig/ui/tp_3D_SceneIllumination \ chart2/uiconfig/ui/tp_axisLabel \ chart2/uiconfig/ui/tp_AxisPositions \ chart2/uiconfig/ui/tp_LegendPosition \ diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src index 1aae59a04ebe..6cea9018127d 100644 --- a/chart2/source/controller/dialogs/Strings.src +++ b/chart2/source/controller/dialogs/Strings.src @@ -384,16 +384,6 @@ String STR_TIP_SELECT_RANGE Text [ en-US ] = "Select data range" ; }; -String STR_TIP_CHOOSECOLOR -{ - Text [ en-US ] = "Select a color using the color dialog" ; -}; - -String STR_TIP_LIGHTSOURCE_X -{ - Text [ en-US ] = "Light Source %LIGHTNUMBER" ; -}; - String STR_TIP_DATASERIES { Text [ en-US ] = "Data Series '%SERIESNAME'" ; diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index 031c593a5995..8fac0226d68c 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -18,9 +18,7 @@ */ #include "tp_3D_SceneIllumination.hxx" -#include "tp_3D_SceneIllumination.hrc" #include "ResId.hxx" -#include "Strings.hrc" #include "Bitmaps.hrc" #include "CommonConverters.hxx" @@ -44,21 +42,16 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -LightButton::LightButton( Window* pParent, const ResId& rResId, sal_Int32 nLightNumber ) - : ImageButton( pParent, rResId ) +LightButton::LightButton( Window* pParent) + : ImageButton( pParent) , m_bLightOn(false) { SetModeImage( Image( SVX_RES(RID_SVXIMAGE_LIGHT_OFF) ) ); +} - OUString aTipHelpStr( SCH_RESSTR(STR_TIP_LIGHTSOURCE_X) ); - const OUString aReplacementStr( "%LIGHTNUMBER" ); - sal_Int32 nIndex = aTipHelpStr.indexOf( aReplacementStr ); - if( nIndex != -1 ) - { - aTipHelpStr = aTipHelpStr.replaceAt(nIndex, aReplacementStr.getLength(), - OUString::number( nLightNumber ) ); - } - this->SetQuickHelpText( aTipHelpStr ); +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLightButton(Window *pParent, VclBuilder::stringmap &) +{ + return new LightButton(pParent); } LightButton::~LightButton() @@ -85,17 +78,6 @@ bool LightButton::isLightOn() const return m_bLightOn; } -ColorButton::ColorButton( Window* pParent, const ResId& rResId ) - : ImageButton( pParent, rResId ) -{ - SetModeImage( Image( SVX_RES(RID_SVXIMAGE_COLORDLG) ) ); - this->SetQuickHelpText( SCH_RESSTR(STR_TIP_CHOOSECOLOR) ); -} - -ColorButton::~ColorButton() -{ -} - struct LightSource { long nDiffuseColor; @@ -258,22 +240,9 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin , const uno::Reference< beans::XPropertySet > & xSceneProperties , const uno::Reference< frame::XModel >& xChartModel , const XColorListRef & pColorTable ) - : TabPage ( pWindow, SchResId( TP_3D_SCENEILLUMINATION ) ) - , m_aFT_LightSource( this, SchResId( FT_LIGHTSOURCE ) ) - , m_aBtn_Light1( this, SchResId( BTN_LIGHT_1 ), 1 ) - , m_aBtn_Light2( this, SchResId( BTN_LIGHT_2 ), 2 ) - , m_aBtn_Light3( this, SchResId( BTN_LIGHT_3 ), 3 ) - , m_aBtn_Light4( this, SchResId( BTN_LIGHT_4 ), 4 ) - , m_aBtn_Light5( this, SchResId( BTN_LIGHT_5 ), 5 ) - , m_aBtn_Light6( this, SchResId( BTN_LIGHT_6 ), 6 ) - , m_aBtn_Light7( this, SchResId( BTN_LIGHT_7 ), 7 ) - , m_aBtn_Light8( this, SchResId( BTN_LIGHT_8 ), 8 ) - , m_aLB_LightSource( this, SchResId( LB_LIGHTSOURCE ) ) - , m_aBtn_LightSource_Color( this, SchResId( BTN_LIGHTSOURCE_COLOR ) ) - , m_aFT_AmbientLight( this, SchResId( FT_AMBIENTLIGHT ) ) - , m_aLB_AmbientLight( this, SchResId( LB_AMBIENTLIGHT ) ) - , m_aBtn_AmbientLight_Color( this, SchResId( BTN_AMBIENT_COLOR ) ) - , m_aCtl_Preview( this, SchResId( CTL_LIGHT_PREVIEW ) ) + : TabPage ( pWindow + ,"tp_3D_SceneIllumination" + ,"modules/schart/ui/tp_3D_SceneIllumination.ui") , m_pLightSourceInfoList(0) , m_xSceneProperties( xSceneProperties ) , m_aTimerTriggeredControllerLock( xChartModel ) @@ -281,58 +250,61 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin , m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) ) , m_xChartModel( xChartModel ) { - FreeResource(); + get(m_pBtn_Light1, "BTN_LIGHT_1"); + get(m_pBtn_Light2, "BTN_LIGHT_2"); + get(m_pBtn_Light3, "BTN_LIGHT_3"); + get(m_pBtn_Light4, "BTN_LIGHT_4"); + get(m_pBtn_Light5, "BTN_LIGHT_5"); + get(m_pBtn_Light6, "BTN_LIGHT_6"); + get(m_pBtn_Light7, "BTN_LIGHT_7"); + get(m_pBtn_Light8, "BTN_LIGHT_8"); + + get(m_pLB_LightSource, "LB_LIGHTSOURCE"); + get(m_pLB_AmbientLight, "LB_AMBIENTLIGHT"); + get(m_pBtn_LightSource_Color, "BTN_LIGHTSOURCE_COLOR"); + get(m_pBtn_AmbientLight_Color, "BTN_AMBIENT_COLOR"); + + get(m_pCtl_Preview, "CTL_LIGHT_PREVIEW"); if( pColorTable.is() ) { - m_aLB_AmbientLight.Fill( pColorTable ); - m_aLB_LightSource.Fill( pColorTable ); + m_pLB_AmbientLight->Fill( pColorTable ); + m_pLB_LightSource->Fill( pColorTable ); } - m_aLB_AmbientLight.SetDropDownLineCount(10); - m_aLB_LightSource.SetDropDownLineCount(10); + m_pLB_AmbientLight->SetDropDownLineCount(10); + m_pLB_LightSource->SetDropDownLineCount(10); m_pLightSourceInfoList = new LightSourceInfo[8]; - m_pLightSourceInfoList[0].pButton = &m_aBtn_Light1; - m_pLightSourceInfoList[1].pButton = &m_aBtn_Light2; - m_pLightSourceInfoList[2].pButton = &m_aBtn_Light3; - m_pLightSourceInfoList[3].pButton = &m_aBtn_Light4; - m_pLightSourceInfoList[4].pButton = &m_aBtn_Light5; - m_pLightSourceInfoList[5].pButton = &m_aBtn_Light6; - m_pLightSourceInfoList[6].pButton = &m_aBtn_Light7; - m_pLightSourceInfoList[7].pButton = &m_aBtn_Light8; + m_pLightSourceInfoList[0].pButton = m_pBtn_Light1; + m_pLightSourceInfoList[1].pButton = m_pBtn_Light2; + m_pLightSourceInfoList[2].pButton = m_pBtn_Light3; + m_pLightSourceInfoList[3].pButton = m_pBtn_Light4; + m_pLightSourceInfoList[4].pButton = m_pBtn_Light5; + m_pLightSourceInfoList[5].pButton = m_pBtn_Light6; + m_pLightSourceInfoList[6].pButton = m_pBtn_Light7; + m_pLightSourceInfoList[7].pButton = m_pBtn_Light8; fillControlsFromModel(0); - m_aBtn_Light1.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light2.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light3.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light4.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light5.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light6.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light7.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_aBtn_Light8.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - - m_aLB_AmbientLight.SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); - m_aLB_LightSource.SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); - - m_aBtn_AmbientLight_Color.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); - m_aBtn_LightSource_Color.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); - - m_aCtl_Preview.SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) ); - m_aCtl_Preview.SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) ); - - ClickLightSourceButtonHdl(&m_aBtn_Light2); - - m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) ); - m_aBtn_Light1.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light2.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light3.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light4.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light5.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light6.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light7.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aBtn_Light8.SetAccessibleRelationLabeledBy(&m_aFT_LightSource); - m_aCtl_Preview.SetAccessibleName(SCH_RESSTR( STR_LIGHT_PREVIEW )); + m_pBtn_Light1->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light2->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light3->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light4->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light5->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light6->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light7->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_pBtn_Light8->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + + m_pLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); + m_pLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); + + m_pBtn_AmbientLight_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); + m_pBtn_LightSource_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); + + m_pCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) ); + m_pCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) ); + + ClickLightSourceButtonHdl(m_pBtn_Light2); } ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage() @@ -355,7 +327,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel) for( nL=0; nL<8; nL++) m_pLightSourceInfoList[nL].initButtonFromSource(); - lcl_selectColor( m_aLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties )); + lcl_selectColor( *m_pLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties )); this->updatePreview(); @@ -385,7 +357,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl) m_aTimerTriggeredControllerLock.startTimer(); //update m_pLightSourceInfoList from preview - const SfxItemSet a3DLightAttributes(m_aCtl_Preview.GetSvx3DLightControl().Get3DAttributes()); + const SfxItemSet a3DLightAttributes(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes()); LightSourceInfo* pInfo = &m_pLightSourceInfoList[0]; pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().GetColor(); @@ -434,7 +406,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl) IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl) { - sal_uInt32 nLightNumber = m_aCtl_Preview.GetSvx3DLightControl().GetSelectedLight(); + sal_uInt32 nLightNumber = m_pCtl_Preview->GetSvx3DLightControl().GetSelectedLight(); if(nLightNumber<8) { LightButton* pButton = m_pLightSourceInfoList[nLightNumber].pButton; @@ -448,8 +420,8 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl) IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton ) { - bool bIsAmbientLight = (pButton==&m_aBtn_AmbientLight_Color); - ColorLB* pListBox = ( bIsAmbientLight ? &m_aLB_AmbientLight : &m_aLB_LightSource); + bool bIsAmbientLight = (pButton==m_pBtn_AmbientLight_Color); + ColorLB* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource); SvColorDialog aColorDlg( this ); aColorDlg.SetColor( pListBox->GetSelectEntryColor() ); @@ -485,13 +457,13 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton ) IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorLB*, pListBox ) { - if(pListBox==&m_aLB_AmbientLight) + if(pListBox==m_pLB_AmbientLight) { m_bInCommitToModel = true; lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor().GetColor()); m_bInCommitToModel = false; } - else if(pListBox==&m_aLB_LightSource) + else if(pListBox==m_pLB_LightSource) { //get active lightsource: LightSourceInfo* pInfo = 0; @@ -553,7 +525,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut //update color list box if(pInfo) { - lcl_selectColor( m_aLB_LightSource, pInfo->aLightSource.nDiffuseColor ); + lcl_selectColor( *m_pLB_LightSource, pInfo->aLightSource.nDiffuseColor ); } this->updatePreview(); return 0; @@ -561,11 +533,11 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut void ThreeD_SceneIllumination_TabPage::updatePreview() { - SfxItemSet aItemSet(m_aCtl_Preview.GetSvx3DLightControl().Get3DAttributes()); + SfxItemSet aItemSet(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes()); LightSourceInfo* pInfo = &m_pLightSourceInfoList[0]; // AmbientColor - aItemSet.Put(Svx3DAmbientcolorItem(m_aLB_AmbientLight.GetSelectEntryColor())); + aItemSet.Put(Svx3DAmbientcolorItem(m_pLB_AmbientLight->GetSelectEntryColor())); aItemSet.Put(Svx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor)); aItemSet.Put(Svx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled)); @@ -607,15 +579,15 @@ void ThreeD_SceneIllumination_TabPage::updatePreview() aItemSet.Put(Svx3DLightDirection8Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection))); // set lights and ambient light - m_aCtl_Preview.GetSvx3DLightControl().Set3DAttributes(aItemSet); + m_pCtl_Preview->GetSvx3DLightControl().Set3DAttributes(aItemSet); // select light for(sal_uInt32 a(0); a < 8; a++) { if(m_pLightSourceInfoList[a].pButton->IsChecked()) { - m_aCtl_Preview.GetSvx3DLightControl().SelectLight(a); - m_aCtl_Preview.CheckSelection(); + m_pCtl_Preview->GetSvx3DLightControl().SelectLight(a); + m_pCtl_Preview->CheckSelection(); break; } } diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc deleted file mode 100644 index 8b5438625b65..000000000000 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#include "ResourceIds.hrc" - -#define FT_AMBIENTLIGHT 1 -#define FT_LIGHTSOURCE 2 - -#define LB_AMBIENTLIGHT 1 -#define LB_LIGHTSOURCE 2 - -#define BTN_AMBIENT_COLOR 1 -#define BTN_LIGHTSOURCE_COLOR 2 -#define BTN_LIGHT_1 3 -#define BTN_LIGHT_2 4 -#define BTN_LIGHT_3 5 -#define BTN_LIGHT_4 6 -#define BTN_LIGHT_5 7 -#define BTN_LIGHT_6 8 -#define BTN_LIGHT_7 9 -#define BTN_LIGHT_8 10 -#define STR_LIGHT_PREVIEW 6000 -#define CTL_LIGHT_PREVIEW 1 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index e2980947eff6..0f6d02e08776 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -41,7 +41,7 @@ namespace chart class LightButton : public ImageButton { public: - LightButton( Window* pParent, const ResId& rResId, sal_Int32 nLightNumber ); + LightButton( Window* pParent); virtual ~LightButton(); void switchLightOn(bool bOn); @@ -51,13 +51,6 @@ private: bool m_bLightOn; }; -class ColorButton : public ImageButton -{ -public: - ColorButton( Window* pParent, const ResId& rResId ); - virtual ~ColorButton(); -}; - struct LightSourceInfo; class ThreeD_SceneIllumination_TabPage : public TabPage @@ -89,30 +82,26 @@ private: void applyLightSourceToModel( sal_uInt32 nLightNumber ); void applyLightSourcesToModel(); - FixedText m_aFT_LightSource; - - LightButton m_aBtn_Light1; - LightButton m_aBtn_Light2; - LightButton m_aBtn_Light3; - LightButton m_aBtn_Light4; - LightButton m_aBtn_Light5; - LightButton m_aBtn_Light6; - LightButton m_aBtn_Light7; - LightButton m_aBtn_Light8; + LightButton* m_pBtn_Light1; + LightButton* m_pBtn_Light2; + LightButton* m_pBtn_Light3; + LightButton* m_pBtn_Light4; + LightButton* m_pBtn_Light5; + LightButton* m_pBtn_Light6; + LightButton* m_pBtn_Light7; + LightButton* m_pBtn_Light8; - ColorLB m_aLB_LightSource; - ColorButton m_aBtn_LightSource_Color; + ColorLB* m_pLB_LightSource; + PushButton* m_pBtn_LightSource_Color; - FixedText m_aFT_AmbientLight; - ColorLB m_aLB_AmbientLight; - ColorButton m_aBtn_AmbientLight_Color; + ColorLB* m_pLB_AmbientLight; + PushButton* m_pBtn_AmbientLight_Color; - SvxLightCtl3D m_aCtl_Preview; + SvxLightCtl3D* m_pCtl_Preview; LightSourceInfo* m_pLightSourceInfoList; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > m_xSceneProperties; + ::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet > m_xSceneProperties; TimerTriggeredControllerLock m_aTimerTriggeredControllerLock; diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src deleted file mode 100644 index de35c7635ec2..000000000000 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "tp_3D_SceneIllumination.hrc" -#include "dlg_View3D.hrc" - -#define WIDTH_HEAD 108 -#define WIDTH_FT 41 -#define WIDTH_LB 57 -#define WIDTH_IB 12 -#define BUTTON_DISTANCE 14 - -#define HEIGHT_IB 12 -#define HEIGHT_FT 10 -#define HEIGHT_LB 12 - -#define POS_X_0 6 -#define POS_X_1 (POS_X_0+WIDTH_LB+4) -#define POS_X_2 (POS_X_1+WIDTH_IB+6) - -#define WIDTH_PREVIEW (VIEW3D_PAGE_WIDTH-POS_X_2-6) - -#define POS_Y_LIGHTSOURCE_HEAD 3 -#define POS_Y_LIGHTSOURCE_BUTTONS (POS_Y_LIGHTSOURCE_HEAD+12) -#define POS_Y_LIGHTSOURCE_BUTTONS_2 (POS_Y_LIGHTSOURCE_BUTTONS+HEIGHT_IB+2) -#define POS_Y_LIGHTSOURCE (POS_Y_LIGHTSOURCE_BUTTONS_2+16) - -#define POS_Y_AMBIENT_HEAD (POS_Y_LIGHTSOURCE+18) -#define POS_Y_AMBIENT (POS_Y_AMBIENT_HEAD+12) - -#define POS_Y_PREVIEW POS_Y_LIGHTSOURCE_BUTTONS - -#define HEIGHT_PREVIEW POS_Y_AMBIENT+HEIGHT_LB-POS_Y_PREVIEW - -TabPage TP_3D_SCENEILLUMINATION -{ - HelpID = "chart2:TabPage:TP_3D_SCENEILLUMINATION"; - OutputSize = TRUE ; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( VIEW3D_PAGE_WIDTH , VIEW3D_PAGE_HEIGHT ) ; - - FixedText FT_LIGHTSOURCE - { - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE_HEAD ) ; - Size = MAP_APPFONT ( WIDTH_HEAD , HEIGHT_FT ) ; - Text [ en-US ] = "~Light source" ; - }; - ImageButton BTN_LIGHT_1 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_1"; - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE_BUTTONS ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_2 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_2"; - Pos = MAP_APPFONT ( POS_X_0+BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_3 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_3"; - Pos = MAP_APPFONT ( POS_X_0+2*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_4 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_4"; - Pos = MAP_APPFONT ( POS_X_0+3*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_5 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_5"; - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_6 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_6"; - Pos = MAP_APPFONT ( POS_X_0+1*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_7 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_7"; - Pos = MAP_APPFONT ( POS_X_0+2*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ImageButton BTN_LIGHT_8 - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_8"; - Pos = MAP_APPFONT ( POS_X_0+3*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - }; - ListBox LB_LIGHTSOURCE - { - HelpID = "chart2:ListBox:TP_3D_SCENEILLUMINATION:LB_LIGHTSOURCE"; - Border = TRUE ; - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE ) ; - Size = MAP_APPFONT ( WIDTH_LB , HEIGHT_LB ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - ImageButton BTN_LIGHTSOURCE_COLOR - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHTSOURCE_COLOR"; - Pos = MAP_APPFONT ( POS_X_1 , POS_Y_LIGHTSOURCE ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - TabStop = TRUE ; - }; - - - - - FixedText FT_AMBIENTLIGHT - { - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_AMBIENT_HEAD ) ; - Size = MAP_APPFONT ( WIDTH_HEAD , HEIGHT_FT ) ; - Text [ en-US ] = "~Ambient light" ; - }; - ListBox LB_AMBIENTLIGHT - { - HelpID = "chart2:ListBox:TP_3D_SCENEILLUMINATION:LB_AMBIENTLIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( POS_X_0 , POS_Y_AMBIENT ) ; - Size = MAP_APPFONT ( WIDTH_LB , HEIGHT_LB ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - ImageButton BTN_AMBIENT_COLOR - { - HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_AMBIENT_COLOR"; - Pos = MAP_APPFONT ( POS_X_1 , POS_Y_AMBIENT ) ; - Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ; - TabStop = TRUE ; - }; - - - - Control CTL_LIGHT_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( POS_X_2 , POS_Y_PREVIEW ) ; - Size = MAP_APPFONT ( WIDTH_PREVIEW , HEIGHT_PREVIEW ) ; - TabStop = TRUE ; - }; -}; - -String STR_LIGHT_PREVIEW -{ - Text [ en-US ] = "Light Preview" ; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc index eb696a5ac795..685cbe946e43 100644 --- a/chart2/source/inc/Strings.hrc +++ b/chart2/source/inc/Strings.hrc @@ -260,9 +260,6 @@ #define STR_ACTION_REARRANGE_CHART (RID_APP_START + 94) #define STR_ACTION_EDIT_TEXT (RID_APP_START + 95) -#define STR_TIP_CHOOSECOLOR (RID_APP_START + 233) -#define STR_TIP_LIGHTSOURCE_X (RID_APP_START + 234) - //----------------------------------------------------------------------------- //statusbar strings and balloon help diff --git a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui new file mode 100644 index 000000000000..429a7896be46 --- /dev/null +++ b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui @@ -0,0 +1,331 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkImage" id="IMG_AMBIENT_COLOR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">svx/res/colordlg.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHTSOURCE_COLOR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">svx/res/colordlg.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">0.44999998807907104</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">0.50999999046325684</property> + <property name="ypad">1</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">0.49000000953674316</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">0.50999999046325684</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0.50999999046325684</property> + <property name="yalign">0.49000000953674316</property> + <property name="xpad">1</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkImage" id="IMG_LIGHT_8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">svx/res/lighton.png</property> + </object> + <object class="GtkBox" id="tp_3D_SceneIllumination"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="spacing">12</property> + <child> + <object class="GtkBox" id="box2"> + <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="FT_LIGHTSOURCE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Light source</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">BTN_LIGHT_1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 1</property> + <property name="image">IMG_LIGHT_1</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="chartcontrollerlo-LightButton" id="BTN_LIGHT_2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 2</property> + <property name="image">IMG_LIGHT_2</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="chartcontrollerlo-LightButton" id="BTN_LIGHT_3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 3</property> + <property name="image">IMG_LIGHT_3</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 4</property> + <property name="image">IMG_LIGHT_4</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 5</property> + <property name="image">IMG_LIGHT_5</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="chartcontrollerlo-LightButton" id="BTN_LIGHT_6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 6</property> + <property name="image">IMG_LIGHT_6</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> + <child> + <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 7</property> + <property name="image">IMG_LIGHT_7</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="chartcontrollerlo-LightButton" id="BTN_LIGHT_8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Light source 8</property> + <property name="image">IMG_LIGHT_8</property> + </object> + <packing> + <property name="left_attach">3</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">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="svxlo-ColorLB" id="LB_LIGHTSOURCE"> + <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">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="BTN_LIGHTSOURCE_COLOR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Select a color using the color dialog</property> + <property name="image">IMG_LIGHTSOURCE_COLOR</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">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_AMBIENTLIGHT"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Ambient light</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">LB_AMBIENTLIGHT</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="svxlo-ColorLB" id="LB_AMBIENTLIGHT"> + <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">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="BTN_AMBIENT_COLOR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Select a color using the color dialog</property> + <property name="image">IMG_AMBIENT_COLOR</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">4</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="svxlo-SvxLightCtl3D" id="CTL_LIGHT_PREVIEW"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Light Preview</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> |