diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-07 09:39:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-07 09:43:15 +0000 |
commit | db666bdf0c048cec17669096cda414c4b48fc1ec (patch) | |
tree | 928e665b7c57ee4dab2258f8cfe245b8cec40fb2 /chart2 | |
parent | a75ed48dcd7c00881773afec53bb89f4f01d8462 (diff) |
convert data range tabdialog to .ui
Change-Id: I70e9064a13a751f6b0dae153522953eaf2ac53a5
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/AllLangResTarget_chartcontroller.mk | 1 | ||||
-rw-r--r-- | chart2/UIConfig_chart2.mk | 1 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/dlg_DataSource.cxx | 63 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/dlg_DataSource.src | 42 | ||||
-rw-r--r-- | chart2/source/controller/inc/HelpIds.hrc | 1 | ||||
-rw-r--r-- | chart2/source/controller/inc/dlg_DataSource.hxx | 4 | ||||
-rw-r--r-- | chart2/uiconfig/ui/datarangedialog.ui | 92 |
7 files changed, 120 insertions, 84 deletions
diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk index 1250e2adf4ed..d15c4f5827d5 100644 --- a/chart2/AllLangResTarget_chartcontroller.mk +++ b/chart2/AllLangResTarget_chartcontroller.mk @@ -28,7 +28,6 @@ $(eval $(call gb_SrsTarget_set_include,chart2/res,\ $(eval $(call gb_SrsTarget_add_files,chart2/res,\ chart2/source/controller/dialogs/dlg_DataEditor.src \ - chart2/source/controller/dialogs/dlg_DataSource.src \ chart2/source/controller/dialogs/res_BarGeometry.src \ chart2/source/controller/dialogs/Strings_AdditionalControls.src \ chart2/source/controller/dialogs/Strings_ChartTypes.src \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index a49772024068..38f1beb5f984 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -33,6 +33,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/3dviewdialog \ chart2/uiconfig/ui/attributedialog \ chart2/uiconfig/ui/chardialog \ + chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ chart2/uiconfig/ui/dlg_InsertErrorBars \ chart2/uiconfig/ui/insertaxisdlg \ diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx index 74f8973bff2f..7384b1a0f76b 100644 --- a/chart2/source/controller/dialogs/dlg_DataSource.cxx +++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx @@ -29,8 +29,8 @@ #include "tp_RangeChooser.hxx" #include "tp_DataSource.hxx" -// for RET_OK -#include <vcl/msgbox.hxx> +#include <vcl/layout.hxx> +#include <vcl/msgbox.hxx> // for RET_OK using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -85,8 +85,7 @@ Reference< chart2::XChartTypeTemplate > DocumentChartTypeTemplateProvider::getCu class DataSourceTabControl : public TabControl { public: - DataSourceTabControl( Window* pParent, const ResId& rResId ); - ~DataSourceTabControl(); + DataSourceTabControl(Window* pParent); virtual long DeactivatePage(); @@ -97,13 +96,11 @@ private: bool m_bTogglingEnabled; }; -DataSourceTabControl::DataSourceTabControl( Window* pParent, const ResId& rResId ) : - TabControl( pParent, rResId ), - m_bTogglingEnabled( true ) -{} - -DataSourceTabControl::~DataSourceTabControl() -{} +DataSourceTabControl::DataSourceTabControl(Window* pParent) + : TabControl(pParent) + , m_bTogglingEnabled(true) +{ +} // Note that the result is long, but is intended to be a bool long DataSourceTabControl::DeactivatePage() @@ -127,31 +124,25 @@ void DataSourceTabControl::EnableTabToggling() sal_uInt16 DataSourceDialog::m_nLastPageId = 0; -DataSourceDialog::DataSourceDialog( - Window * pParent, +DataSourceDialog::DataSourceDialog(Window * pParent, const Reference< XChartDocument > & xChartDocument, - const Reference< uno::XComponentContext > & xContext ) : - - TabDialog( pParent, SchResId( DLG_DATA_SOURCE )), - - m_xChartDocument( xChartDocument ), - m_xContext( xContext ), - m_apDocTemplateProvider( new DocumentChartTypeTemplateProvider( xChartDocument )), - m_apDialogModel( new DialogModel( xChartDocument, xContext )), - - m_pTabControl( new DataSourceTabControl( this, SchResId( TABCTRL ) )), - m_aBtnOK( this, SchResId( BTN_OK ) ), - m_aBtnCancel( this, SchResId( BTN_CANCEL ) ), - m_aBtnHelp( this, SchResId( BTN_HELP ) ), - - m_pRangeChooserTabePage(0), - m_pDataSourceTabPage(0), - m_bRangeChooserTabIsValid( true ), - m_bDataSourceTabIsValid( true ) + const Reference< uno::XComponentContext > & xContext) + : TabDialog(pParent, "DataRangeDialog", + "modules/schart/ui/datarangedialog.ui") + , m_xChartDocument(xChartDocument) + , m_xContext(xContext) + , m_apDocTemplateProvider(new DocumentChartTypeTemplateProvider(xChartDocument)) + , m_apDialogModel(new DialogModel(xChartDocument, xContext)) + , m_pTabControl(new DataSourceTabControl(get_content_area())) + , m_pRangeChooserTabePage(0) + , m_pDataSourceTabPage(0) + , m_bRangeChooserTabIsValid(true) + , m_bDataSourceTabIsValid(true) { - FreeResource(); + get(m_pBtnOK, "ok"); + + m_pTabControl->Show(); - //don't create the tabpages before FreeResource, otherwise the help ids are not matched correctly m_pRangeChooserTabePage = new RangeChooserTabPage( m_pTabControl, *(m_apDialogModel.get()), m_apDocTemplateProvider.get(), this, true /* bHideDescription */ ); m_pDataSourceTabPage = new DataSourceTabPage( m_pTabControl, *(m_apDialogModel.get()), @@ -164,8 +155,6 @@ DataSourceDialog::DataSourceDialog( m_pTabControl->SetTabPage( TP_RANGECHOOSER, m_pRangeChooserTabePage ); m_pTabControl->SelectTabPage( m_nLastPageId ); - - SetHelpId( HID_SCH_DLG_RANGES ); } DataSourceDialog::~DataSourceDialog() @@ -199,7 +188,7 @@ void DataSourceDialog::setInvalidPage( TabPage * pTabPage ) if( ! (m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid )) { - m_aBtnOK.Enable( sal_False ); + m_pBtnOK->Enable( sal_False ); OSL_ASSERT( m_pTabControl ); // note: there seems to be no suitable mechanism to address pages by // identifier, at least it is unclear what the page identifiers are. @@ -221,7 +210,7 @@ void DataSourceDialog::setValidPage( TabPage * pTabPage ) if( m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid ) { - m_aBtnOK.Enable( sal_True ); + m_pBtnOK->Enable( sal_True ); OSL_ASSERT( m_pTabControl ); m_pTabControl->EnableTabToggling(); } diff --git a/chart2/source/controller/dialogs/dlg_DataSource.src b/chart2/source/controller/dialogs/dlg_DataSource.src deleted file mode 100644 index 4237c438ef5e..000000000000 --- a/chart2/source/controller/dialogs/dlg_DataSource.src +++ /dev/null @@ -1,42 +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 "dlg_DataSource.hrc" -#include "HelpIds.hrc" - -// for BUTTONS_OK_CANCEL_HELP_STACKED -#include "CommonResources.hrc" - -TabDialog DLG_DATA_SOURCE -{ - HelpID = HID_SCH_DLG_RANGES ; - - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "Data Ranges" ; - TabControl TABCTRL - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - }; - BUTTONS_OK_CANCEL_HELP_STACKED( 200 ) -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc index 5b9be0c0ad3e..e9d425777193 100644 --- a/chart2/source/controller/inc/HelpIds.hrc +++ b/chart2/source/controller/inc/HelpIds.hrc @@ -41,7 +41,6 @@ #define HID_SCH_CHART_AUTO_FORMAT "CHART2_HID_SCH_CHART_AUTO_FORMAT" #define HID_SCH_LB_BAR_GEOMETRY "CHART2_HID_SCH_LB_BAR_GEOMETRY" -#define HID_SCH_DLG_RANGES "CHART2_HID_SCH_DLG_RANGES" #define HID_SCH_CB_SECONDARY_XAXIS "CHART2_HID_SCH_CB_SECONDARY_XAXIS" #define HID_SCH_CB_SECONDARY_YAXIS "CHART2_HID_SCH_CB_SECONDARY_YAXIS" diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx index d41f002c7872..e5ae6b0c68eb 100644 --- a/chart2/source/controller/inc/dlg_DataSource.hxx +++ b/chart2/source/controller/inc/dlg_DataSource.hxx @@ -72,9 +72,7 @@ protected: private: DataSourceTabControl* m_pTabControl; - OKButton m_aBtnOK; - CancelButton m_aBtnCancel; - HelpButton m_aBtnHelp; + OKButton* m_pBtnOK; RangeChooserTabPage * m_pRangeChooserTabePage; DataSourceTabPage * m_pDataSourceTabPage; diff --git a/chart2/uiconfig/ui/datarangedialog.ui b/chart2/uiconfig/ui/datarangedialog.ui new file mode 100644 index 000000000000..e234b37edd59 --- /dev/null +++ b/chart2/uiconfig/ui/datarangedialog.ui @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.0 on Tue Jan 7 09:24:43 2014 --> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="DataRangeDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Customize</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> |