1998-10-20 01:39:29 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// Window header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// Copyright 1998-2005 by Bill Spitzak and others.
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
// USA.
|
|
|
|
//
|
2000-06-06 01:21:24 +04:00
|
|
|
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
#ifndef Fl_Window_H
|
|
|
|
#define Fl_Window_H
|
|
|
|
|
|
|
|
#include "Fl_Group.H"
|
|
|
|
|
|
|
|
#define FL_WINDOW 0xF0 // all subclasses have type() >= this
|
2003-06-12 05:36:18 +04:00
|
|
|
#define FL_DOUBLE_WINDOW 0xF1
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2001-05-11 22:37:08 +04:00
|
|
|
class Fl_X;
|
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
class FL_EXPORT Fl_Window : public Fl_Group {
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2001-05-11 22:37:08 +04:00
|
|
|
friend class Fl_X;
|
|
|
|
Fl_X *i; // points at the system-specific stuff
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
const char* iconlabel_;
|
|
|
|
const char* xclass_;
|
1999-01-04 22:25:40 +03:00
|
|
|
const void* icon_;
|
1998-10-06 23:14:55 +04:00
|
|
|
// size_range stuff:
|
|
|
|
short minw, minh, maxw, maxh;
|
|
|
|
uchar dw, dh, aspect, size_range_set;
|
2002-08-01 06:15:43 +04:00
|
|
|
// cursor stuff
|
|
|
|
Fl_Cursor cursor_default;
|
|
|
|
Fl_Color cursor_fg, cursor_bg;
|
2002-08-14 20:19:48 +04:00
|
|
|
void size_range_();
|
1998-10-06 23:14:55 +04:00
|
|
|
// values for flags():
|
|
|
|
enum {
|
|
|
|
FL_MODAL = 64,
|
|
|
|
FL_NOBORDER = 8,
|
|
|
|
FL_FORCE_POSITION = 16,
|
2001-10-18 22:53:20 +04:00
|
|
|
FL_NON_MODAL = 32,
|
|
|
|
FL_OVERRIDE = 256
|
1998-10-06 23:14:55 +04:00
|
|
|
};
|
2002-08-14 20:19:48 +04:00
|
|
|
void _Fl_Window(); // constructor innards
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2002-08-14 20:19:48 +04:00
|
|
|
static Fl_Window *current_;
|
|
|
|
virtual void draw();
|
|
|
|
virtual void flush();
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
Fl_Window(int,int,int,int, const char* = 0);
|
|
|
|
Fl_Window(int,int, const char* = 0);
|
|
|
|
virtual ~Fl_Window();
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
virtual int handle(int);
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
virtual void resize(int,int,int,int);
|
|
|
|
void border(int b);
|
1998-10-06 23:14:55 +04:00
|
|
|
void clear_border() {set_flag(FL_NOBORDER);}
|
|
|
|
int border() const {return !(flags() & FL_NOBORDER);}
|
2001-10-18 22:53:20 +04:00
|
|
|
void set_override() {set_flag(FL_NOBORDER|FL_OVERRIDE);}
|
|
|
|
int override() const { return flags()&FL_OVERRIDE; }
|
1998-10-06 23:14:55 +04:00
|
|
|
void set_modal() {set_flag(FL_MODAL);}
|
2001-10-18 22:53:20 +04:00
|
|
|
int modal() const {return flags() & FL_MODAL;}
|
1998-10-06 23:14:55 +04:00
|
|
|
void set_non_modal() {set_flag(FL_NON_MODAL);}
|
2001-10-18 22:53:20 +04:00
|
|
|
int non_modal() const {return flags() & (FL_NON_MODAL|FL_MODAL);}
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
void hotspot(int x, int y, int offscreen = 0);
|
|
|
|
void hotspot(const Fl_Widget*, int offscreen = 0);
|
1998-10-06 23:14:55 +04:00
|
|
|
void hotspot(const Fl_Widget& p, int offscreen = 0) {hotspot(&p,offscreen);}
|
|
|
|
void free_position() {clear_flag(FL_FORCE_POSITION);}
|
|
|
|
void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0, int g=0) {
|
2004-12-06 06:31:54 +03:00
|
|
|
minw=(short)a; minh=(short)b; maxw=(short)c; maxh=(short)d; dw=(uchar)e; dh=(uchar)f; aspect=(uchar)g; size_range_();}
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
const char* label() const {return Fl_Widget::label();}
|
|
|
|
const char* iconlabel() const {return iconlabel_;}
|
2002-07-15 01:25:39 +04:00
|
|
|
void label(const char*);
|
|
|
|
void iconlabel(const char*);
|
|
|
|
void label(const char* label, const char* iconlabel);
|
1998-10-06 23:14:55 +04:00
|
|
|
const char* xclass() const {return xclass_;}
|
|
|
|
void xclass(const char* c) {xclass_ = c;}
|
1999-01-04 22:25:40 +03:00
|
|
|
const void* icon() const {return icon_;}
|
1999-02-18 16:12:50 +03:00
|
|
|
void icon(const void * ic) {icon_ = ic;}
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
int shown() {return i != 0;}
|
2002-07-15 01:25:39 +04:00
|
|
|
virtual void show();
|
|
|
|
virtual void hide();
|
|
|
|
void show(int, char**);
|
|
|
|
void fullscreen();
|
|
|
|
void fullscreen_off(int,int,int,int);
|
|
|
|
void iconize();
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
int x_root() const ;
|
|
|
|
int y_root() const ;
|
1998-10-06 23:14:55 +04:00
|
|
|
|
2002-07-15 01:25:39 +04:00
|
|
|
static Fl_Window *current();
|
|
|
|
void make_current();
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
// for back-compatability only:
|
2002-07-15 01:25:39 +04:00
|
|
|
void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
|
2002-08-01 06:15:43 +04:00
|
|
|
void default_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
|
2002-07-15 01:25:39 +04:00
|
|
|
static void default_callback(Fl_Window*, void* v);
|
1998-10-06 23:14:55 +04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-10-20 01:39:29 +04:00
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|