Kaydet (Commit) 5d566706 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add ChartElements panel

Change-Id: I935a0d637a9ea3a1716d6e839e65c4e565a2c840
üst b33b2afe
......@@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/UndoCommandDispatch \
chart2/source/controller/main/UndoGuard \
chart2/source/controller/sidebar/Chart2PanelFactory \
chart2/source/controller/sidebar/ChartElementsPanel \
))
# Runtime dependency for unit-tests
......
......@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/insertgriddlg \
chart2/uiconfig/ui/inserttitledlg \
chart2/uiconfig/ui/paradialog \
chart2/uiconfig/ui/sidebarelements \
chart2/uiconfig/ui/smoothlinesdlg \
chart2/uiconfig/ui/steppedlinesdlg \
chart2/uiconfig/ui/titlerotationtabpage \
......
......@@ -29,6 +29,8 @@
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "ChartElementsPanel.hxx"
using namespace css;
using namespace css::uno;
using ::rtl::OUString;
......@@ -78,9 +80,9 @@ Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/ElementsPanel"))
pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings );
/*
if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
......
/* -*- 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 "ChartElementsPanel.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>
using namespace css;
using namespace css::uno;
using ::sfx2::sidebar::Theme;
namespace chart { namespace sidebar {
ChartElementsPanel::ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
: PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame),
mxFrame(rxFrame),
maContext(),
mpBindings(pBindings)
{
get(mpCBTitle, "checkbutton_title");
get(mpCBSubtitle, "checkbutton_subtitle");
get(mpCBXAxis, "checkbutton_x_axis");
get(mpCBXAxisTitle, "checkbutton_x_axis_title");
get(mpCBYAxis, "checkbutton_y_axis");
get(mpCBYAxisTitle, "checkbutton_y_axis_title");
get(mpCBZAxis, "checkbutton_z_axis");
get(mpCBZAxisTitle, "checkbutton_z_axis_title");
get(mpCB2ndXAxis, "checkbutton_2nd_x_axis");
get(mpCB2ndXAxisTitle, "checkbutton_2nd_x_axis_title");
get(mpCB2ndYAxis, "checkbutton_2nd_y_axis");
get(mpCB2ndYAxisTitle, "checkbutton_2nd_y_axis_title");
get(mpCBLegend, "checkbutton_legend");
get(mpCBGridVertical, "checkbutton_gridline_vertical");
get(mpCBGridHorizontal, "checkbutton_gridline_horizontal");
get(mpCBShowLabel, "checkbutton_label");
get(mpCBTrendline, "checkbutton_trendline");
Initialize();
}
ChartElementsPanel::~ChartElementsPanel()
{
disposeOnce();
}
void ChartElementsPanel::dispose()
{
mpCBTitle.clear();
mpCBSubtitle.clear();
mpCBXAxis.clear();
mpCBXAxisTitle.clear();
mpCBYAxis.clear();
mpCBYAxisTitle.clear();
mpCBZAxis.clear();
mpCBZAxisTitle.clear();
mpCB2ndXAxis.clear();
mpCB2ndXAxisTitle.clear();
mpCB2ndYAxis.clear();
mpCB2ndYAxisTitle.clear();
mpCBLegend.clear();
mpCBGridVertical.clear();
mpCBGridHorizontal.clear();
mpCBShowLabel.clear();
mpCBTrendline.clear();
PanelLayout::dispose();
}
void ChartElementsPanel::Initialize()
{
}
VclPtr<vcl::Window> ChartElementsPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
if (pParent == NULL)
throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", NULL, 0);
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to ChartElementsPanel::Create", NULL, 1);
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to ChartElementsPanel::Create", NULL, 2);
return VclPtr<ChartElementsPanel>::Create(
pParent, rxFrame, pBindings);
}
void ChartElementsPanel::DataChanged(
const DataChangedEvent& )
{
}
void ChartElementsPanel::HandleContextChange(
const ::sfx2::sidebar::EnumContext& rContext)
{
if(maContext == rContext)
{
// Nothing to do.
return;
}
maContext = rContext;
}
void ChartElementsPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState /*eState*/,
const SfxPoolItem* /*pState*/,
const bool )
{
switch(nSID)
{
default:
;
}
}
}} // end of namespace ::chart::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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_CHARTELEMENTSPANEL_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTELEMENTSPANEL_HXX
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <boost/scoped_ptr.hpp>
class FixedText;
class ListBox;
class NumericField;
namespace chart { namespace sidebar {
class ChartElementsPanel : 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);
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
ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
virtual ~ChartElementsPanel();
virtual void dispose() SAL_OVERRIDE;
private:
//ui controls
VclPtr<ListBox> mpLbCategory;
VclPtr<ToolBox> mpTBCategory;
VclPtr<NumericField> mpEdDecimals;
VclPtr<NumericField> mpEdLeadZeroes;
VclPtr<CheckBox> mpCBTitle;
VclPtr<CheckBox> mpCBSubtitle;
VclPtr<CheckBox> mpCBXAxis;
VclPtr<CheckBox> mpCBXAxisTitle;
VclPtr<CheckBox> mpCBYAxis;
VclPtr<CheckBox> mpCBYAxisTitle;
VclPtr<CheckBox> mpCBZAxis;
VclPtr<CheckBox> mpCBZAxisTitle;
VclPtr<CheckBox> mpCB2ndXAxis;
VclPtr<CheckBox> mpCB2ndXAxisTitle;
VclPtr<CheckBox> mpCB2ndYAxis;
VclPtr<CheckBox> mpCB2ndYAxisTitle;
VclPtr<CheckBox> mpCBLegend;
VclPtr<CheckBox> mpCBGridVertical;
VclPtr<CheckBox> mpCBGridHorizontal;
VclPtr<CheckBox> mpCBShowLabel;
VclPtr<CheckBox> mpCBTrendline;
css::uno::Reference<css::frame::XFrame> mxFrame;
::sfx2::sidebar::EnumContext maContext;
SfxBindings* mpBindings;
void Initialize();
};
} } // end of namespace ::chart::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
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