[Libreoffice-commits] core.git: chart2/AllLangResTarget_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk

Olivier Hallot olivier.hallot at edx.srv.br
Wed Nov 27 02:33:08 PST 2013


 chart2/AllLangResTarget_chartcontroller.mk             |    1 
 chart2/UIConfig_chart2.mk                              |    1 
 chart2/source/controller/dialogs/TabPages.hrc          |    4 
 chart2/source/controller/dialogs/tp_LegendPosition.cxx |   35 ++---
 chart2/source/controller/dialogs/tp_LegendPosition.hxx |    9 -
 chart2/source/controller/dialogs/tp_LegendPosition.src |   64 ---------
 chart2/uiconfig/ui/tp_LegendPosition.ui                |  118 +++++++++++++++++
 7 files changed, 141 insertions(+), 91 deletions(-)

New commits:
commit e5ad76c11ff6dc3e349c8a73628269c4a9dc3302
Author: Olivier Hallot <olivier.hallot at edx.srv.br>
Date:   Tue Nov 26 23:14:18 2013 -0200

    Convert chart legend position tabpage to widget UI
    
    Change-Id: Iefdbbff83ea05c2e926191a2058a0be67c281789
    Reviewed-on: https://gerrit.libreoffice.org/6824
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk
index 907e238..fbe346a 100644
--- a/chart2/AllLangResTarget_chartcontroller.mk
+++ b/chart2/AllLangResTarget_chartcontroller.mk
@@ -54,7 +54,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
     chart2/source/controller/dialogs/tp_DataLabel.src \
     chart2/source/controller/dialogs/tp_DataSource.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_PolarOptions.src \
     chart2/source/controller/dialogs/tp_RangeChooser.src \
diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk
index fa584e2..9635e96 100644
--- a/chart2/UIConfig_chart2.mk
+++ b/chart2/UIConfig_chart2.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
 	chart2/uiconfig/ui/titlerotationtabpage \
 	chart2/uiconfig/ui/tp_axisLabel \
 	chart2/uiconfig/ui/tp_AxisPositions \
+	chart2/uiconfig/ui/tp_LegendPosition \
 	chart2/uiconfig/ui/tp_SeriesToAxis \
 	chart2/uiconfig/ui/tp_Scale \
 	chart2/uiconfig/ui/tp_Trendline \
diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc
index f746edc..64a9602 100644
--- a/chart2/source/controller/dialogs/TabPages.hrc
+++ b/chart2/source/controller/dialogs/TabPages.hrc
@@ -25,10 +25,6 @@
 
 //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
 // ID's for title rotation tabpage
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 0de7587..6f30aeb 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -29,46 +29,47 @@
 namespace chart
 {
 
-SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow,
-                                         const SfxItemSet& rInAttrs)
-    : SfxTabPage( pWindow, SchResId(TP_LEGEND_POS), rInAttrs )
-    , aGrpLegend( this, SchResId(GRP_LEGEND) )
-    , m_apLegendPositionResources( new LegendPositionResources(this) )
-    , 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 )
+SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, const SfxItemSet& rInAttrs)
+    : SfxTabPage( pWindow
+                 ,"tp_LegendPosition"
+                 ,"modules/schart/ui/tp_LegendPosition.ui"
+                 , rInAttrs )
 {
-    m_apLegendPositionResources->SetAccessibleRelationMemberOf(&aGrpLegend);
-    FreeResource();
+    get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
+
+    m_pLbTextDirection->SetDropDownLineCount(3);
+
+    get(m_pBxPosition,"boxPOSITION");
+    m_pLegendPositionResources = new LegendPositionResources(m_pBxPosition);
 }
 
 SchLegendPosTabPage::~SchLegendPosTabPage()
 {
+    delete m_pLegendPositionResources;
 }
 
-SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow,
-                                        const SfxItemSet& rOutAttrs)
+SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, const SfxItemSet& rOutAttrs)
 {
     return new SchLegendPosTabPage(pWindow, rOutAttrs);
 }
 
 sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
 {
-    m_apLegendPositionResources->writeToItemSet(rOutAttrs);
+    m_pLegendPositionResources->writeToItemSet(rOutAttrs);
 
-    if( m_aLbTextDirection.GetSelectEntryCount() > 0 )
-        rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) );
+    if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
+        rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_pLbTextDirection->GetSelectEntryValue() ) );
 
     return sal_True;
 }
 
 void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
 {
-    m_apLegendPositionResources->initFromItemSet(rInAttrs);
+    m_pLegendPositionResources->initFromItemSet(rInAttrs);
 
     const SfxPoolItem* pPoolItem = 0;
     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
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
index 1d4447e..2e2aab8 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
@@ -33,13 +33,12 @@ class LegendPositionResources;
 class SchLegendPosTabPage : public SfxTabPage
 {
 private:
-    FixedLine   aGrpLegend;
 
-    boost::scoped_ptr< LegendPositionResources >   m_apLegendPositionResources;
+//     boost::scoped_ptr< LegendPositionResources >   m_apLegendPositionResources;
+    LegendPositionResources* m_pLegendPositionResources;
+    VclBox*                  m_pBxPosition;
 
-    FixedLine           m_aFlTextOrient;
-    FixedText               m_aFtTextDirection;
-    TextDirectionListBox    m_aLbTextDirection;
+    TextDirectionListBox*    m_pLbTextDirection;
 
 public:
     SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs);
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.src b/chart2/source/controller/dialogs/tp_LegendPosition.src
deleted file mode 100644
index 362eb2b..0000000
--- a/chart2/source/controller/dialogs/tp_LegendPosition.src
+++ /dev/null
@@ -1,64 +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 "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: */
diff --git a/chart2/uiconfig/ui/tp_LegendPosition.ui b/chart2/uiconfig/ui/tp_LegendPosition.ui
new file mode 100644
index 0000000..4e7cf4c
--- /dev/null
+++ b/chart2/uiconfig/ui/tp_LegendPosition.ui
@@ -0,0 +1,118 @@
+<?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>


More information about the Libreoffice-commits mailing list