00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef Fl_Window_H
00032 #define Fl_Window_H
00033
00034 #include "Fl_Group.H"
00035
00036 #define FL_WINDOW 0xF0
00037 #define FL_DOUBLE_WINDOW 0xF1
00038
00039 class Fl_X;
00040
00058 class FL_EXPORT Fl_Window : public Fl_Group {
00059
00060 static char *default_xclass_;
00061
00062 friend class Fl_X;
00063 Fl_X *i;
00064
00065 const char* iconlabel_;
00066 char* xclass_;
00067 const void* icon_;
00068
00069 int minw, minh, maxw, maxh;
00070 int dw, dh, aspect;
00071 uchar size_range_set;
00072
00073 Fl_Cursor cursor_default;
00074 Fl_Color cursor_fg, cursor_bg;
00075 void size_range_();
00076 void _Fl_Window();
00077
00078
00079 Fl_Window(const Fl_Window&);
00080 Fl_Window& operator=(const Fl_Window&);
00081
00082 protected:
00083
00085 static Fl_Window *current_;
00086 virtual void draw();
00088 virtual void flush();
00089
00098 void force_position(int force) {
00099 if (force) set_flag(FORCE_POSITION);
00100 else clear_flag(FORCE_POSITION);
00101 }
00110 int force_position() const { return ((flags() & FORCE_POSITION)?1:0); }
00111
00112 public:
00113
00142 Fl_Window(int w, int h, const char* title= 0);
00147 Fl_Window(int x, int y, int w, int h, const char* title = 0);
00156 virtual ~Fl_Window();
00157
00158 virtual int handle(int);
00159
00176 virtual void resize(int,int,int,int);
00184 void border(int b);
00189 void clear_border() {set_flag(NOBORDER);}
00191 unsigned int border() const {return !(flags() & NOBORDER);}
00193 void set_override() {set_flag(NOBORDER|OVERRIDE);}
00195 unsigned int override() const { return flags()&OVERRIDE; }
00204 void set_modal() {set_flag(MODAL);}
00206 unsigned int modal() const {return flags() & MODAL;}
00213 void set_non_modal() {set_flag(NON_MODAL);}
00215 unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);}
00216
00230 void set_menu_window() {set_flag(MENU_WINDOW);}
00231
00233 unsigned int menu_window() const {return flags() & MENU_WINDOW;}
00234
00251 void set_tooltip_window() { set_flag(TOOLTIP_WINDOW);
00252 clear_flag(MENU_WINDOW); }
00254 unsigned int tooltip_window() const {return flags() & TOOLTIP_WINDOW;}
00255
00263 void hotspot(int x, int y, int offscreen = 0);
00265 void hotspot(const Fl_Widget*, int offscreen = 0);
00267 void hotspot(const Fl_Widget& p, int offscreen = 0) {hotspot(&p,offscreen);}
00268
00277 void free_position() {clear_flag(FORCE_POSITION);}
00314 void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0, int g=0) {
00315 minw=a; minh=b; maxw=c; maxh=d; dw=e; dh=f; aspect=g; size_range_();}
00316
00318 const char* label() const {return Fl_Widget::label();}
00320 const char* iconlabel() const {return iconlabel_;}
00322 void label(const char*);
00324 void iconlabel(const char*);
00326 void label(const char* label, const char* iconlabel);
00327 void copy_label(const char* a);
00328
00329 static void default_xclass(const char*);
00330 static const char *default_xclass();
00331 const char* xclass() const;
00332 void xclass(const char* c);
00334 const void* icon() const {return icon_;}
00336 void icon(const void * ic) {icon_ = ic;}
00337
00343 int shown() {return i != 0;}
00359 virtual void show();
00364 virtual void hide();
00385 void show(int argc, char **argv);
00391 void fullscreen();
00396 void fullscreen_off(int,int,int,int);
00412 void iconize();
00413
00414 int x_root() const ;
00415 int y_root() const ;
00416
00417 static Fl_Window *current();
00427 void make_current();
00428
00435 virtual Fl_Window* as_window() { return this; }
00436
00437
00451 void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
00452 void default_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
00453 static void default_callback(Fl_Window*, void* v);
00454
00455 };
00456
00457 #endif
00458
00459
00460
00461