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'" ;
......
/* -*- 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
......
This diff is collapsed.
...@@ -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