fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Double_Window Class Reference

#include <Fl_Double_Window.H>

Inheritance diagram for Fl_Double_Window:
[legend]
Collaboration diagram for Fl_Double_Window:
[legend]

Public Member Functions

void show ()
 
void show (int a, char **b)
 
void flush ()
 
void resize (int, int, int, int)
 
void hide ()
 
 ~Fl_Double_Window ()
 
 Fl_Double_Window (int W, int H, const char *l=0)
 
 Fl_Double_Window (int X, int Y, int W, int H, const char *l=0)
 
- Public Member Functions inherited from Fl_Window
void shape (const Fl_Image *img)
 
void shape (const Fl_Image &b)
 
void combine_mask (void)
 
 Fl_Window (int w, int h, const char *title=0)
 
 Fl_Window (int x, int y, int w, int h, const char *title=0)
 
virtual ~Fl_Window ()
 
virtual int handle (int)
 
void border (int b)
 
void clear_border ()
 
unsigned int border () const
 
void set_override ()
 
unsigned int override () const
 
void set_modal ()
 
unsigned int modal () const
 
void set_non_modal ()
 
unsigned int non_modal () const
 
void clear_modal_states ()
 
void set_menu_window ()
 
unsigned int menu_window () const
 
void set_tooltip_window ()
 
unsigned int tooltip_window () const
 
void hotspot (int x, int y, int offscreen=0)
 
void hotspot (const Fl_Widget *, int offscreen=0)
 
void hotspot (const Fl_Widget &p, int offscreen=0)
 
void free_position ()
 
void size_range (int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)
 
const char * label () const
 
const char * iconlabel () const
 
void label (const char *)
 
void iconlabel (const char *)
 
void label (const char *label, const char *iconlabel)
 
void copy_label (const char *a)
 
const char * xclass () const
 
void xclass (const char *c)
 
void icon (const Fl_RGB_Image *)
 
void icons (const Fl_RGB_Image *[], int)
 
const void * icon () const
 
void icon (const void *ic)
 
int shown ()
 
void show (int argc, char **argv)
 
void wait_for_expose ()
 
void fullscreen ()
 
void fullscreen_off ()
 
void fullscreen_off (int X, int Y, int W, int H)
 
unsigned int fullscreen_active () const
 
void fullscreen_screens (int top, int bottom, int left, int right)
 
void iconize ()
 
int x_root () const
 
int y_root () const
 
void make_current ()
 
virtual Fl_Windowas_window ()
 
void cursor (Fl_Cursor)
 
void cursor (const Fl_RGB_Image *, int, int)
 
void default_cursor (Fl_Cursor)
 
void cursor (Fl_Cursor c, Fl_Color, Fl_Color=FL_WHITE)
 
void default_cursor (Fl_Cursor c, Fl_Color, Fl_Color=FL_WHITE)
 
int decorated_w ()
 
int decorated_h ()
 
- Public Member Functions inherited from Fl_Group
void begin ()
 
void end ()
 
int children () const
 
Fl_Widgetchild (int n) const
 
int find (const Fl_Widget *) const
 
int find (const Fl_Widget &o) const
 
Fl_Widget *constarray () const
 
 Fl_Group (int, int, int, int, const char *=0)
 
virtual ~Fl_Group ()
 
void add (Fl_Widget &)
 
void add (Fl_Widget *o)
 
void insert (Fl_Widget &, int i)
 
void insert (Fl_Widget &o, Fl_Widget *before)
 
void remove (int index)
 
void remove (Fl_Widget &)
 
void remove (Fl_Widget *o)
 
void clear ()
 
void resizable (Fl_Widget &o)
 
void resizable (Fl_Widget *o)
 
Fl_Widgetresizable () const
 
void add_resizable (Fl_Widget &o)
 
void init_sizes ()
 
void clip_children (int c)
 
unsigned int clip_children ()
 
virtual Fl_Groupas_group ()
 
