Kaydet (Commit) 50edf566 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert sort dialog to .ui format

Change-Id: I9c82b504df0879c338f1858b16ed70a91d459e02
üst 3bbf357e
......@@ -50,7 +50,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/src/miscdlgs.src \
sc/source/ui/src/tabopdlg.src \
sc/source/ui/src/scstring.src \
sc/source/ui/src/sortdlg.src \
sc/source/ui/src/filter.src \
sc/source/ui/src/condformatdlg.src \
sc/source/ui/src/condformatmgr.src \
......
......@@ -129,6 +129,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sidebarcellappearance \
sc/uiconfig/scalc/ui/solverdlg \
sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortdialog \
sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \
sc/uiconfig/scalc/ui/sortwarning \
......
......@@ -988,8 +988,6 @@
#define BMP_END (BMP_START + 100)
#define SC_DIALOGS_START (BMP_END)
#define RID_SCDLG_SORT (SC_DIALOGS_START + 5)
#define RID_SCPAGE_SORT_FIELDS (SC_DIALOGS_START + 6)
#define RID_SCDLG_FILTER (SC_DIALOGS_START + 8)
......
......@@ -502,8 +502,7 @@ public:
virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh ) = 0;
virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId ) = 0;
virtual SfxAbstractTabDialog * CreateScSortDlg(Window* pParent, const SfxItemSet* pArgSet) = 0;
// for tabpage
virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
......
......@@ -1217,22 +1217,10 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg( Wind
return 0;
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId )
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg(Window* pParent, const SfxItemSet* pArgSet)
{
SfxTabDialog* pDlg=NULL;
switch ( nId )
{
case RID_SCDLG_SORT :
pDlg = new ScSortDlg( pParent, pArgSet );
break;
default:
break;
}
if ( pDlg )
return new ScAbstractTabDialog_Impl( pDlg );
return 0;
SfxTabDialog* pDlg = new ScSortDlg( pParent, pArgSet );
return new ScAbstractTabDialog_Impl( pDlg );
}
#undef SfxTabDialog
......
......@@ -570,8 +570,7 @@ public:
virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh );
virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId );
virtual SfxAbstractTabDialog * CreateScSortDlg(Window* pParent, const SfxItemSet* pArgSet);
// For TabPage
virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId );
......
......@@ -25,30 +25,20 @@
#include "tpsort.hxx"
#include "sortdlg.hxx"
#include "scresid.hxx"
#include "sortdlg.hrc"
ScSortDlg::ScSortDlg( Window* pParent,
const SfxItemSet* pArgSet ) :
SfxTabDialog( pParent,
ScResId( RID_SCDLG_SORT ),
pArgSet ),
bIsHeaders ( false ),
bIsByRows ( false )
{
AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
FreeResource();
}
ScSortDlg::~ScSortDlg()
ScSortDlg::ScSortDlg(Window* pParent, const SfxItemSet* pArgSet)
: SfxTabDialog(pParent, "SortDialog", "modules/scalc/ui/sortdialog.ui", pArgSet)
, bIsHeaders(false)
, bIsByRows(false)
{
AddTabPage("criteria", ScTabPageSortFields::Create, 0);
AddTabPage("options", ScTabPageSortOptions::Create, 0);
}
//==================================================================
ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
const OUString& rExtendText,
const OUString& rCurrentText ):
ModalDialog ( pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui" )
ScSortWarningDlg::ScSortWarningDlg(Window* pParent,
const OUString& rExtendText, const OUString& rCurrentText)
: ModalDialog(pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui")
{
get(aFtText, "sorttext" );
get( aBtnExtSort, "extend" );
......@@ -63,10 +53,6 @@ ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
}
ScSortWarningDlg::~ScSortWarningDlg()
{
}
IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
{
if ( pBtn == aBtnExtSort )
......
......@@ -9,7 +9,6 @@
#include "sortkeydlg.hxx"
#include "sortdlg.hxx"
#include "sortdlg.hrc"
#include <vcl/layout.hxx>
// =======================================================================
......
......@@ -43,7 +43,6 @@
#include "sortkeydlg.hxx"
#include "sortdlg.hxx"
#include "sortdlg.hrc"
#define _TPSORT_CXX
#include "tpsort.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"
// -> RID_SCPAGE_SORT_FIELDS
// -> SCSTR_NONAME
// -> SCSTR_UNDEFINED
// -> SCSTR_FIELD
#define TP_FIELDS 1
#define TP_OPTIONS 2
// TP_SORT_FIELDS:
#define CTRL_MANAGESORTKEY 1
#define WIN_MANAGESORTKEY 2
#define SB_SORT 3
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -29,31 +29,22 @@
class ScSortDlg : public SfxTabDialog
{
public:
ScSortDlg( Window* pParent,
const SfxItemSet* pArgSet );
virtual ~ScSortDlg();
void SetHeaders( sal_Bool bHeaders );
void SetByRows ( sal_Bool bByRows );
sal_Bool GetHeaders() const;
sal_Bool GetByRows () const;
ScSortDlg(Window* pParent, const SfxItemSet* pArgSet);
void SetHeaders( sal_Bool bHeaders ) { bIsHeaders = bHeaders; }
void SetByRows ( sal_Bool bByRows ) { bIsByRows = bByRows; }
sal_Bool GetHeaders() const { return bIsHeaders; }
sal_Bool GetByRows () const { return bIsByRows; }
private:
sal_Bool bIsHeaders;
sal_Bool bIsByRows;
};
inline void ScSortDlg::SetHeaders( sal_Bool bHeaders ) { bIsHeaders = bHeaders; }
inline void ScSortDlg::SetByRows ( sal_Bool bByRows ) { bIsByRows = bByRows; }
inline sal_Bool ScSortDlg::GetHeaders() const { return bIsHeaders; }
inline sal_Bool ScSortDlg::GetByRows () const { return bIsByRows; }
class ScSortWarningDlg : public ModalDialog
{
public:
ScSortWarningDlg( Window* pParent, const OUString& rExtendText,const OUString& rCurrentText );
~ScSortWarningDlg();
DECL_LINK( BtnHdl, PushButton* );
private:
FixedText* aFtText;
......
......@@ -13,7 +13,6 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include "anyrefdg.hxx"
#include "sortdlg.hrc"
#include <vcl/edit.hxx>
#include <vcl/fixed.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 "sortdlg.hrc"
TabDialog RID_SCDLG_SORT
{
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 175 ) ;
Text [ en-US ] = "Sort" ;
Moveable = TRUE ;
Sizeable = TRUE ;
Closeable = FALSE ;
TabControl 1
{
OutputSize = TRUE ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( 210 , 170 ) ;
PageList =
{
PageItem
{
Identifier = TP_FIELDS ;
PageResID = TP_FIELDS ;
Text [ en-US ] = "Sort Criteria" ;
};
PageItem
{
Identifier = TP_OPTIONS ;
PageResID = TP_OPTIONS ;
Text [ en-US ] = "Options" ;
};
};
};
OKButton 1
{
Pos = MAP_APPFONT ( 3 , 157 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT ( 49 , 157 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
};
PushButton 1
{
Pos = MAP_APPFONT ( 137 , 157 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
};
HelpButton 1
{
Pos = MAP_APPFONT ( 94 , 157 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -475,11 +475,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
aArgSet.Put( ScSortItem( SCITEM_SORTDATA, GetViewData(), &aSortParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
assert(pFact); //ScAbstractFactory create fail!
pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT );
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab
pDlg = pFact->CreateScSortDlg(pTabViewShell->GetDialogParent(), &aArgSet);
assert(pDlg); //Dialog create fail!
pDlg->SetCurPageId("criteria"); // 1=sort field tab 2=sort options tab
if ( pDlg->Execute() == RET_OK )
{
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="SortDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Sort</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>
</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="criteria">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Sort Criteria</property>
</object>
<packing>
<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">1</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-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