convert data range tabdialog to .ui
Change-Id: I70e9064a13a751f6b0dae153522953eaf2ac53a5
This commit is contained in:
@@ -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 \
|
||||
|
@@ -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 \
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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: */
|
@@ -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"
|
||||
|
@@ -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;
|
||||
|
92
chart2/uiconfig/ui/datarangedialog.ui
Normal file
92
chart2/uiconfig/ui/datarangedialog.ui
Normal file
@@ -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>
|
Reference in New Issue
Block a user