Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #undef SC_DLLIMPLEMENTATION
22 :
23 :
24 : #include <vcl/msgbox.hxx>
25 : #include "tpsort.hxx"
26 : #include "sortdlg.hxx"
27 : #include "scresid.hxx"
28 : #include "sortdlg.hrc"
29 :
30 0 : ScSortDlg::ScSortDlg( Window* pParent,
31 : const SfxItemSet* pArgSet ) :
32 : SfxTabDialog( pParent,
33 : ScResId( RID_SCDLG_SORT ),
34 : pArgSet ),
35 : bIsHeaders ( false ),
36 0 : bIsByRows ( false )
37 : {
38 0 : AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
39 0 : AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
40 0 : FreeResource();
41 0 : }
42 :
43 0 : ScSortDlg::~ScSortDlg()
44 : {
45 0 : }
46 :
47 : //==================================================================
48 0 : ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
49 : const String& rExtendText,
50 : const String& rCurrentText ):
51 : ModalDialog ( pParent, ScResId( RID_SCDLG_SORT_WARNING ) ),
52 : aFtText ( this, ScResId( FT_TEXT ) ),
53 : aFtTip ( this, ScResId( FT_TIP ) ),
54 : aBtnExtSort ( this, ScResId( BTN_EXTSORT ) ),
55 : aBtnCurSort ( this, ScResId( BTN_CURSORT ) ),
56 0 : aBtnCancel ( this, ScResId( BTN_CANCEL ) )
57 : {
58 0 : String sTextName = aFtText.GetText();
59 0 : sTextName.SearchAndReplaceAscii("%1", rExtendText);
60 0 : sTextName.SearchAndReplaceAscii("%2", rCurrentText);
61 0 : aFtText.SetText( sTextName );
62 :
63 0 : aBtnExtSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
64 0 : aBtnCurSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
65 :
66 0 : FreeResource();
67 0 : }
68 :
69 0 : ScSortWarningDlg::~ScSortWarningDlg()
70 : {
71 0 : }
72 :
73 0 : IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
74 : {
75 0 : if ( pBtn == &aBtnExtSort )
76 : {
77 0 : EndDialog( BTN_EXTEND_RANGE );
78 : }
79 0 : else if( pBtn == &aBtnCurSort )
80 : {
81 0 : EndDialog( BTN_CURRENT_SELECTION );
82 : }
83 0 : return 0;
84 0 : }
85 : //========================================================================//
86 :
87 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|