void focus (Fl_Widget *W)
 
Fl_Widget *& _ddfdesign_kludge ()
 
void forms_end ()
 
- Public Member Functions inherited from Fl_Widget
virtual ~Fl_Widget ()
 
int is_label_copied () const
 
Fl_Groupparent () const
 
void parent (Fl_Group *p)
 
uchar type () const
 
void type (uchar t)
 
int x () const
 
int y () const
 
int w () const
 
int h () const
 
int damage_resize (int, int, int, int)
 
void position (int X, int Y)
 
void size (int W, int H)
 
Fl_Align align () const
 
void align (Fl_Align alignment)
 
Fl_Boxtype box () const
 
void box (Fl_Boxtype new_box)
 
Fl_Color color () const
 
void color (Fl_Color bg)
 
Fl_Color selection_color () const
 
void selection_color (Fl_Color a)
 
void color (Fl_Color bg, Fl_Color sel)
 
const char * label () const
 
void label (const char *text)
 
void copy_label (const char *new_label)
 
void label (Fl_Labeltype a, const char *b)
 
Fl_Labeltype labeltype () const
 
void labeltype (Fl_Labeltype a)
 
Fl_Color labelcolor () const
 
void labelcolor (Fl_Color c)
 
Fl_Font labelfont () const
 
void labelfont (Fl_Font f)
 
Fl_Fontsize labelsize () const
 
void labelsize (Fl_Fontsize pix)
 
Fl_Imageimage ()
 
const Fl_Imageimage () const
 
void image (Fl_Image *img)
 
void image (Fl_Image &img)
 
Fl_Imagedeimage ()
 
const Fl_Imagedeimage () const
 
void deimage (Fl_Image *img)
 
void deimage (Fl_Image &img)
 
const char * tooltip () const
 
void tooltip (const char *text)
 
void copy_tooltip (const char *text)
 
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 ()
 
void clear_active ()
 
void set_active ()
 
int take_focus ()
 
void set_visible_focus ()
 
void clear_visible_focus ()
 
void visible_focus (int v)
 
unsigned int visible_focus ()
 
void do_callback ()
 
void do_callback (Fl_Widget *o, long arg)
 
void do_callback (Fl_Widget *o, void *arg=0)
 
int test_shortcut ()
 
void _set_fullscreen ()
 
void _clear_fullscreen ()
 
int contains (const Fl_Widget *w) const
 
int inside (const Fl_Widget *wgt) 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_Windowwindow () const
 
Fl_Windowtop_window () const
 
Fl_Windowtop_window_offset (int &xoff, int &yoff) const
 
virtual class Fl_Gl_Windowas_gl_window ()
 
int use_accents_menu ()
 
Fl_Color color2 () const
 
void color2 (unsigned a)
 

Protected Member Functions

void flush (int eraseoverlay)
 
- Protected Member Functions inherited from Fl_Window
virtual void draw ()
 
void force_position (int force)
 
int force_position () const
 
void free_icons ()
 
- Protected Member Functions inherited from Fl_Group
void draw_child (Fl_Widget &widget) const
 
void draw_children ()
 
void draw_outside_label (const Fl_Widget &widget) const
 
void update_child (Fl_Widget &widget) const
 
int * sizes ()
 
- Protected Member Functions inherited from Fl_Widget
 Fl_Widget (int x, int y, int w, int h, const char *label=0L)
 
void x (int v)
 
void y (int v)
 
void w (int v)
 
void h (int v)
 
unsigned int flags () const
 
void set_flag (unsigned int c)
 
void clear_flag (unsigned int c)
 
void draw_box () const
 
void draw_box (Fl_Boxtype t, Fl_Color c) const
 
void draw_box (Fl_Boxtype t, int x, int y, int w, int h, Fl_Color c) const
 
void draw_backdrop () const
 
void draw_focus ()
 
void draw_focus (Fl_Boxtype t, int x, int y, int w, int h) const
 
void draw_label () const
 
