annotate dw/fltkcomplexbutton.hh @ 2035:5625ee0230ad

clean out fltkcomplexbutton a bit
author corvid <corvid@lavabit.com>
date Wed, 18 May 2011 16:19:58 +0000
parents f542084fa707
children 6a8f4de33240
rev   line source
1325
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
1
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
2 // fltkcomplexbutton.hh contains code from FLTK 1.3's FL/Fl_Button.H
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
3 // that is Copyright 1998-2010 by Bill Spitzak and others.
1325
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
4
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
5 /*
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
6 * This program is free software; you can redistribute it and/or modify
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
7 * it under the terms of the GNU General Public License as published by
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
8 * the Free Software Foundation; either version 3 of the License, or
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
9 * (at your option) any later version.
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
10 *
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
11 * This program is distributed in the hope that it will be useful,
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
14 * GNU General Public License for more details.
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
15 *
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
16 * You should have received a copy of the GNU General Public License
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23d34e319c36 fix up licensing
corvid <corvid@lavabit.com>
parents: 1031
diff changeset
18 */
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
19
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
20 #ifndef __FLTK_COMPLEX_BUTTON_HH__
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
21 #define __FLTK_COMPLEX_BUTTON_HH__
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
22
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
23 #include <FL/Fl_Group.H>
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
24
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
25 extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
26
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
27 namespace dw {
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
28 namespace fltk {
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
29 namespace ui {
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
30
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
31 class FL_EXPORT ComplexButton : public Fl_Group {
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
32
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
33 int shortcut_;
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
34 char value_;
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
35 char oldval;
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
36 uchar down_box_;
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
37
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
38 protected:
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
39 virtual void draw();
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
40
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
41 public:
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
42 virtual int handle(int);
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
43
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
44 ComplexButton(int X, int Y, int W, int H, const char *L = 0);
1876
73336563b6e7 don't let complex button destroy flat view
corvid <corvid@lavabit.com>
parents: 1811
diff changeset
45 ~ComplexButton();
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
46
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
47 int value(int v);
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
48
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
49 /**
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
50 Returns the current value of the button (0 or 1).
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
51 */
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
52 char value() const {return value_;}
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
53
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
54 /**
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
55 Returns the current down box type, which is drawn when value() is non-zero.
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
56 \retval Fl_Boxtype
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
57 */
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
58 Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
59
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
60 /**
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
61 Sets the down box type. The default value of 0 causes FLTK to figure out
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
62 the correct matching down version of box().
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
63 \param[in] b down box type
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
64 */
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
65 void down_box(Fl_Boxtype b) {down_box_ = b;}
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
66
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
67 /// (for backwards compatibility)
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
68 void down_color(unsigned c) {selection_color(c);}
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
69 };
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
70
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
71 } // namespace ui
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
72 } // namespace fltk
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
73 } // namespace dw
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
74
1811
630b3ab2f2bd fltkcomplexbutton from Fl_Button
corvid <corvid@lavabit.com>
parents: 1325
diff changeset
75 #endif
347
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
76
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
77 //
e5955ab8dafb - Moved the dw2 tree into dillo2's tree.
jcid
parents:
diff changeset
78 //