From 1568dc25414945dfaed945d214a0c49ad01b6849 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Tue, 24 Dec 2013 10:26:30 -0200 Subject: Convert chart polar options tab page to widget UI Conflicts: chart2/AllLangResTarget_chartcontroller.mk Change-Id: If9730589e44ab40331ea217986e79d78b926d5af --- chart2/AllLangResTarget_chartcontroller.mk | 1 - chart2/UIConfig_chart2.mk | 1 + .../source/controller/dialogs/tp_PolarOptions.cxx | 50 +++--- .../source/controller/dialogs/tp_PolarOptions.hrc | 34 ---- .../source/controller/dialogs/tp_PolarOptions.hxx | 14 +- .../source/controller/dialogs/tp_PolarOptions.src | 87 ---------- chart2/source/controller/inc/HelpIds.hrc | 2 - chart2/uiconfig/ui/tp_PolarOptions.ui | 183 +++++++++++++++++++++ 8 files changed, 213 insertions(+), 159 deletions(-) delete mode 100644 chart2/source/controller/dialogs/tp_PolarOptions.hrc delete mode 100644 chart2/source/controller/dialogs/tp_PolarOptions.src create mode 100644 chart2/uiconfig/ui/tp_PolarOptions.ui 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(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 - -#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 @@ + + + + + + 359 + 1 + 10 + + + True + False + 6 + vertical + 6 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + _Clockwise direction + True + False + False + True + 0 + True + + + + + + + True + False + 0 + Orientation + + + + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 12 + + + True + False + + + False + True + 0 + + + + + True + False + center + + True + adjustmentDEGREE + + + False + True + 1 + + + + + True + False + 0 + _Degrees + True + NF_STARTING_ANGLE + + + False + True + 2 + + + + + + + + + True + False + 0 + Starting angle + + + + + + + + False + True + 1 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + Include _values from hidden cells + True + False + False + True + 0 + True + + + + + + + True + False + 0 + Plot options + + + + + + + + False + True + 2 + + + + -- cgit