void draw_label (int, int, int, int) const
 

Protected Attributes

char force_doublebuffering_
 

Additional Inherited Members

- Static Public Member Functions inherited from Fl_Window
static void default_xclass (const char *)
 
static const char * default_xclass ()
 
static void default_icon (const Fl_RGB_Image *)
 
static void default_icons (const Fl_RGB_Image *[], int)
 
static Fl_Windowcurrent ()
 
static void default_callback (Fl_Window *, void *v)
 
- Static Public Member Functions inherited from Fl_Group
static Fl_Groupcurrent ()
 
static void current (Fl_Group *g)
 
- Static Public Member Functions inherited from Fl_Widget
static void default_callback (Fl_Widget *cb, void *d)
 
static unsigned int label_shortcut (const char *t)
 
static int test_shortcut (const char *, const bool require_alt=false)
 
- Protected Types inherited from Fl_Widget
enum  {
  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, FULLSCREEN = 1<<18, MAC_USE_ACCENTS_MENU = 1<<19,
  USERFLAG3 = 1<<29, USERFLAG2 = 1<<30, USERFLAG1 = 1<<31
}
 
- Static Protected Attributes inherited from Fl_Window
static shape_data_typeshape_data_ = NULL
 non-null means the window has a non-rectangular shape More...
 
static Fl_Windowcurrent_
 

Detailed Description

The Fl_Double_Window provides a double-buffered window. If possible this will use the X double buffering extension (Xdbe). If not, it will draw the window data into an off-screen pixmap, and then copy it to the on-screen window.

It is highly recommended that you put the following code before the first show() of any window in your program:

This makes sure you can use Xdbe on servers where double buffering does not exist for every visual.

Definition at line 40 of file Fl_Double_Window.H.

Constructor & Destructor Documentation

◆ ~Fl_Double_Window()

Fl_Double_Window::~Fl_Double_Window ( )

The destructor also deletes all the children. This allows a whole tree to be deleted at once, without having to keep a pointer to all the children in the user code.

Definition at line 524 of file Fl_Double_Window.cxx.

References hide().

◆ Fl_Double_Window() [1/2]

Fl_Double_Window::Fl_Double_Window ( int  W,
int  H,
const char *  l = 0 
)

Creates a new Fl_Double_Window widget using the given position, size, and label (title) string.

Definition at line 63 of file Fl_Double_Window.cxx.

References FL_DOUBLE_WINDOW, and Fl_Widget::type().

◆ Fl_Double_Window() [2/2]

Fl_Double_Window::Fl_Double_Window ( int  X,
int  Y,
int  W,
int  H,
const char *  l = 0 
)

See Fl_Double_Window::Fl_Double_Window(int w, int h, const char *label = 0)

Definition at line 71 of file Fl_Double_Window.cxx.

References FL_DOUBLE_WINDOW, and Fl_Widget::type().

Member Function Documentation

◆ flush() [1/2]

void Fl_Double_Window::flush ( )
virtual

Forces the window to be redrawn.

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.

Definition at line 388 of file Fl_Double_Window.cxx.

Referenced by Fl_Overlay_Window::flush().

◆ flush() [2/2]

void Fl_Double_Window::flush ( int  eraseoverlay)
protected

Forces the window to be redrawn.

Parameters
[in]eraseoverlaynon-zero to erase overlay, zero to ignore

Fl_Overlay_Window relies on flush(1) copying the back buffer to the front everywhere, even if damage() == 0, thus erasing the overlay, and leaving the clip region set to the entire window.

Definition at line 398 of file Fl_Double_Window.cxx.

References Fl_Widget::clear_damage(), Fl_Widget::damage(), Fl_Window::draw(), fl_begin_offscreen(), fl_clip_box(), fl_clip_region(), fl_copy_offscreen(), fl_create_offscreen(), FL_DAMAGE_ALL, FL_DAMAGE_EXPOSE, fl_display, fl_end_offscreen(), fl_gc, fl_makeDC(), fl_restore_clip(), fl_window, Fl_Window::Fl_X, fl_xid(), force_doublebuffering_, H, Fl_Widget::h(), Fl_Window::make_current(), Fl_Window::shown(), Fl_Widget::w(), and Y.

