Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : : *
5 : : * The contents of this file are subject to the Mozilla Public License Version
6 : : * 1.1 (the "License"); you may not use this file except in compliance with
7 : : * the License or as specified alternatively below. You may obtain a copy of
8 : : * the License at http://www.mozilla.org/MPL/
9 : : *
10 : : * Software distributed under the License is distributed on an "AS IS" basis,
11 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : : * for the specific language governing rights and limitations under the
13 : : * License.
14 : : *
15 : : * Major Contributor(s):
16 : : * Copyright (C) 2012 Albert Thuswaldner <albert.thuswaldner@gmail.com> (initial developer)
17 : : *
18 : : * All Rights Reserved.
19 : : *
20 : : * For minor contributions see the git repository.
21 : : *
22 : : * Alternatively, the contents of this file may be used under the terms of
23 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : : * instead of those above.
27 : : */
28 : :
29 : : #ifndef SC_SORTKEYDLG_HXX
30 : : #define SC_SORTKEYDLG_HXX
31 : :
32 : : #include <boost/ptr_container/ptr_vector.hpp>
33 : :
34 : : #include "anyrefdg.hxx"
35 : : #include "sortdlg.hrc"
36 : :
37 : : #include <vcl/edit.hxx>
38 : : #include <vcl/fixed.hxx>
39 : : #include <vcl/lstbox.hxx>
40 : : #include <vcl/scrbar.hxx>
41 : : #include <vcl/ctrl.hxx>
42 : : #include <svtools/stdctrl.hxx>
43 : : #include <svx/langbox.hxx>
44 : :
45 : : // =======================================================================
46 : :
47 : 0 : struct ScSortKeyItem
48 : : {
49 : : FixedLine aFlSort;
50 : : ListBox aLbSort;
51 : : RadioButton aBtnUp;
52 : : RadioButton aBtnDown;
53 : :
54 : : ScSortKeyItem ( Window* pParent );
55 : :
56 : : void DisableField();
57 : : void EnableField();
58 : : };
59 : :
60 : : typedef boost::ptr_vector<ScSortKeyItem> ScSortKeyItems;
61 : :
62 : : // =======================================================================
63 : :
64 : : class ScSortKeyWindow : public Window
65 : : {
66 : : private:
67 : : FixedLine aFlSort;
68 : : ListBox aLbSort;
69 : : RadioButton aBtnUp;
70 : : RadioButton aBtnDown;
71 : :
72 : : sal_Int32 nScrollPos;
73 : : sal_Int32 nItemHeight;
74 : :
75 : : ScSortKeyItems& mrSortKeyItems;
76 : :
77 : : public:
78 : : ScSortKeyWindow( Window* pParent, const ResId& rResId, ScSortKeyItems& mrSortKeyItems );
79 : : ~ScSortKeyWindow();
80 : :
81 : : void AddSortKey( sal_uInt16 nItem );
82 : : void DoScroll( sal_Int32 nNewPos );
83 : 0 : sal_Int32 GetItemHeight() const { return nItemHeight; }
84 : : };
85 : :
86 : : // =======================================================================
87 : :
88 : : class ScSortKeyCtrl : public Control
89 : : {
90 : : private:
91 : : ScSortKeyWindow aSortWin;
92 : : ScrollBar aVertScroll;
93 : :
94 : : sal_Int32 nThumbPos;
95 : :
96 : : DECL_LINK( ScrollHdl, ScrollBar* );
97 : :
98 : : public:
99 : : ScSortKeyCtrl( Window* pParent, const ScResId& rResId, ScSortKeyItems& mrSortKeyItems );
100 : : ~ScSortKeyCtrl();
101 : :
102 : : void AddSortKey( sal_uInt16 nItem );
103 : : };
104 : :
105 : : #endif // SC_SORTKEYDLG_HXX
106 : :
107 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|