Kaydet (Commit) 56e1133f authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert chart 3D scene illumination to .ui

Change-Id: I55e56196818e181d16e74ae93376ff4ff1c4c395
Reviewed-on: https://gerrit.libreoffice.org/6998Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 9f87de91
...@@ -45,7 +45,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ ...@@ -45,7 +45,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/Strings_Scale.src \ chart2/source/controller/dialogs/Strings_Scale.src \
chart2/source/controller/dialogs/Strings.src \ chart2/source/controller/dialogs/Strings.src \
chart2/source/controller/dialogs/Strings_Statistic.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_AxisLabel.src \
chart2/source/controller/dialogs/tp_ChartType.src \ chart2/source/controller/dialogs/tp_ChartType.src \
chart2/source/controller/dialogs/tp_DataLabel.src \ chart2/source/controller/dialogs/tp_DataLabel.src \
......
...@@ -39,6 +39,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ ...@@ -39,6 +39,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/titlerotationtabpage \ chart2/uiconfig/ui/titlerotationtabpage \
chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneAppearance \
chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneGeometry \
chart2/uiconfig/ui/tp_3D_SceneIllumination \
chart2/uiconfig/ui/tp_axisLabel \ chart2/uiconfig/ui/tp_axisLabel \
chart2/uiconfig/ui/tp_AxisPositions \ chart2/uiconfig/ui/tp_AxisPositions \
chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_LegendPosition \
......
...@@ -384,16 +384,6 @@ String STR_TIP_SELECT_RANGE ...@@ -384,16 +384,6 @@ String STR_TIP_SELECT_RANGE
Text [ en-US ] = "Select data 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 String STR_TIP_DATASERIES
{ {
Text [ en-US ] = "Data Series '%SERIESNAME'" ; Text [ en-US ] = "Data Series '%SERIESNAME'" ;
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
*/ */
#include "tp_3D_SceneIllumination.hxx" #include "tp_3D_SceneIllumination.hxx"
#include "tp_3D_SceneIllumination.hrc"
#include "ResId.hxx" #include "ResId.hxx"
#include "Strings.hrc"
#include "Bitmaps.hrc" #include "Bitmaps.hrc"
#include "CommonConverters.hxx" #include "CommonConverters.hxx"
...@@ -44,21 +42,16 @@ namespace chart ...@@ -44,21 +42,16 @@ namespace chart
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2; using namespace ::com::sun::star::chart2;
LightButton::LightButton( Window* pParent, const ResId& rResId, sal_Int32 nLightNumber ) LightButton::LightButton( Window* pParent)
: ImageButton( pParent, rResId ) : ImageButton( pParent)
, m_bLightOn(false) , m_bLightOn(false)
{ {
SetModeImage( Image( SVX_RES(RID_SVXIMAGE_LIGHT_OFF) ) ); SetModeImage( Image( SVX_RES(RID_SVXIMAGE_LIGHT_OFF) ) );
}
OUString aTipHelpStr( SCH_RESSTR(STR_TIP_LIGHTSOURCE_X) ); extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLightButton(Window *pParent, VclBuilder::stringmap &)
const OUString aReplacementStr( "%LIGHTNUMBER" ); {
sal_Int32 nIndex = aTipHelpStr.indexOf( aReplacementStr ); return new LightButton(pParent);
if( nIndex != -1 )
{
aTipHelpStr = aTipHelpStr.replaceAt(nIndex, aReplacementStr.getLength(),
OUString::number( nLightNumber ) );
}
this->SetQuickHelpText( aTipHelpStr );
} }
LightButton::~LightButton() LightButton::~LightButton()
...@@ -85,17 +78,6 @@ bool LightButton::isLightOn() const ...@@ -85,17 +78,6 @@ bool LightButton::isLightOn() const
return m_bLightOn; 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 struct LightSource
{ {
long nDiffuseColor; long nDiffuseColor;
...@@ -258,22 +240,9 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin ...@@ -258,22 +240,9 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
, const uno::Reference< beans::XPropertySet > & xSceneProperties , const uno::Reference< beans::XPropertySet > & xSceneProperties
, const uno::Reference< frame::XModel >& xChartModel , const uno::Reference< frame::XModel >& xChartModel
, const XColorListRef & pColorTable ) , const XColorListRef & pColorTable )
: TabPage ( pWindow, SchResId( TP_3D_SCENEILLUMINATION ) ) : TabPage ( pWindow
, m_aFT_LightSource( this, SchResId( FT_LIGHTSOURCE ) ) ,"tp_3D_SceneIllumination"
, m_aBtn_Light1( this, SchResId( BTN_LIGHT_1 ), 1 ) ,"modules/schart/ui/tp_3D_SceneIllumination.ui")
, 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 ) )
, m_pLightSourceInfoList(0) , m_pLightSourceInfoList(0)
, m_xSceneProperties( xSceneProperties ) , m_xSceneProperties( xSceneProperties )
, m_aTimerTriggeredControllerLock( xChartModel ) , m_aTimerTriggeredControllerLock( xChartModel )
...@@ -281,58 +250,61 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin ...@@ -281,58 +250,61 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
, m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) ) , m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) )
, m_xChartModel( xChartModel ) , 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() ) if( pColorTable.is() )
{ {
m_aLB_AmbientLight.Fill( pColorTable ); m_pLB_AmbientLight->Fill( pColorTable );
m_aLB_LightSource.Fill( pColorTable ); m_pLB_LightSource->Fill( pColorTable );
} }
m_aLB_AmbientLight.SetDropDownLineCount(10); m_pLB_AmbientLight->SetDropDownLineCount(10);
m_aLB_LightSource.SetDropDownLineCount(10); m_pLB_LightSource->SetDropDownLineCount(10);
m_pLightSourceInfoList = new LightSourceInfo[8]; m_pLightSourceInfoList = new LightSourceInfo[8];
m_pLightSourceInfoList[0].pButton = &m_aBtn_Light1; m_pLightSourceInfoList[0].pButton = m_pBtn_Light1;
m_pLightSourceInfoList[1].pButton = &m_aBtn_Light2; m_pLightSourceInfoList[1].pButton = m_pBtn_Light2;
m_pLightSourceInfoList[2].pButton = &m_aBtn_Light3; m_pLightSourceInfoList[2].pButton = m_pBtn_Light3;
m_pLightSourceInfoList[3].pButton = &m_aBtn_Light4; m_pLightSourceInfoList[3].pButton = m_pBtn_Light4;
m_pLightSourceInfoList[4].pButton = &m_aBtn_Light5; m_pLightSourceInfoList[4].pButton = m_pBtn_Light5;
m_pLightSourceInfoList[5].pButton = &m_aBtn_Light6; m_pLightSourceInfoList[5].pButton = m_pBtn_Light6;
m_pLightSourceInfoList[6].pButton = &m_aBtn_Light7; m_pLightSourceInfoList[6].pButton = m_pBtn_Light7;
m_pLightSourceInfoList[7].pButton = &m_aBtn_Light8; m_pLightSourceInfoList[7].pButton = m_pBtn_Light8;
fillControlsFromModel(0); fillControlsFromModel(0);
m_aBtn_Light1.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light1->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light2.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light2->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light3.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light3->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light4.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light4->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light5.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light5->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light6.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light6->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light7.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light7->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aBtn_Light8.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_pBtn_Light8->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_aLB_AmbientLight.SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); m_pLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
m_aLB_LightSource.SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); m_pLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
m_aBtn_AmbientLight_Color.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); m_pBtn_AmbientLight_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
m_aBtn_LightSource_Color.SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) ); m_pBtn_LightSource_Color->SetClickHdl( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
m_aCtl_Preview.SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) ); m_pCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) );
m_aCtl_Preview.SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) ); m_pCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) );
ClickLightSourceButtonHdl(&m_aBtn_Light2); ClickLightSourceButtonHdl(m_pBtn_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 ));
} }
ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage() ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
...@@ -355,7 +327,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel) ...@@ -355,7 +327,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel)
for( nL=0; nL<8; nL++) for( nL=0; nL<8; nL++)
m_pLightSourceInfoList[nL].initButtonFromSource(); m_pLightSourceInfoList[nL].initButtonFromSource();
lcl_selectColor( m_aLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties )); lcl_selectColor( *m_pLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties ));
this->updatePreview(); this->updatePreview();
...@@ -385,7 +357,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl) ...@@ -385,7 +357,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl)
m_aTimerTriggeredControllerLock.startTimer(); m_aTimerTriggeredControllerLock.startTimer();
//update m_pLightSourceInfoList from preview //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]; LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().GetColor(); pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().GetColor();
...@@ -434,7 +406,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl) ...@@ -434,7 +406,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl)
IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl) 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) if(nLightNumber<8)
{ {
LightButton* pButton = m_pLightSourceInfoList[nLightNumber].pButton; LightButton* pButton = m_pLightSourceInfoList[nLightNumber].pButton;
...@@ -448,8 +420,8 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl) ...@@ -448,8 +420,8 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl)
IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton ) IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton )
{ {
bool bIsAmbientLight = (pButton==&m_aBtn_AmbientLight_Color); bool bIsAmbientLight = (pButton==m_pBtn_AmbientLight_Color);
ColorLB* pListBox = ( bIsAmbientLight ? &m_aLB_AmbientLight : &m_aLB_LightSource); ColorLB* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource);
SvColorDialog aColorDlg( this ); SvColorDialog aColorDlg( this );
aColorDlg.SetColor( pListBox->GetSelectEntryColor() ); aColorDlg.SetColor( pListBox->GetSelectEntryColor() );
...@@ -485,13 +457,13 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton ) ...@@ -485,13 +457,13 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton )
IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorLB*, pListBox ) IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorLB*, pListBox )
{ {
if(pListBox==&m_aLB_AmbientLight) if(pListBox==m_pLB_AmbientLight)
{ {
m_bInCommitToModel = true; m_bInCommitToModel = true;
lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor().GetColor()); lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor().GetColor());
m_bInCommitToModel = false; m_bInCommitToModel = false;
} }
else if(pListBox==&m_aLB_LightSource) else if(pListBox==m_pLB_LightSource)
{ {
//get active lightsource: //get active lightsource:
LightSourceInfo* pInfo = 0; LightSourceInfo* pInfo = 0;
...@@ -553,7 +525,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut ...@@ -553,7 +525,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut
//update color list box //update color list box
if(pInfo) if(pInfo)
{ {
lcl_selectColor( m_aLB_LightSource, pInfo->aLightSource.nDiffuseColor ); lcl_selectColor( *m_pLB_LightSource, pInfo->aLightSource.nDiffuseColor );
} }
this->updatePreview(); this->updatePreview();
return 0; return 0;
...@@ -561,11 +533,11 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut ...@@ -561,11 +533,11 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut
void ThreeD_SceneIllumination_TabPage::updatePreview() void ThreeD_SceneIllumination_TabPage::updatePreview()
{ {
SfxItemSet aItemSet(m_aCtl_Preview.GetSvx3DLightControl().Get3DAttributes()); SfxItemSet aItemSet(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
LightSourceInfo* pInfo = &m_pLightSourceInfoList[0]; LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
// AmbientColor // AmbientColor
aItemSet.Put(Svx3DAmbientcolorItem(m_aLB_AmbientLight.GetSelectEntryColor())); aItemSet.Put(Svx3DAmbientcolorItem(m_pLB_AmbientLight->GetSelectEntryColor()));
aItemSet.Put(Svx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor)); aItemSet.Put(Svx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor));
aItemSet.Put(Svx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled)); aItemSet.Put(Svx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled));
...@@ -607,15 +579,15 @@ void ThreeD_SceneIllumination_TabPage::updatePreview() ...@@ -607,15 +579,15 @@ void ThreeD_SceneIllumination_TabPage::updatePreview()
aItemSet.Put(Svx3DLightDirection8Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection))); aItemSet.Put(Svx3DLightDirection8Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
// set lights and ambient light // set lights and ambient light
m_aCtl_Preview.GetSvx3DLightControl().Set3DAttributes(aItemSet); m_pCtl_Preview->GetSvx3DLightControl().Set3DAttributes(aItemSet);
// select light // select light
for(sal_uInt32 a(0); a < 8; a++) for(sal_uInt32 a(0); a < 8; a++)
{ {
if(m_pLightSourceInfoList[a].pButton->IsChecked()) if(m_pLightSourceInfoList[a].pButton->IsChecked())
{ {
m_aCtl_Preview.GetSvx3DLightControl().SelectLight(a); m_pCtl_Preview->GetSvx3DLightControl().SelectLight(a);
m_aCtl_Preview.CheckSelection(); m_pCtl_Preview->CheckSelection();
break; break;
} }
} }
......
/* -*- 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: */
...@@ -41,7 +41,7 @@ namespace chart ...@@ -41,7 +41,7 @@ namespace chart
class LightButton : public ImageButton class LightButton : public ImageButton
{ {
public: public:
LightButton( Window* pParent, const ResId& rResId, sal_Int32 nLightNumber ); LightButton( Window* pParent);
virtual ~LightButton(); virtual ~LightButton();
void switchLightOn(bool bOn); void switchLightOn(bool bOn);
...@@ -51,13 +51,6 @@ private: ...@@ -51,13 +51,6 @@ private:
bool m_bLightOn; bool m_bLightOn;
}; };
class ColorButton : public ImageButton
{
public:
ColorButton( Window* pParent, const ResId& rResId );
virtual ~ColorButton();
};
struct LightSourceInfo; struct LightSourceInfo;
class ThreeD_SceneIllumination_TabPage : public TabPage class ThreeD_SceneIllumination_TabPage : public TabPage
...@@ -89,30 +82,26 @@ private: ...@@ -89,30 +82,26 @@ private:
void applyLightSourceToModel( sal_uInt32 nLightNumber ); void applyLightSourceToModel( sal_uInt32 nLightNumber );
void applyLightSourcesToModel(); void applyLightSourcesToModel();
FixedText m_aFT_LightSource; LightButton* m_pBtn_Light1;
LightButton* m_pBtn_Light2;
LightButton m_aBtn_Light1; LightButton* m_pBtn_Light3;
LightButton m_aBtn_Light2; LightButton* m_pBtn_Light4;
LightButton m_aBtn_Light3; LightButton* m_pBtn_Light5;
LightButton m_aBtn_Light4; LightButton* m_pBtn_Light6;
LightButton m_aBtn_Light5; LightButton* m_pBtn_Light7;
LightButton m_aBtn_Light6; LightButton* m_pBtn_Light8;
LightButton m_aBtn_Light7;
LightButton m_aBtn_Light8;
ColorLB m_aLB_LightSource; ColorLB* m_pLB_LightSource;
ColorButton m_aBtn_LightSource_Color; PushButton* m_pBtn_LightSource_Color;
FixedText m_aFT_AmbientLight; ColorLB* m_pLB_AmbientLight;
ColorLB m_aLB_AmbientLight; PushButton* m_pBtn_AmbientLight_Color;
ColorButton m_aBtn_AmbientLight_Color;
SvxLightCtl3D m_aCtl_Preview; SvxLightCtl3D* m_pCtl_Preview;
LightSourceInfo* m_pLightSourceInfoList; LightSourceInfo* m_pLightSourceInfoList;
::com::sun::star::uno::Reference< ::com::sun::star::uno::Reference<::com::sun::star::beans::XPropertySet > m_xSceneProperties;
::com::sun::star::beans::XPropertySet > m_xSceneProperties;
TimerTriggeredControllerLock m_aTimerTriggeredControllerLock; TimerTriggeredControllerLock m_aTimerTriggeredControllerLock;
......
/* -*- 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: */
...@@ -260,9 +260,6 @@ ...@@ -260,9 +260,6 @@
#define STR_ACTION_REARRANGE_CHART (RID_APP_START + 94) #define STR_ACTION_REARRANGE_CHART (RID_APP_START + 94)
#define STR_ACTION_EDIT_TEXT (RID_APP_START + 95) #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 //statusbar strings and balloon help
......
<?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>
...@@ -263,6 +263,9 @@ ...@@ -263,6 +263,9 @@
<glade-widget-class title="Bitmap Pixel Editor" name="svxlo-SvxPixelCtl" <glade-widget-class title="Bitmap Pixel Editor" name="svxlo-SvxPixelCtl"
generic-name="Bitmap Pixel Editor" parent="GtkDrawingArea" generic-name="Bitmap Pixel Editor" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Svx 3D Light Control" name="svxlo-SvxLightCtl3D"
generic-name="3D Light Control" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Frame Selector" name="svxlo-SvxFrameSelector" <glade-widget-class title="Frame Selector" name="svxlo-SvxFrameSelector"
generic-name="Frame Border Preview Window" parent="GtkDrawingArea" generic-name="Frame Border Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
...@@ -368,6 +371,9 @@ ...@@ -368,6 +371,9 @@
<glade-widget-class title="Text Direction ListBox" name="chartcontrollerlo-TextDirectionListBox" <glade-widget-class title="Text Direction ListBox" name="chartcontrollerlo-TextDirectionListBox"
generic-name="TextDirectionListBox" parent="svxlo-FrameDirectionListBox" generic-name="TextDirectionListBox" parent="svxlo-FrameDirectionListBox"
icon-name="widget-gtk-combobox"/> icon-name="widget-gtk-combobox"/>
<glade-widget-class title="Chart Light Button" name="chartcontrollerlo-LightButton"
generic-name="ChartLightButton" parent="GtkButton"
icon-name="widget-gtk-button"/>
<glade-widget-class title="Numbering Type ListBox" name="swlo-SwNumberingTypeListBox" <glade-widget-class title="Numbering Type ListBox" name="swlo-SwNumberingTypeListBox"
generic-name="NumberingTypeListBox" parent="GtkComboBox" generic-name="NumberingTypeListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/> icon-name="widget-gtk-combobox"/>
......
...@@ -166,6 +166,7 @@ private: ...@@ -166,6 +166,7 @@ private:
public: public:
SvxLightCtl3D( Window* pParent, const ResId& rResId); SvxLightCtl3D( Window* pParent, const ResId& rResId);
SvxLightCtl3D( Window* pParent);
~SvxLightCtl3D(); ~SvxLightCtl3D();
// react to size changes // react to size changes
...@@ -186,6 +187,8 @@ public: ...@@ -186,6 +187,8 @@ public:
virtual void GetFocus(); virtual void GetFocus();
virtual void LoseFocus(); virtual void LoseFocus();
virtual Size GetOptimalSize() const;
protected: protected:
DECL_LINK( InternalInteractiveChange, void*); DECL_LINK( InternalInteractiveChange, void*);
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <svx/sphere3d.hxx> #include <svx/sphere3d.hxx>
#include <svx/cube3d.hxx> #include <svx/cube3d.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/builder.hxx>
#include <svx/helperhittest3d.hxx> #include <svx/helperhittest3d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/polygn3d.hxx> #include <svx/polygn3d.hxx>
...@@ -960,6 +961,28 @@ SvxLightCtl3D::SvxLightCtl3D( Window* pParent, const ResId& rResId) ...@@ -960,6 +961,28 @@ SvxLightCtl3D::SvxLightCtl3D( Window* pParent, const ResId& rResId)
Init(); Init();
} }
SvxLightCtl3D::SvxLightCtl3D( Window* pParent)
: Control(pParent, WB_BORDER | WB_TABSTOP),
maLightControl(this, 0),
maHorScroller(this, WB_HORZ | WB_DRAG),
maVerScroller(this, WB_VERT | WB_DRAG),
maSwitcher(this, 0)
{
// init members
Init();
}
Size SvxLightCtl3D::GetOptimalSize() const
{
return LogicToPixel(Size(80, 100), MAP_APPFONT);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxLightCtl3D(Window *pParent, VclBuilder::stringmap &)
{
return new SvxLightCtl3D(pParent);
}
void SvxLightCtl3D::Init() void SvxLightCtl3D::Init()
{ {
// #i58240# set HelpIDs for scrollbars and switcher // #i58240# set HelpIDs for scrollbars and switcher
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment