Kaydet (Commit) e5ad76c1 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert chart legend position tabpage to widget UI

Change-Id: Iefdbbff83ea05c2e926191a2058a0be67c281789
Reviewed-on: https://gerrit.libreoffice.org/6824Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 963fb6a8
...@@ -54,7 +54,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ ...@@ -54,7 +54,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
chart2/source/controller/dialogs/tp_DataLabel.src \ chart2/source/controller/dialogs/tp_DataLabel.src \
chart2/source/controller/dialogs/tp_DataSource.src \ chart2/source/controller/dialogs/tp_DataSource.src \
chart2/source/controller/dialogs/tp_ErrorBars.src \ chart2/source/controller/dialogs/tp_ErrorBars.src \
chart2/source/controller/dialogs/tp_LegendPosition.src \
chart2/source/controller/dialogs/tp_PointGeometry.src \ chart2/source/controller/dialogs/tp_PointGeometry.src \
chart2/source/controller/dialogs/tp_PolarOptions.src \ chart2/source/controller/dialogs/tp_PolarOptions.src \
chart2/source/controller/dialogs/tp_RangeChooser.src \ chart2/source/controller/dialogs/tp_RangeChooser.src \
......
...@@ -38,6 +38,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ ...@@ -38,6 +38,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/titlerotationtabpage \ chart2/uiconfig/ui/titlerotationtabpage \
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_SeriesToAxis \ chart2/uiconfig/ui/tp_SeriesToAxis \
chart2/uiconfig/ui/tp_Scale \ chart2/uiconfig/ui/tp_Scale \
chart2/uiconfig/ui/tp_Trendline \ chart2/uiconfig/ui/tp_Trendline \
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
//see attrib.hrc in old chart //see attrib.hrc in old chart
#define GRP_LEGEND 1
#define FL_LEGEND_TEXTORIENT 2
#define FT_LEGEND_TEXTDIR 3
#define LB_LEGEND_TEXTDIR 4
//Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES //Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES
// ID's for title rotation tabpage // ID's for title rotation tabpage
......
...@@ -29,46 +29,47 @@ ...@@ -29,46 +29,47 @@
namespace chart namespace chart
{ {
SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, const SfxItemSet& rInAttrs)
const SfxItemSet& rInAttrs) : SfxTabPage( pWindow
: SfxTabPage( pWindow, SchResId(TP_LEGEND_POS), rInAttrs ) ,"tp_LegendPosition"
, aGrpLegend( this, SchResId(GRP_LEGEND) ) ,"modules/schart/ui/tp_LegendPosition.ui"
, m_apLegendPositionResources( new LegendPositionResources(this) ) , rInAttrs )
, m_aFlTextOrient( this, SchResId( FL_LEGEND_TEXTORIENT ) )
, m_aFtTextDirection( this, SchResId( FT_LEGEND_TEXTDIR ) )
, m_aLbTextDirection( this, SchResId( LB_LEGEND_TEXTDIR ), &m_aFlTextOrient, &m_aFtTextDirection )
{ {
m_apLegendPositionResources->SetAccessibleRelationMemberOf(&aGrpLegend); get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
FreeResource();
m_pLbTextDirection->SetDropDownLineCount(3);
get(m_pBxPosition,"boxPOSITION");
m_pLegendPositionResources = new LegendPositionResources(m_pBxPosition);
} }
SchLegendPosTabPage::~SchLegendPosTabPage() SchLegendPosTabPage::~SchLegendPosTabPage()
{ {
delete m_pLegendPositionResources;
} }
SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutAttrs)
const SfxItemSet& rOutAttrs)
{ {
return new SchLegendPosTabPage(pWindow, rOutAttrs); return new SchLegendPosTabPage(pWindow, rOutAttrs);
} }
sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs) sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{ {
m_apLegendPositionResources->writeToItemSet(rOutAttrs); m_pLegendPositionResources->writeToItemSet(rOutAttrs);
if( m_aLbTextDirection.GetSelectEntryCount() > 0 ) if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) ); rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
return sal_True; return sal_True;
} }
void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs) void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
{ {
m_apLegendPositionResources->initFromItemSet(rInAttrs); m_pLegendPositionResources->initFromItemSet(rInAttrs);
const SfxPoolItem* pPoolItem = 0; const SfxPoolItem* pPoolItem = 0;
if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET ) if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) ); m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
} }
} //namespace chart } //namespace chart
......
...@@ -33,13 +33,12 @@ class LegendPositionResources; ...@@ -33,13 +33,12 @@ class LegendPositionResources;
class SchLegendPosTabPage : public SfxTabPage class SchLegendPosTabPage : public SfxTabPage
{ {
private: private:
FixedLine aGrpLegend;
boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources; // boost::scoped_ptr< LegendPositionResources > m_apLegendPositionResources;
LegendPositionResources* m_pLegendPositionResources;
VclBox* m_pBxPosition;
FixedLine m_aFlTextOrient; TextDirectionListBox* m_pLbTextDirection;
FixedText m_aFtTextDirection;
TextDirectionListBox m_aLbTextDirection;
public: public:
SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs); SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs);
......
/* -*- 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 "HelpIds.hrc"
#include "TabPages.hrc"
#include "res_LegendPosition.hrc"
TabPage TP_LEGEND_POS
{
Hide = TRUE ;
HelpID = HID_SCH_LEGEND_POS ;
SVLook = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedLine GRP_LEGEND
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Position" ;
};
RESOURCE_LEGENDPOSITION( 12, 14 )
FixedLine FL_LEGEND_TEXTORIENT
{
Pos = MAP_APPFONT ( 6 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 6 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Text orientation" ;
};
FixedText FT_LEGEND_TEXTDIR
{
Pos = MAP_APPFONT ( 12 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 19 ) ;
Size = MAP_APPFONT ( 64 , 8 ) ;
Text [ en-US ] = "Te~xt direction" ;
};
ListBox LB_LEGEND_TEXTDIR
{
HelpID = "chart2:ListBox:TP_LEGEND_POS:LB_LEGEND_TEXTDIR";
Pos = MAP_APPFONT ( 78 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 17 ) ;
Size = MAP_APPFONT ( 170 , 100 ) ;
Border = TRUE;
TabStop = TRUE;
DropDown = TRUE;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="tp_LegendPosition">
<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="framePOSITION">
<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="GtkBox" id="boxPOSITION">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="TXT_POSITION">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Position</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="frameORIENTATION">
<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="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="FT_LEGEND_TEXTDIR">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Te_xt direction</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="chartcontrollerlo-TextDirectionListBox" id="LB_LEGEND_TEXTDIR">
<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">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="TXT_ORIENTATION">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Text 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">1</property>
</packing>
</child>
</object>
</interface>
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