Kaydet (Commit) 6f754f4b authored tarafından Caolán McNamara's avatar Caolán McNamara

convert subtotals dialog to .ui

Change-Id: Icab4e598c5355a1e971fdaa5a0a4d0d72c703021
üst 03e7a16f
...@@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ ...@@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/src/textdlgs.src \ sc/source/ui/src/textdlgs.src \
sc/source/ui/src/sc.src \ sc/source/ui/src/sc.src \
sc/source/ui/src/pseudo.src \ sc/source/ui/src/pseudo.src \
sc/source/ui/src/subtdlg.src \
sc/source/ui/src/hdrcont.src \ sc/source/ui/src/hdrcont.src \
sc/source/ui/src/scerrors.src \ sc/source/ui/src/scerrors.src \
sc/source/ui/src/simpref.src \ sc/source/ui/src/simpref.src \
......
...@@ -132,6 +132,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ ...@@ -132,6 +132,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sortkey \ sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \ sc/uiconfig/scalc/ui/sortoptionspage \
sc/uiconfig/scalc/ui/sortwarning \ sc/uiconfig/scalc/ui/sortwarning \
sc/uiconfig/scalc/ui/subtotaldialog \
sc/uiconfig/scalc/ui/subtotaloptionspage \ sc/uiconfig/scalc/ui/subtotaloptionspage \
sc/uiconfig/scalc/ui/subtotalgrppage \ sc/uiconfig/scalc/ui/subtotalgrppage \
sc/uiconfig/scalc/ui/statisticsinfopage \ sc/uiconfig/scalc/ui/statisticsinfopage \
......
...@@ -1004,7 +1004,7 @@ ...@@ -1004,7 +1004,7 @@
#define RID_SCDLG_NAMES (SC_DIALOGS_START + 22) #define RID_SCDLG_NAMES (SC_DIALOGS_START + 22)
#define RID_SCDLG_DBNAMES (SC_DIALOGS_START + 23) #define RID_SCDLG_DBNAMES (SC_DIALOGS_START + 23)
#define RID_SCDLG_SOLVER (SC_DIALOGS_START + 26) #define RID_SCDLG_SOLVER (SC_DIALOGS_START + 26)
#define RID_SCDLG_SUBTOTALS (SC_DIALOGS_START + 27)
#define RID_SCPAGE_SUBT_OPTIONS (SC_DIALOGS_START + 29) #define RID_SCPAGE_SUBT_OPTIONS (SC_DIALOGS_START + 29)
#define RID_SCPAGE_USERLISTS (SC_DIALOGS_START + 31) #define RID_SCPAGE_USERLISTS (SC_DIALOGS_START + 31)
#define RID_SCDLG_PIVOTFILTER (SC_DIALOGS_START + 33) #define RID_SCDLG_PIVOTFILTER (SC_DIALOGS_START + 33)
......
...@@ -492,8 +492,7 @@ public: ...@@ -492,8 +492,7 @@ public:
int nId) = 0; int nId) = 0;
virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent,
const SfxItemSet* pArgSet, const SfxItemSet* pArgSet ) = 0;
int nId) = 0;
virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
const SfxObjectShell* pDocShell, int nId ) = 0; const SfxObjectShell* pDocShell, int nId ) = 0;
......
...@@ -1157,23 +1157,10 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window* ...@@ -1157,23 +1157,10 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window*
return 0; return 0;
} }
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window* pParent, SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet)
const SfxItemSet* pArgSet,
int nId)
{ {
SfxTabDialog* pDlg=NULL; SfxTabDialog* pDlg = new ScSubTotalDlg( pParent, pArgSet );
switch ( nId ) return new ScAbstractTabDialog_Impl( pDlg );
{
case RID_SCDLG_SUBTOTALS :
pDlg = new ScSubTotalDlg( pParent, pArgSet );
break;
default:
break;
}
if ( pDlg )
return new ScAbstractTabDialog_Impl( pDlg );
return 0;
} }
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
......
...@@ -560,8 +560,7 @@ public: ...@@ -560,8 +560,7 @@ public:
int nId); int nId);
virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent,
const SfxItemSet* pArgSet, const SfxItemSet* pArgSet );
int nId);
virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
const SfxObjectShell* pDocShell, int nId ); const SfxObjectShell* pDocShell, int nId );
......
...@@ -25,31 +25,28 @@ ...@@ -25,31 +25,28 @@
#include "tpsubt.hxx" #include "tpsubt.hxx"
#include "scresid.hxx" #include "scresid.hxx"
#include "subtdlg.hxx" #include "subtdlg.hxx"
#include "subtdlg.hrc"
//================================================================== //==================================================================
ScSubTotalDlg::ScSubTotalDlg( Window* pParent, ScSubTotalDlg::ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet)
const SfxItemSet* pArgSet ) : : SfxTabDialog(pParent, "SubTotalDialog",
SfxTabDialog( pParent, "modules/scalc/ui/subtotaldialog.ui", pArgSet)
ScResId( RID_SCDLG_SUBTOTALS ),
pArgSet ),
aBtnRemove ( m_pActionArea, ScResId( BTN_REMOVE ) )
{ {
AddTabPage( PAGE_GROUP1, ScTpSubTotalGroup1::Create, 0 ); get(m_pBtnRemove, "remove");
AddTabPage( PAGE_GROUP2, ScTpSubTotalGroup2::Create, 0 );
AddTabPage( PAGE_GROUP3, ScTpSubTotalGroup3::Create, 0 ); AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, 0);
AddTabPage( PAGE_OPTIONS, ScTpSubTotalOptions::Create, 0 ); AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, 0);
aBtnRemove.SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) ); AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, 0);
FreeResource(); AddTabPage("options", ScTpSubTotalOptions::Create, 0);
m_pBtnRemove->SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) );
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn ) IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
{ {
if ( pBtn == &aBtnRemove ) if (pBtn == m_pBtnRemove)
{ {
EndDialog( SCRET_REMOVE ); EndDialog( SCRET_REMOVE );
} }
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "sc.hrc" #include "sc.hrc"
#include "subtdlg.hxx" #include "subtdlg.hxx"
#include "subtdlg.hrc"
#include "tpsubt.hxx" #include "tpsubt.hxx"
//======================================================================== //========================================================================
......
/* -*- 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 "sc.hrc"
// TabDialog
#define BTN_REMOVE 1
#define PAGE_GROUP1 2
#define PAGE_GROUP2 3
#define PAGE_GROUP3 4
#define PAGE_OPTIONS 5
// Groups TabPages
#define FT_GROUP 10
#define LB_GROUP 11
#define FT_COLUMNS 12
#define WND_COLUMNS 13
#define LB_FUNCTIONS 14
#define FT_FUNCTIONS 15
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
class ScSubTotalDlg : public SfxTabDialog class ScSubTotalDlg : public SfxTabDialog
{ {
public: public:
ScSubTotalDlg( Window* pParent, ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet);
const SfxItemSet* pArgSet );
private: private:
PushButton aBtnRemove; PushButton* m_pBtnRemove;
DECL_LINK( RemoveHdl, PushButton * ); DECL_LINK( RemoveHdl, PushButton * );
}; };
......
/* -*- 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 "subtdlg.hrc"
TabDialog RID_SCDLG_SUBTOTALS
{
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 294 , 176 ) ;
Text [ en-US ] = "Subtotals" ;
Moveable = TRUE ;
Closeable = FALSE ;
TabControl 1
{
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 3 , 3 ) ;
Size = MAP_APPFONT ( 240 , 150 ) ;
PageList =
{
PageItem
{
Identifier = PAGE_GROUP1 ;
Text [ en-US ] = "1st Group" ;
};
PageItem
{
Identifier = PAGE_GROUP2 ;
Text [ en-US ] = "2nd Group" ;
};
PageItem
{
Identifier = PAGE_GROUP3 ;
Text [ en-US ] = "3rd Group" ;
};
PageItem
{
Identifier = PAGE_OPTIONS ;
Text [ en-US ] = "Options" ;
};
};
};
PushButton BTN_REMOVE
{
Pos = MAP_APPFONT ( 143 , 160 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -2729,10 +2729,10 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) ...@@ -2729,10 +2729,10 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) ); aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); assert(pFact); //"ScAbstractFactory create fail
pDlg = pFact->CreateScSubTotalDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SUBTOTALS ); pDlg = pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet);
OSL_ENSURE(pDlg, "Dialog create fail!"); assert(pDlg); // "Dialog create fail
pDlg->SetCurPageId(1); pDlg->SetCurPageId(1);
short bResult = pDlg->Execute(); short bResult = pDlg->Execute();
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="SubTotalDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Subtotals</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>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</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">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove">
<property name="label">gtk-remove</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">4</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">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="1stgroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">1st Group</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="2ndgroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">2nd Group</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="3rdgroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">3rd Group</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="options">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Options</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
</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-widget response="0">reset</action-widget>
<action-widget response="0">remove</action-widget>
</action-widgets>
</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