diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-16 18:44:01 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-16 22:18:09 +0200 |
commit | d4d56067b7e0d654701912a3fd54cf2b452a8d28 (patch) | |
tree | a30b3f715fea5aae1d429d1064857f95381ddc15 | |
parent | 5d6d11a6d21e81feb0ba3422a3a3cad9d96ec3b6 (diff) |
add skeleton for chart series panel
Change-Id: Ib1e5da270812aa909a6e773abbd9716256f4d5f4
-rw-r--r-- | chart2/Library_chartcontroller.mk | 1 | ||||
-rw-r--r-- | chart2/UIConfig_chart2.mk | 1 | ||||
-rw-r--r-- | chart2/source/controller/sidebar/Chart2PanelFactory.cxx | 3 | ||||
-rw-r--r-- | chart2/source/controller/sidebar/ChartSeriesPanel.cxx | 129 | ||||
-rw-r--r-- | chart2/source/controller/sidebar/ChartSeriesPanel.hxx | 90 | ||||
-rw-r--r-- | chart2/uiconfig/ui/sidebarseries.ui | 156 |
6 files changed, 380 insertions, 0 deletions
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 1b2b46dbe300..facaf66eedca 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/main/UndoGuard \ chart2/source/controller/sidebar/Chart2PanelFactory \ chart2/source/controller/sidebar/ChartElementsPanel \ + chart2/source/controller/sidebar/ChartSeriesPanel \ )) # Runtime dependency for unit-tests diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index ab8ce34a9e03..d2e840871aed 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -43,6 +43,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/inserttitledlg \ chart2/uiconfig/ui/paradialog \ chart2/uiconfig/ui/sidebarelements \ + chart2/uiconfig/ui/sidebarseries \ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx index 29ea916783cf..61e167700216 100644 --- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx +++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx @@ -30,6 +30,7 @@ #include <cppuhelper/supportsservice.hxx> #include "ChartElementsPanel.hxx" +#include "ChartSeriesPanel.hxx" #include "ChartController.hxx" using namespace css::uno; @@ -93,6 +94,8 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement ( VclPtr<vcl::Window> pPanel; if (rsResourceURL.endsWith("/ElementsPanel")) pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings, pController ); + else if (rsResourceURL.endsWith("/SeriesPanel")) + pPanel = ChartSeriesPanel::Create(pParentWindow, xFrame, pBindings, pController); /* else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel")) pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings ); diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx new file mode 100644 index 000000000000..732aefc9c014 --- /dev/null +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -0,0 +1,129 @@ +/* -*- 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/sidebar/ResourceDefinitions.hrc> +#include <sfx2/sidebar/Theme.hxx> +#include <sfx2/sidebar/ControlFactory.hxx> + +#include "ChartSeriesPanel.hxx" +#include "ChartController.hxx" +#include <sfx2/bindings.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/imagemgr.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/field.hxx> +#include <vcl/toolbox.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <comphelper/processfactory.hxx> + +#include "ChartModel.hxx" + +using namespace css; +using namespace css::uno; +using ::sfx2::sidebar::Theme; + +namespace chart { namespace sidebar { + +ChartSeriesPanel::ChartSeriesPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, + ChartController* pController) + : PanelLayout(pParent, "ChartSeriesPanel", "modules/schart/ui/sidebarseries.ui", rxFrame), + mxFrame(rxFrame), + maContext(), + mpBindings(pBindings), + mxModel(pController->getModel()) +{ + Initialize(); +} + +ChartSeriesPanel::~ChartSeriesPanel() +{ + disposeOnce(); +} + +void ChartSeriesPanel::dispose() +{ + + PanelLayout::dispose(); +} + +void ChartSeriesPanel::Initialize() +{ +} + +void ChartSeriesPanel::updateData() +{ + SolarMutexGuard aGuard; +} + +VclPtr<vcl::Window> ChartSeriesPanel::Create ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, ChartController* pController) +{ + if (pParent == NULL) + throw lang::IllegalArgumentException("no parent Window given to ChartSeriesPanel::Create", NULL, 0); + if ( ! rxFrame.is()) + throw lang::IllegalArgumentException("no XFrame given to ChartSeriesPanel::Create", NULL, 1); + if (pBindings == NULL) + throw lang::IllegalArgumentException("no SfxBindings given to ChartSeriesPanel::Create", NULL, 2); + + return VclPtr<ChartSeriesPanel>::Create( + pParent, rxFrame, pBindings, pController); +} + +void ChartSeriesPanel::DataChanged( + const DataChangedEvent& ) +{ + updateData(); +} + +void ChartSeriesPanel::HandleContextChange( + const ::sfx2::sidebar::EnumContext& rContext) +{ + if(maContext == rContext) + { + // Nothing to do. + return; + } + + maContext = rContext; + updateData(); +} + +void ChartSeriesPanel::NotifyItemUpdate( + sal_uInt16 /*nSID*/, + SfxItemState /*eState*/, + const SfxPoolItem* /*pState*/, + const bool ) +{ +} + +void ChartSeriesPanel::modelInvalid() +{ + +} + +}} // end of namespace ::chart::sidebar + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx new file mode 100644 index 000000000000..6fa61e351a76 --- /dev/null +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx @@ -0,0 +1,90 @@ +/* -*- 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 . + */ +#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTSERIESPANEL_HXX +#define INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTSERIESPANEL_HXX + +#include <sfx2/sidebar/ControllerItem.hxx> +#include <sfx2/sidebar/IContextChangeReceiver.hxx> +#include <svx/sidebar/PanelLayout.hxx> + +#include <com/sun/star/util/XModifyListener.hpp> + +class FixedText; +class ListBox; +class NumericField; + +namespace chart { + +class ChartController; + +namespace sidebar { + +class ChartSeriesPanel : public PanelLayout, + public ::sfx2::sidebar::IContextChangeReceiver, + public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface +{ +public: + static VclPtr<vcl::Window> Create( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, ChartController* pController); + + virtual void DataChanged( + const DataChangedEvent& rEvent) SAL_OVERRIDE; + + virtual void HandleContextChange( + const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE; + + virtual void NotifyItemUpdate( + const sal_uInt16 nSId, + const SfxItemState eState, + const SfxPoolItem* pState, + const bool bIsEnabled) SAL_OVERRIDE; + + SfxBindings* GetBindings() { return mpBindings;} + + // constructor/destuctor + ChartSeriesPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, ChartController* pController); + virtual ~ChartSeriesPanel(); + virtual void dispose() SAL_OVERRIDE; + + void updateData(); + void modelInvalid(); + +private: + //ui controls + + css::uno::Reference<css::frame::XFrame> mxFrame; + ::sfx2::sidebar::EnumContext maContext; + SfxBindings* mpBindings; + + css::uno::Reference<css::frame::XModel> mxModel; + css::uno::Reference<css::util::XModifyListener> mxListener; + + void Initialize(); +}; + +} } // end of namespace ::chart::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/uiconfig/ui/sidebarseries.ui b/chart2/uiconfig/ui/sidebarseries.ui new file mode 100644 index 000000000000..afcc7a995911 --- /dev/null +++ b/chart2/uiconfig/ui/sidebarseries.ui @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.12"/> + <object class="GtkGrid" id="DataSeriesPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="label_series_name"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">label</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_label"> + <property name="label" translatable="yes">Show data label</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_trendline"> + <property name="label" translatable="yes">Trendline</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Axis:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radiobutton_primary_axis"> + <property name="label" translatable="yes">Primary Y-Axis</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radiobutton_secondary_axis"> + <property name="label" translatable="yes">Secondary Y-Axis</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="yalign">0.49000000953674316</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton_primary_axis</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_y_error"> + <property name="label" translatable="yes">Y Error Bars</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_x_error"> + <property name="label" translatable="yes">X Error Bars</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="comboboxtext_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes">Above</item> + <item translatable="yes">Below</item> + <item translatable="yes">Center</item> + <item translatable="yes">Outside</item> + <item translatable="yes">Inside</item> + <item translatable="yes">Near origin</item> + </items> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> +</interface> |