Author: matt
Date: 2011-01-09 15:49:21 -0800 (Sun, 09 Jan 2011)
New Revision: 8235
Log:
Porting a few more Fl_Widget functions.
Modified:
branches/branch-3.0-2011/FL/Fl_Widget.H
Modified: branches/branch-3.0-2011/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0-2011/FL/Fl_Widget.H 2011-01-09 23:38:46 UTC (rev
8234)
+++ branches/branch-3.0-2011/FL/Fl_Widget.H 2011-01-09 23:49:21 UTC (rev
8235)
@@ -104,28 +104,27 @@
protected:
enum {
- INACTIVE = 1<<0, ///< the widget can't receive focus, and is
disabled but potentially visible
- INVISIBLE = 1<<1, ///< the widget is not drawn but can receive
events
- OUTPUT = 1<<2, ///< for output only
- NOBORDER = 1<<3, ///< don't draw a decoration (Fl_Window)
- FORCE_POSITION = 1<<4, ///< don't let the window manager position the
window (Fl_Window)
- NON_MODAL = 1<<5, ///< thisis a hovering toolbar window (Fl_Window)
- SHORTCUT_LABEL = 1<<6, ///< the label contains a shortcut we need to
draw
- CHANGED = 1<<7, ///< the widget value changed
- OVERRIDE = 1<<8, ///< position window on top (Fl_Window)
- VISIBLE_FOCUS = 1<<9, ///< accepts keyboard focus navigation if the
widget can have the focus
- COPIED_LABEL = 1<<10, ///< the widget label is internally copied, its
destruction is handled by the widget
- CLIP_CHILDREN = 1<<11, ///< all drawing within this widget will be
clipped (Fl_Group)
- MENU_WINDOW = 1<<12, ///< a temporary popup window, dismissed by
clicking outside (Fl_Window)
- TOOLTIP_WINDOW = 1<<13, ///< a temporary popup, transparent to events,
and dismissed easily (Fl_Window)
- MODAL = 1<<14, ///< a window blocking input to all other winows
(Fl_Window)
- NO_OVERLAY = 1<<15, ///< window not using a hardware overlay plane
(Fl_Menu_Window)
- GROUP_RELATIVE = 1<<16, ///< position this idget relative to the parent
group, not to the window
- COPIED_TOOLTIP = 1<<17, ///< the widget tooltip is internally copied,
its destruction is handled by the widget
- // (space for more flags)
- USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
- USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
- USERFLAG1 = 1<<31 ///< reserved for 3rd party extensions
+ INACTIVE = 1<<0,
+ INVISIBLE = 1<<1,
+ OUTPUT = 1<<2,
+ NOBORDER = 1<<3,
+ FORCE_POSITION = 1<<4,
+ NON_MODAL = 1<<5,
+ SHORTCUT_LABEL = 1<<6,
+ CHANGED = 1<<7,
+ OVERRIDE = 1<<8,
+ VISIBLE_FOCUS = 1<<9,
+ COPIED_LABEL = 1<<10,
+ CLIP_CHILDREN = 1<<11,
+ MENU_WINDOW = 1<<12,
+ TOOLTIP_WINDOW = 1<<13,
+ MODAL = 1<<14,
+ NO_OVERLAY = 1<<15,
+ GROUP_RELATIVE = 1<<16,
+ COPIED_TOOLTIP = 1<<17,
+ USERFLAG3 = 1<<29,
+ USERFLAG2 = 1<<30,
+ USERFLAG1 = 1<<31
};
Fl_Widget() {}
@@ -163,7 +162,6 @@
void draw_backdrop() const {
((fltk3::Widget*)_p)->draw_backdrop();
}
- /** draws a focus rectangle around the widget */
void draw_focus() {
((fltk3::Widget*)_p)->draw_focus();
}
@@ -179,22 +177,21 @@
public:
- Fl_Widget(int x, int y, int w, int h, const char *label=0L)
- {
+ Fl_Widget(int x, int y, int w, int h, const char *label=0L) {
_p = new fltk3::Widget(x, y, w, h, label);
_p->wrapper(this);
}
#if 0 // TODO: FLTK123
- virtual ~Fl_Widget();
- virtual void draw() = 0;
- virtual int handle(int event);
- virtual void resize(int x, int y, int w, int h);
- virtual void show();
- virtual void hide();
- virtual Fl_Group* as_group() {return 0;}
- virtual Fl_Window* as_window() {return 0;}
- virtual class Fl_Gl_Window* as_gl_window() {return 0;}
+ virtual ~Fl_Widget() {}
+ virtual void draw() {}
+ virtual int handle(int event) {}
+ virtual void resize(int x, int y, int w, int h) {}
+ virtual void show() {}
+ virtual void hide() {}
+ virtual Fl_Group* as_group() {}
+ virtual Fl_Window* as_window() {}
+ virtual class Fl_Gl_Window* as_gl_window() {}
#endif // TODO: FLTK123
Fl_Group* parent() const {
@@ -293,88 +290,82 @@
void labelsize(Fl_Fontsize pix) {
((fltk3::Widget*)_p)->labelsize((fltk3::Fontsize)pix);
}
-
-#if 0 // TODO: FLTK123
-
- Fl_Image* image() {return label_.image;}
- const Fl_Image* image() const {return label_.image;}
- void image(Fl_Image* img) {label_.image=img;}
- void image(Fl_Image& img) {label_.image=&img;}
- Fl_Image* deimage() {return label_.deimage;}
- const Fl_Image* deimage() const {return label_.deimage;}
- void deimage(Fl_Image* img) {label_.deimage=img;}
- void deimage(Fl_Image& img) {label_.deimage=&img;}
- const char *tooltip() const {return tooltip_;}
- void tooltip(const char *text); // see Fl_Tooltip
- void copy_tooltip(const char *text); // see Fl_Tooltip
- Fl_Callback_p callback() const {return callback_;}
- void callback(Fl_Callback* cb, void* p) {callback_=cb; user_data_=p;}
- void callback(Fl_Callback* cb) {callback_=cb;}
- void callback(Fl_Callback0*cb) {callback_=(Fl_Callback*)cb;}
- void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb;
user_data_=(void*)p;}
- void* user_data() const {return user_data_;}
- void user_data(void* v) {user_data_ = v;}
- long argument() const {return (long)(fl_intptr_t)user_data_;}
- void argument(long v) {user_data_ = (void*)v;}
- Fl_When when() const {return (Fl_When)when_;}
- void when(uchar i) {when_ = i;}
- unsigned int visible() const {return !(flags_&INVISIBLE);}
- int visible_r() const;
- void set_visible() {flags_ &= ~INVISIBLE;}
- void clear_visible() {flags_ |= INVISIBLE;}
- unsigned int active() const {return !(flags_&INACTIVE);}
- int active_r() const;
- void activate();
- void deactivate();
- unsigned int output() const {return (flags_&OUTPUT);}
- void set_output() {flags_ |= OUTPUT;}
- void clear_output() {flags_ &= ~OUTPUT;}
- unsigned int takesevents() const {
- return !output() && active_r() && visible_r();
+ const char *tooltip() const {
+ return ((fltk3::Widget*)_p)->tooltip();
}
- unsigned int changed() const {return flags_&CHANGED;}
- void set_changed() {flags_ |= CHANGED;}
- void clear_changed() {flags_ &= ~CHANGED;}
- int take_focus();
- void set_visible_focus() { flags_ |= VISIBLE_FOCUS; }
- void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; }
- void visible_focus(int v) { if (v) set_visible_focus(); else
clear_visible_focus(); }
- unsigned int visible_focus() { return flags_ & VISIBLE_FOCUS; }
- static void default_callback(Fl_Widget *cb, void *d);
- void do_callback() {do_callback(this,user_data_);}
- void do_callback(Fl_Widget* o,long arg) {do_callback(o,(void*)arg);}
- void do_callback(Fl_Widget* o,void* arg=0);
- int test_shortcut();
- static unsigned int label_shortcut(const char *t);
- static int test_shortcut(const char*, const bool require_alt = false);
- int contains(const Fl_Widget *w) const ;
- int inside(const Fl_Widget* w) const {return w ? w->contains(this) : 0;}
- void redraw();
- void redraw_label();
- uchar damage() const {return damage_;}
- void clear_damage(uchar c = 0) {damage_ = c;}
- void damage(uchar c);
- void damage(uchar c, int x, int y, int w, int h);
- void draw_label(int, int, int, int, Fl_Align) const;
- void measure_label(int& ww, int& hh) const {label_.measure(ww, hh);}
- Fl_Window* window() const ;
- Fl_Color color2() const {return (Fl_Color)color2_;}
- void color2(unsigned a) {color2_ = a;}
+ void tooltip(const char *text) {
+ ((fltk3::Widget*)_p)->tooltip(text);
+ }
+ void copy_tooltip(const char *text) {
+ ((fltk3::Widget*)_p)->copy_tooltip(text);
+ }
+
+#if 0 // TODO: FLTK123
+ Fl_Image* image() {}
+ const Fl_Image* image() const {}
+ void image(Fl_Image* img) {}
+ void image(Fl_Image& img) {}
+ Fl_Image* deimage() {}
+ const Fl_Image* deimage() const {}
+ void deimage(Fl_Image* img) {}
+ void deimage(Fl_Image& img) {}
+ Fl_Callback_p callback() const {}
+ void callback(Fl_Callback* cb, void* p) {}
+ void callback(Fl_Callback* cb) {}
+ void callback(Fl_Callback0*cb) {}
+ void callback(Fl_Callback1*cb, long p=0) {}
+ void* user_data() const {}
+ void user_data(void* v) {}
+ long argument() const {}
+ void argument(long v) {}
+ Fl_When when() const {}
+ void when(uchar i) {}
+ unsigned int visible() const {}
+ int visible_r() const {}
+ void set_visible() {}
+ void clear_visible() {}
+ unsigned int active() const {}
+ int active_r() const {}
+ void activate() {}
+ void deactivate() {}
+ unsigned int output() const {}
+ void set_output() {}
+ void clear_output() {}
+ unsigned int takesevents() const {}
+ unsigned int changed() const {}
+ void set_changed() {}
+ void clear_changed() {}
+ int take_focus() {}
+ void set_visible_focus() {}
+ void clear_visible_focus() {}
+ void visible_focus(int v) {}
+ unsigned int visible_focus() {}
+ static void default_callback(Fl_Widget *cb, void *d) {}
+ void do_callback() {}
+ void do_callback(Fl_Widget* o,long arg) {}
+ void do_callback(Fl_Widget* o,void* arg=0) {}
+ int test_shortcut() {}
+ static unsigned int label_shortcut(const char *t) {}
+ static int test_shortcut(const char*, const bool require_alt = false) {}
+ int contains(const Fl_Widget *w) const {}
+ int inside(const Fl_Widget* w) const {}
+ void redraw() {}
+ void redraw_label() {}
+ uchar damage() const {}
+ void clear_damage(uchar c = 0) {}
+ void damage(uchar c) {}
+ void damage(uchar c, int x, int y, int w, int h) {}
+ void draw_label(int, int, int, int, Fl_Align) const {}
+ void measure_label(int& ww, int& hh) const {}
+ Fl_Window* window() const {}
+ Fl_Color color2() const {}
+ void color2(unsigned a) {}
#endif // TODO: FLTK123
};
-#if 0 // TODO: FLTK123
-
-/**
- Reserved type numbers (necessary for my cheapo RTTI) start here.
- Grep the header files for "RESERVED_TYPE" to find the next available
- number.
-*/
#define FL_RESERVED_TYPE 100
-#endif // TODO: FLTK123
-
#endif
//
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit