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 +#include +#include // 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 @@ + + + + + + False + 6 + Customize + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + + + False + True + 1 + + + + + + ok + cancel + help + + +