mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 23:42:15 +08:00
Make Fl_Output a subclass of Fl_Input, and add input_type and readonly
methods/constants to support Fl_Output as a special case of Fl_Input (you can do everything but change the text in Fl_Output...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2073 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+12
-2
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.H,v 1.6.2.4.2.3 2002/03/07 19:22:56 spitzak Exp $"
|
||||
// "$Id: Fl_Input_.H,v 1.6.2.4.2.4 2002/04/11 11:52:40 easysw Exp $"
|
||||
//
|
||||
// Input base class header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -36,6 +36,10 @@
|
||||
#define FL_HIDDEN_INPUT 3
|
||||
#define FL_MULTILINE_INPUT 4
|
||||
#define FL_SECRET_INPUT 5
|
||||
#define FL_INPUT_TYPE 7
|
||||
#define FL_INPUT_READONLY 8
|
||||
#define FL_NORMAL_OUTPUT (FL_NORMAL_INPUT | FL_INPUT_READONLY)
|
||||
#define FL_MULTILINE_OUTPUT (FL_MULTILINE_INPUT | FL_INPUT_READONLY)
|
||||
|
||||
class Fl_Input_ : public Fl_Widget {
|
||||
|
||||
@@ -117,10 +121,16 @@ public:
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;}
|
||||
void cursor_color(unsigned n) {cursor_color_ = n;}
|
||||
|
||||
int input_type() const {return type() & FL_INPUT_TYPE; }
|
||||
void input_type(int t) { type(t | readonly()); }
|
||||
int readonly() const { return type() & FL_INPUT_READONLY; }
|
||||
void readonly(int b) { if (b) type(type() | FL_INPUT_READONLY);
|
||||
else type(type() & FL_INPUT_TYPE); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.H,v 1.6.2.4.2.3 2002/03/07 19:22:56 spitzak Exp $".
|
||||
// End of "$Id: Fl_Input_.H,v 1.6.2.4.2.4 2002/04/11 11:52:40 easysw Exp $".
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user