-rw-r--r-- | microkde/kdeui/kbuttonbox.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/microkde/kdeui/kbuttonbox.h b/microkde/kdeui/kbuttonbox.h index 1104366..2e0f41d 100644 --- a/microkde/kdeui/kbuttonbox.h +++ b/microkde/kdeui/kbuttonbox.h | |||
@@ -1,139 +1,141 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com) | 2 | Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef __KBUTTONBOX__H__ | 20 | #ifndef __KBUTTONBOX__H__ |
21 | #define __KBUTTONBOX__H__ | 21 | #define __KBUTTONBOX__H__ |
22 | 22 | ||
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | //Added by qt3to4: | ||
25 | #include <QResizeEvent> | ||
24 | class QPushButton; | 26 | class QPushButton; |
25 | 27 | ||
26 | class KButtonBoxPrivate; | 28 | class KButtonBoxPrivate; |
27 | /** | 29 | /** |
28 | * Container widget for buttons. | 30 | * Container widget for buttons. |
29 | * | 31 | * |
30 | * This class uses Qt layout control to place the buttons; can handle | 32 | * This class uses Qt layout control to place the buttons; can handle |
31 | * both vertical and horizontal button placement. The default border | 33 | * both vertical and horizontal button placement. The default border |
32 | * is now @p 0 (making it easier to deal with layouts). The space | 34 | * is now @p 0 (making it easier to deal with layouts). The space |
33 | * between buttons is now more Motif compliant. | 35 | * between buttons is now more Motif compliant. |
34 | * | 36 | * |
35 | * @author Mario Weilguni <mweilguni@sime.com> | 37 | * @author Mario Weilguni <mweilguni@sime.com> |
36 | * @version $Id$ | 38 | * @version $Id$ |
37 | **/ | 39 | **/ |
38 | 40 | ||
39 | class KButtonBox : public QWidget | 41 | class KButtonBox : public QWidget |
40 | { | 42 | { |
41 | Q_OBJECT | 43 | Q_OBJECT |
42 | 44 | ||
43 | public: | 45 | public: |
44 | /** | 46 | /** |
45 | * Create an empty container for buttons. | 47 | * Create an empty container for buttons. |
46 | * | 48 | * |
47 | * If @p _orientation is @p Vertical, the buttons inserted with | 49 | * If @p _orientation is @p Vertical, the buttons inserted with |
48 | * @ref addButton() are laid out from top to bottom, otherwise they | 50 | * @ref addButton() are laid out from top to bottom, otherwise they |
49 | * are laid out from left to right. | 51 | * are laid out from left to right. |
50 | */ | 52 | */ |
51 | KButtonBox(QWidget *parent, Orientation _orientation = Horizontal, | 53 | KButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal, |
52 | int border = 0, int _autoborder = 6); | 54 | int border = 0, int _autoborder = 6); |
53 | 55 | ||
54 | /** | 56 | /** |
55 | * Free private data field | 57 | * Free private data field |
56 | */ | 58 | */ |
57 | ~KButtonBox(); | 59 | ~KButtonBox(); |
58 | 60 | ||
59 | /** | 61 | /** |
60 | * @return The minimum size needed to fit all buttons. | 62 | * @return The minimum size needed to fit all buttons. |
61 | * | 63 | * |
62 | * This size is | 64 | * This size is |
63 | * calculated by the width/height of all buttons plus border/autoborder. | 65 | * calculated by the width/height of all buttons plus border/autoborder. |
64 | */ | 66 | */ |
65 | virtual QSize sizeHint() const; | 67 | virtual QSize sizeHint() const; |
66 | /** | 68 | /** |
67 | * @reimplemented | 69 | * @reimplemented |
68 | */ | 70 | */ |
69 | virtual QSizePolicy sizePolicy() const; | 71 | virtual QSizePolicy sizePolicy() const; |
70 | /** | 72 | /** |
71 | * @reimplemented | 73 | * @reimplemented |
72 | */ | 74 | */ |
73 | virtual void resizeEvent(QResizeEvent *); | 75 | virtual void resizeEvent(QResizeEvent *); |
74 | 76 | ||
75 | /** | 77 | /** |
76 | * Add a new @ref QPushButton. | 78 | * Add a new @ref QPushButton. |
77 | * | 79 | * |
78 | * @param noexpand If @p noexpand is @p false, the width | 80 | * @param noexpand If @p noexpand is @p false, the width |
79 | * of the button is adjusted to fit the other buttons (the maximum | 81 | * of the button is adjusted to fit the other buttons (the maximum |
80 | * of all buttons is taken). If @p noexpand is @p true, the width of this | 82 | * of all buttons is taken). If @p noexpand is @p true, the width of this |
81 | * button will be set to the minimum width needed for the given text). | 83 | * button will be set to the minimum width needed for the given text). |
82 | * | 84 | * |
83 | * @return A pointer to the new button. | 85 | * @return A pointer to the new button. |
84 | */ | 86 | */ |
85 | QPushButton *addButton(const QString& text, bool noexpand = FALSE); | 87 | QPushButton *addButton(const QString& text, bool noexpand = FALSE); |
86 | 88 | ||
87 | /** | 89 | /** |
88 | * Add a new @ref QPushButton. | 90 | * Add a new @ref QPushButton. |
89 | * | 91 | * |
90 | * @param receiver An object to connect to. | 92 | * @param receiver An object to connect to. |
91 | * @param slot A Qt slot to connect the 'clicked()' signal to. | 93 | * @param slot A Qt slot to connect the 'clicked()' signal to. |
92 | * @param noexpand If @p noexpand is @p false, the width | 94 | * @param noexpand If @p noexpand is @p false, the width |
93 | * of the button is adjusted to fit the other buttons (the maximum | 95 | * of the button is adjusted to fit the other buttons (the maximum |
94 | * of all buttons is taken). If @p noexpand @p true, the width of this | 96 | * of all buttons is taken). If @p noexpand @p true, the width of this |
95 | * button will be set to the minimum width needed for the given text). | 97 | * button will be set to the minimum width needed for the given text). |
96 | * | 98 | * |
97 | * @return A pointer to the new button. | 99 | * @return A pointer to the new button. |
98 | */ | 100 | */ |
99 | QPushButton *addButton(const QString& text, QObject * receiver, const char * slot, bool noexpand = FALSE); | 101 | QPushButton *addButton(const QString& text, QObject * receiver, const char * slot, bool noexpand = FALSE); |
100 | 102 | ||
101 | /** | 103 | /** |
102 | * Add a stretch to the buttonbox. | 104 | * Add a stretch to the buttonbox. |
103 | * | 105 | * |
104 | * Can be used to separate buttons. That is, if you add the | 106 | * Can be used to separate buttons. That is, if you add the |
105 | * buttons OK and Cancel, add a stretch, and then add the button Help, | 107 | * buttons OK and Cancel, add a stretch, and then add the button Help, |
106 | * the buttons OK and Cancel will be left-aligned (or top-aligned | 108 | * the buttons OK and Cancel will be left-aligned (or top-aligned |
107 | * for vertical) whereas Help will be right-aligned (or | 109 | * for vertical) whereas Help will be right-aligned (or |
108 | * bottom-aligned for vertical). | 110 | * bottom-aligned for vertical). |
109 | * | 111 | * |
110 | * @see QBoxLayout | 112 | * @see QBoxLayout |
111 | */ | 113 | */ |
112 | void addStretch(int scale = 1); | 114 | void addStretch(int scale = 1); |
113 | 115 | ||
114 | /** | 116 | /** |
115 | * This function must be called @em once after all buttons have been | 117 | * This function must be called @em once after all buttons have been |
116 | * inserted. | 118 | * inserted. |
117 | * | 119 | * |
118 | * It will start layout control. | 120 | * It will start layout control. |
119 | */ | 121 | */ |
120 | void layout(); | 122 | void layout(); |
121 | 123 | ||
122 | public: // as PrivateData needs Item, it has to be exported | 124 | public: // as PrivateData needs Item, it has to be exported |
123 | class Item; | 125 | class Item; |
124 | protected: | 126 | protected: |
125 | /** | 127 | /** |
126 | * @return the best size for a button. Checks all buttons and takes | 128 | * @return the best size for a button. Checks all buttons and takes |
127 | * the maximum width/height. | 129 | * the maximum width/height. |
128 | */ | 130 | */ |
129 | QSize bestButtonSize() const; | 131 | QSize bestButtonSize() const; |
130 | void placeButtons(); | 132 | void placeButtons(); |
131 | QSize buttonSizeHint(QPushButton *) const; | 133 | QSize buttonSizeHint(QPushButton *) const; |
132 | 134 | ||
133 | protected: | 135 | protected: |
134 | virtual void virtual_hook( int id, void* data ); | 136 | virtual void virtual_hook( int id, void* data ); |
135 | private: | 137 | private: |
136 | KButtonBoxPrivate *data; | 138 | KButtonBoxPrivate *data; |
137 | }; | 139 | }; |
138 | 140 | ||
139 | #endif | 141 | #endif |