summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@edx.srv.br>2013-12-24 10:26:30 -0200
committerCaolán McNamara <caolanm@redhat.com>2013-12-27 15:07:26 +0000
commit1568dc25414945dfaed945d214a0c49ad01b6849 (patch)
tree60127b3498cf9018198e496ecec7935f407cead7 /chart2
parentaccbda12df38ecd4cf120bf30b38c81db64a2118 (diff)
Convert chart polar options tab page to widget UI
Conflicts: chart2/AllLangResTarget_chartcontroller.mk Change-Id: If9730589e44ab40331ea217986e79d78b926d5af
Diffstat (limited to 'chart2')
-rw-r--r--chart2/AllLangResTarget_chartcontroller.mk1
-rw-r--r--chart2/UIConfig_chart2.mk1
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx50
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hrc34
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx14
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.src87
-rw-r--r--chart2/source/controller/inc/HelpIds.hrc2
-rw-r--r--chart2/uiconfig/ui/tp_PolarOptions.ui183
8 files changed, 213 insertions, 159 deletions
diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk
index b32d4afd6aa2..69939b5dce87 100644
--- a/chart2/AllLangResTarget_chartcontroller.mk
+++ b/chart2/AllLangResTarget_chartcontroller.mk
@@ -40,7 +40,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/Strings_Statistic.src \
chart2/source/controller/dialogs/tp_ChartType.src \
chart2/source/controller/dialogs/tp_DataSource.src \
- chart2/source/controller/dialogs/tp_PolarOptions.src \
chart2/source/controller/dialogs/tp_RangeChooser.src \
))
diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk
index 9f5f044152aa..cc7eee39fbf5 100644
--- a/chart2/UIConfig_chart2.mk
+++ b/chart2/UIConfig_chart2.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/tp_AxisPositions \
chart2/uiconfig/ui/tp_DataLabel \
chart2/uiconfig/ui/tp_LegendPosition \
+ chart2/uiconfig/ui/tp_PolarOptions \
chart2/uiconfig/ui/tp_SeriesToAxis \
chart2/uiconfig/ui/tp_Scale \
chart2/uiconfig/ui/tp_Trendline \
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index 6f5ac963b035..524401c682c8 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -18,7 +18,6 @@
*/
#include "tp_PolarOptions.hxx"
-#include "tp_PolarOptions.hrc"
#include "ResId.hxx"
#include "chartview/ChartSfxItemIds.hxx"
@@ -30,18 +29,19 @@ namespace chart
{
PolarOptionsTabPage::PolarOptionsTabPage( Window* pWindow,const SfxItemSet& rInAttrs ) :
- SfxTabPage( pWindow, SchResId(TP_POLAROPTIONS), rInAttrs ),
- m_aCB_Clockwise( this, SchResId( CB_CLOCKWISE ) ),
- m_aFL_StartingAngle( this, SchResId( FL_STARTING_ANGLE ) ),
- m_aAngleDial( this, SchResId( CT_ANGLE_DIAL ) ),
- m_aFT_Degrees( this, SchResId( FT_ROTATION_DEGREES ) ),
- m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) ),
- m_aFL_PlotOptions( this, SchResId( FL_PLOT_OPTIONS_POLAR ) ),
- m_aCB_IncludeHiddenCells( this, SchResId( CB_INCLUDE_HIDDEN_CELLS_POLAR ) )
+ SfxTabPage( pWindow
+ ,"tp_PolarOptions"
+ ,"modules/schart/ui/tp_PolarOptions.ui"
+ ,rInAttrs)
{
- FreeResource();
+ get(m_pCB_Clockwise, "CB_CLOCKWISE");
+ get(m_pFL_StartingAngle, "frameANGLE");
+ get(m_pAngleDial, "CT_ANGLE_DIAL");
+ get(m_pNF_StartingAngle, "NF_STARTING_ANGLE");
+ get(m_pFL_PlotOptions, "framePLOT_OPTIONS");
+ get(m_pCB_IncludeHiddenCells, "CB_INCLUDE_HIDDEN_CELLS_POLAR");
- m_aAngleDial.SetLinkedField( &m_aNF_StartingAngle );
+ m_pAngleDial->SetLinkedField( m_pNF_StartingAngle );
}
PolarOptionsTabPage::~PolarOptionsTabPage()
@@ -55,17 +55,17 @@ SfxTabPage* PolarOptionsTabPage::Create( Window* pWindow,const SfxItemSet& rOutA
sal_Bool PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
- if( m_aAngleDial.IsVisible() )
+ if( m_pAngleDial->IsVisible() )
{
rOutAttrs.Put(SfxInt32Item(SCHATTR_STARTING_ANGLE,
- static_cast< sal_Int32 >(m_aAngleDial.GetRotation()/100)));
+ static_cast< sal_Int32 >(m_pAngleDial->GetRotation()/100)));
}
- if( m_aCB_Clockwise.IsVisible() )
- rOutAttrs.Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_aCB_Clockwise.IsChecked()));
+ if( m_pCB_Clockwise->IsVisible() )
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_pCB_Clockwise->IsChecked()));
- if (m_aCB_IncludeHiddenCells.IsVisible())
- rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCB_IncludeHiddenCells.IsChecked()));
+ if (m_pCB_IncludeHiddenCells->IsVisible())
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_pCB_IncludeHiddenCells->IsChecked()));
return sal_True;
}
@@ -77,33 +77,29 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_STARTING_ANGLE, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
long nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
- m_aAngleDial.SetRotation( nTmp*100 );
+ m_pAngleDial->SetRotation( nTmp*100 );
}
else
{
- m_aFL_StartingAngle.Show(sal_False);
- m_aAngleDial.Show(sal_False);
- m_aNF_StartingAngle.Show(sal_False);
- m_aFT_Degrees.Show(sal_False);
+ m_pFL_StartingAngle->Show(sal_False);
}
if (rInAttrs.GetItemState(SCHATTR_CLOCKWISE, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
sal_Bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
- m_aCB_Clockwise.Check(bCheck);
+ m_pCB_Clockwise->Check(bCheck);
}
else
{
- m_aCB_Clockwise.Show(sal_False);
+ m_pCB_Clockwise->Show(sal_False);
}
if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
- m_aCB_IncludeHiddenCells.Check(bVal);
+ m_pCB_IncludeHiddenCells->Check(bVal);
}
else
{
- m_aCB_IncludeHiddenCells.Show(sal_False);
- m_aFL_PlotOptions.Show(sal_False);
+ m_pFL_PlotOptions->Show(sal_False);
}
}
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hrc b/chart2/source/controller/dialogs/tp_PolarOptions.hrc
deleted file mode 100644
index e1abc6d43654..000000000000
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hrc
+++ /dev/null
@@ -1,34 +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 CB_CLOCKWISE 1
-#define CB_INCLUDE_HIDDEN_CELLS_POLAR 2
-
-#define FL_STARTING_ANGLE 1
-#define FL_PLOT_OPTIONS_POLAR 2
-
-#define CT_ANGLE_DIAL 1
-
-#define NF_STARTING_ANGLE 1
-
-#define FT_ROTATION_DEGREES 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 174f79de148c..4a9590375241 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -40,14 +40,12 @@ public:
virtual void Reset(const SfxItemSet& rInAttrs);
private:
- CheckBox m_aCB_Clockwise;
- FixedLine m_aFL_StartingAngle;
- svx::DialControl m_aAngleDial;
- FixedText m_aFT_Degrees;
- NumericField m_aNF_StartingAngle;
-
- FixedLine m_aFL_PlotOptions;
- CheckBox m_aCB_IncludeHiddenCells;
+ CheckBox* m_pCB_Clockwise;
+ VclFrame* m_pFL_StartingAngle;
+ svx::DialControl* m_pAngleDial;
+ NumericField* m_pNF_StartingAngle;
+ VclFrame* m_pFL_PlotOptions;
+ CheckBox* m_pCB_IncludeHiddenCells;
};
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.src b/chart2/source/controller/dialogs/tp_PolarOptions.src
deleted file mode 100644
index d36ef7b725b0..000000000000
--- a/chart2/source/controller/dialogs/tp_PolarOptions.src
+++ /dev/null
@@ -1,87 +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 <sfx2/tabpage.hrc>
-
-#include "tp_PolarOptions.hrc"
-#include "HelpIds.hrc"
-
-TabPage TP_POLAROPTIONS
-{
- HelpID = "chart2:TabPage:TP_POLAROPTIONS";
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-
- CheckBox CB_CLOCKWISE
- {
- HelpID = "chart2:CheckBox:TP_POLAROPTIONS:CB_CLOCKWISE";
- Pos = MAP_APPFONT ( 12 , 8 );
- Size = MAP_APPFONT ( 248 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "~Clockwise direction";
- };
- FixedLine FL_STARTING_ANGLE
- {
- Pos = MAP_APPFONT ( 6 , 21 ) ;
- Size = MAP_APPFONT ( 248 , 12 ) ;
- Text [ en-US ] = "Starting angle" ;
- };
- Control CT_ANGLE_DIAL
- {
- HelpId = HID_SCH_STARTING_ANGLE_DIAL ;
- Pos = MAP_APPFONT ( 12 , 38 ) ;
- Size = MAP_APPFONT ( 43 , 43 ) ;
- };
- FixedText FT_ROTATION_DEGREES
- {
- Pos = MAP_APPFONT ( 93 , 55 ) ;
- Size = MAP_APPFONT ( 166 , 8 ) ;
- Text [ en-US ] = "~Degrees" ;
- };
- NumericField NF_STARTING_ANGLE
- {
- HelpID = "chart2:NumericField:TP_POLAROPTIONS:NF_STARTING_ANGLE";
- Pos = MAP_APPFONT ( 61 , 53 ) ;
- Size = MAP_APPFONT ( 28 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 359 ;
- SpinSize = 5 ;
- };
- FixedLine FL_PLOT_OPTIONS_POLAR
- {
- Pos = MAP_APPFONT ( 6 , 90 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Plot options";
- };
- CheckBox CB_INCLUDE_HIDDEN_CELLS_POLAR
- {
- HelpID = "chart2:CheckBox:TP_POLAROPTIONS:CB_INCLUDE_HIDDEN_CELLS_POLAR";
- Pos = MAP_APPFONT ( 12 , 104 ) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Include ~values from hidden cells";
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc
index 7b4e6daa1f9f..c450268a6d47 100644
--- a/chart2/source/controller/inc/HelpIds.hrc
+++ b/chart2/source/controller/inc/HelpIds.hrc
@@ -82,8 +82,6 @@
#define HID_SCH_LEGEND_SHOW "CHART2_HID_SCH_LEGEND_SHOW"
#define HID_SCH_DATA_SERIES_LABEL "CHART2_HID_SCH_DATA_SERIES_LABEL"
-#define HID_SCH_STARTING_ANGLE_DIAL "CHART2_HID_SCH_STARTING_ANGLE_DIAL"
-
#define HID_SCH_STATISTIK_FUNCTION "CHART2_HID_SCH_STATISTIK_FUNCTION"
#define HID_SCH_STATISTIK_RANGE "CHART2_HID_SCH_STATISTIK_RANGE"
#define HID_SCH_STATISTIK_FUNCTION_LB "CHART2_HID_SCH_STATISTIK_FUNCTION_LB"
diff --git a/chart2/uiconfig/ui/tp_PolarOptions.ui b/chart2/uiconfig/ui/tp_PolarOptions.ui
new file mode 100644
index 000000000000..4aa49ede7304
--- /dev/null
+++ b/chart2/uiconfig/ui/tp_PolarOptions.ui
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkAdjustment" id="adjustmentDEGREE">
+ <property name="upper">359</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkBox" id="tp_PolarOptions">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkCheckButton" id="CB_CLOCKWISE">
+ <property name="label" translatable="yes">_Clockwise direction</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Orientation</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frameANGLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="svxlo-DialControl" id="CT_ANGLE_DIAL">
+ <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="svxlo-WrapField" id="NF_STARTING_ANGLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustmentDEGREE</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="FT_ROTATION_DEGREES">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Degrees</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">NF_STARTING_ANGLE</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Starting angle</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="framePLOT_OPTIONS">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkCheckButton" id="CB_INCLUDE_HIDDEN_CELLS_POLAR">
+ <property name="label" translatable="yes">Include _values from hidden cells</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Plot options</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+</interface>