◆ hide()

◆ resize()

void Fl_Double_Window::resize ( int  X,
int  Y,
int  W,
int  H 
)
virtual

Changes the size and position of the window. If shown() is true, these changes are communicated to the window server (which may refuse that size and cause a further resize). If shown() is false, the size and position are used when show() is called. See Fl_Group for the effect of resizing on the child widgets.

You can also call the Fl_Widget methods size(x,y) and position(w,h), which are inline wrappers for this virtual function.

A top-level window can not force, but merely suggest a position and size to the operating system. The window manager may not be willing or able to display a window at the desired position or with the given dimensions. It is up to the application developer to verify window parameters after the resize request.

Reimplemented from Fl_Window.

Reimplemented in Overlay_Window, and Fl_Overlay_Window.

Definition at line 483 of file Fl_Double_Window.cxx.

References fl_delete_offscreen(), fl_display, Fl_Window::Fl_X, H, Fl_Widget::h(), Fl_Window::resize(), Fl_Widget::w(), and Y.

Referenced by Fl_Overlay_Window::resize(), and Fl_Help_Dialog::resize().

◆ show() [1/2]

void Fl_Double_Window::show ( )
virtual

Puts the window on the screen. Usually (on X) this has the side effect of opening the display.

If the window is already shown then it is restored and raised to the top. This is really convenient because your program can call show() at any time, even if the window is already up. It also means that show() serves the purpose of raise() in other toolkits.

Fl_Window::show(int argc, char **argv) is used for top-level windows and allows standard arguments to be parsed from the command-line.

Note
For some obscure reasons Fl_Window::show() resets the current group by calling Fl_Group::current(0). The comments in the code say "get rid of very common user bug: forgot end()". Although this is true it may have unwanted side effects if you show() an unrelated window (maybe for an error message or warning) while building a window or any other group widget.
Todo:
Check if we can remove resetting the current group in a later FLTK version (after 1.3.x). This may break "already broken" programs though if they rely on this "feature".
See also
Fl_Window::show(int argc, char **argv)

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.

Definition at line 79 of file Fl_Double_Window.cxx.

References Fl_Window::show().

Referenced by about_cb(), cb_print_properties(), do_shell_command(), Fl_File_Chooser::favoritesCB(), new_cb(), Fl_Function_Type::open(), Fl_Code_Type::open(), Fl_CodeBlock_Type::open(), Fl_Decl_Type::open(), Fl_Data_Type::open(), Fl_DeclBlock_Type::open(), Fl_Comment_Type::open(), Fl_Class_Type::open(), save_template_cb(), Fl_Help_Dialog::show(), Fl_Overlay_Window::show(), Fl_File_Chooser::show(), show_global_settings_window(), show_grid_cb(), show_project_cb(), show_settings_cb(), show_shell_window(), Fl_PostScript_Printer::start_job(), and toggle_sourceview_cb().

◆ show() [2/2]

void Fl_Double_Window::show ( int  a,
char **  b 
)
inline

Definition at line 50 of file Fl_Double_Window.H.

References b, and Fl_Window::show().

Member Data Documentation

◆ force_doublebuffering_

char Fl_Double_Window::force_doublebuffering_
protected

Force double buffering, even if the OS already buffers windows (overlays need that on MacOS and Windows2000)

Definition at line 47 of file Fl_Double_Window.H.

Referenced by Fl_Overlay_Window::Fl_Overlay_Window(), and flush().


The documentation for this class was generated from the following files:
Fl::visual
static int visual(int)
Definition: Fl_visual.cxx:118
FL_INDEX
Definition: Enumerations.H:1086
FL_DOUBLE
Definition: Enumerations.H:1088