Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Window.h

00001 /*
00002  * $Id: Fl_Window.h,v 1.10 2003/05/14 21:07:55 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_WINDOW_H_
00023 #define _FL_WINDOW_H_
00024 
00025 #include "Fl_Group.h"
00026 
00027 // value for x,y to indicate window system places window
00028 #define FL_USEDEFAULT ((int)0x80000000) // same as Win32 value
00029 
00031 class FL_API Fl_Window : public Fl_Group {
00032 public:
00033     static Fl_Named_Style* default_style;
00034 
00035     Fl_Window(int,int,int,int, const char* = 0);
00036     Fl_Window(int,int, const char* = 0);
00037     virtual ~Fl_Window();
00038 
00039     // Types from Fl_WM.h
00040     // Type is set before first map, straight after creating xid.
00041     void window_type(int type) { window_type_ = type; }
00042     int window_type() { return window_type_; }
00043 
00044     const Fl_String &label() const     { return Fl_Widget::label(); }
00045     const Fl_String &iconlabel() const { return iconlabel_; }
00046 
00047     void copy_label(const char *l) { label(l); }
00048     void copy_label(const Fl_String &l) { label(l); }
00049 
00050     void label(const char *l) { label(l, iconlabel_.c_str()); }
00051     void label(const Fl_String &l) { label(l, iconlabel_); }
00052     void iconlabel(const char *il) { label(label().c_str(), il); }
00053     void iconlabel(const Fl_String &il) { label(label(), il); }
00054 
00055     void label(const char *l, const char *il);
00056     void label(const Fl_String &l, const Fl_String &il);
00057 
00058     const void* icon() const    { return icon_; }
00059     void icon(const void * ic)  { icon_ = ic; }
00060 
00061     static const Fl_String &xclass() { return xclass_; }
00062     static void xclass(const char* v) { xclass_ = v; }
00063     static void xclass(const Fl_String &v) { xclass_ = v; }
00064 
00065     void clear_border() { set_flag(FL_NOBORDER); }
00066     bool border() const { return !flags().is_set(FL_NOBORDER); }
00067     void set_override() { set_flag(FL_NOBORDER|FL_OVERRIDE); }
00068     bool override() const { return flags().is_set(FL_OVERRIDE); }
00069     const Fl_Window* child_of() const { return child_of_; }
00070     void child_of(const Fl_Window* w);
00071 
00072      // back compatability only!
00073     void set_modal()     { set_flag(FL_MODAL); }
00074     void set_non_modal() { set_flag(FL_NON_MODAL); }
00075 
00076     void hotspot(int x, int y, bool offscreen = false);
00077     void hotspot(const Fl_Widget*, bool offscreen = false);
00078     void hotspot(const Fl_Widget& p, bool offscrn = false) { hotspot(&p,offscrn); }
00079 
00080     bool shown() const { return i != 0; }
00081 
00082     void show();
00083     void show(int, char**);
00084     void show(const Fl_Window* parent);
00085     void show_inside(const Fl_Window* parent);
00086 
00087     bool exec(const Fl_Window* parent = 0, bool grab = false);
00088 
00089     void iconize();
00090     bool iconic() const;
00091     virtual void destroy();
00092 
00093     void fullscreen();
00094     void fullscreen_off(int,int,int,int);
00095 
00096     static const Fl_Window *current() { return current_; }
00097     void make_current() const;
00098 
00099     void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
00100     static void default_callback(Fl_Window*, void* v);
00101 
00102     virtual int handle(int);
00103     virtual void layout();
00104     virtual void flush();
00105     virtual void draw();
00106 
00107     void size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0);
00108     bool has_size_range() { return m_size_range; }
00109 
00110     int minw() { return m_minw; }
00111     int minh() { return m_minh; }
00112     int maxw() { return m_maxw; }
00113     int maxh() { return m_maxh; }
00114     int dw() { return m_dw; }
00115     int dh() { return m_dh; }
00116 
00117 protected:
00118     virtual void create();
00119     static const Fl_Window *current_;
00120 
00121 private:
00123     short m_minw, m_minh, m_maxw, m_maxh;
00124     unsigned char m_dw, m_dh;
00125     bool m_size_range;
00126 
00127     int window_type_;
00128 
00129     friend class Fl_X;
00130     Fl_X *i; // points at the system-specific stuff
00131 
00132     const Fl_Window* child_of_;
00133 
00134     Fl_String iconlabel_;
00135     const void* icon_;
00136 
00137     void size_range_();
00138 
00139     // values for flags():
00140     enum {
00141         FL_MODAL        = 0x80000000,
00142         FL_NOBORDER     = 0x40000000,
00143         FL_OVERRIDE         = 0x20000000,
00144         FL_NON_MODAL    = 0x10000000
00145     };
00146 
00147     static Fl_String xclass_;
00148     void _Fl_Window(); // constructor innards
00149 };
00150 
00151 #endif

Generated on Thu Jul 31 15:33:45 2003 for eFLTK by doxygen1.2.15