Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #undef SC_DLLIMPLEMENTATION
31 : :
32 : :
33 : : #include <vcl/msgbox.hxx>
34 : : #include "tpsort.hxx"
35 : : #include "sortdlg.hxx"
36 : : #include "scresid.hxx"
37 : : #include "sortdlg.hrc"
38 : :
39 : 0 : ScSortDlg::ScSortDlg( Window* pParent,
40 : : const SfxItemSet* pArgSet ) :
41 : : SfxTabDialog( pParent,
42 : : ScResId( RID_SCDLG_SORT ),
43 : : pArgSet ),
44 : : bIsHeaders ( false ),
45 : 0 : bIsByRows ( false )
46 : : {
47 : 0 : AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
48 : 0 : AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
49 : 0 : FreeResource();
50 : 0 : }
51 : :
52 : 0 : ScSortDlg::~ScSortDlg()
53 : : {
54 : 0 : }
55 : :
56 : : //==================================================================
57 : 0 : ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
58 : : const String& rExtendText,
59 : : const String& rCurrentText ):
60 : : ModalDialog ( pParent, ScResId( RID_SCDLG_SORT_WARNING ) ),
61 : : aFtText ( this, ScResId( FT_TEXT ) ),
62 : : aFtTip ( this, ScResId( FT_TIP ) ),
63 : : aBtnExtSort ( this, ScResId( BTN_EXTSORT ) ),
64 : : aBtnCurSort ( this, ScResId( BTN_CURSORT ) ),
65 : 0 : aBtnCancel ( this, ScResId( BTN_CANCEL ) )
66 : : {
67 : 0 : String sTextName = aFtText.GetText();
68 : 0 : sTextName.SearchAndReplaceAscii("%1", rExtendText);
69 : 0 : sTextName.SearchAndReplaceAscii("%2", rCurrentText);
70 : 0 : aFtText.SetText( sTextName );
71 : :
72 : 0 : aBtnExtSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
73 : 0 : aBtnCurSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
74 : :
75 : 0 : FreeResource();
76 : 0 : }
77 : :
78 : 0 : ScSortWarningDlg::~ScSortWarningDlg()
79 : : {
80 : 0 : }
81 : :
82 : 0 : IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
83 : : {
84 : 0 : if ( pBtn == &aBtnExtSort )
85 : : {
86 : 0 : EndDialog( BTN_EXTEND_RANGE );
87 : : }
88 : 0 : else if( pBtn == &aBtnCurSort )
89 : : {
90 : 0 : EndDialog( BTN_CURRENT_SELECTION );
91 : : }
92 : 0 : return 0;
93 : : }
94 : : //========================================================================//
95 : :
96 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|