From 8009fef12cb88c5d4944bdad9a1e641c282df303 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Wed, 3 Feb 1999 08:43:35 +0000 Subject: Put Fl::grab() into it's own source file. Rewritten as suggested so that it takes a window pointer, and grab(0) releases. You can now call grab repeatedly with the same or different values without it failing. The old Fl::grab() and Fl::release() are emulated in inline functions in Fl.H Added Fl_Menu_::copy(Fl_Menu_Item*), which will be useful for fluid, although that use is nyi. Fixes and cleanup to the code for Fl_Menu_::add(...). git-svn-id: file:///fltk/svn/fltk/trunk@268 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl.H | 9 ++-- FL/Fl_Menu_.H | 5 +- FL/fl_draw.H | 22 +++++++- documentation/Fl_Menu_.html | 8 ++- src/Fl_Menu_.cxx | 34 ++++++++++--- src/Fl_Menu_Window.cxx | 63 +---------------------- src/Fl_Menu_add.cxx | 120 +++++++++++++++++++++++--------------------- src/Fl_grab.cxx | 93 ++++++++++++++++++++++++++++++++++ src/Fl_win32.cxx | 6 +-- src/Fl_x.cxx | 7 ++- src/Makefile | 6 ++- test/subwindow.cxx | 46 +++++++++++++++-- 12 files changed, 273 insertions(+), 146 deletions(-) create mode 100644 src/Fl_grab.cxx diff --git a/FL/Fl.H b/FL/Fl.H index dea664d84..6e6cadc24 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1,5 +1,5 @@ // -// "$Id: Fl.H,v 1.4 1999/01/07 19:16:50 mike Exp $" +// "$Id: Fl.H,v 1.5 1999/02/03 08:43:29 bill Exp $" // // Main header file for the Fast Light Tool Kit (FLTK). // @@ -104,8 +104,7 @@ public: static Fl_Window* next_window(const Fl_Window*); static Fl_Window* modal() {return modal_;} static Fl_Window* grab() {return grab_;} - static void grab(Fl_Window&); - static void release(); + static void grab(Fl_Window*); // event information: static int event_x() {return e_x;} @@ -192,11 +191,13 @@ public: static int event_button2() {return e_state&FL_BUTTON2;} static int event_button3() {return e_state&FL_BUTTON3;} static void set_idle(void (*cb)()) {idle = cb;} + static void grab(Fl_Window&w) {grab(&w);} + static void release() {grab(0);} }; #endif // -// End of "$Id: Fl.H,v 1.4 1999/01/07 19:16:50 mike Exp $". +// End of "$Id: Fl.H,v 1.5 1999/02/03 08:43:29 bill Exp $". // diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index 11800f7b1..b5c21acf2 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_.H,v 1.5 1999/01/07 19:16:57 mike Exp $" +// "$Id: Fl_Menu_.H,v 1.6 1999/02/03 08:43:30 bill Exp $" // // Menu base class header file for the Fast Light Tool Kit (FLTK). // @@ -55,6 +55,7 @@ public: const Fl_Menu_Item *menu() const {return menu_;} void menu(const Fl_Menu_Item *m); + void copy(const Fl_Menu_Item *m, void* user_data = 0); int add(const char*, int shortcut, Fl_Callback*, void* = 0, int = 0); int add(const char* a, const char* b, Fl_Callback* c, void* d = 0, int e = 0) {return add(a,fl_old_shortcut(b),c,d,e);} @@ -92,5 +93,5 @@ public: #endif // -// End of "$Id: Fl_Menu_.H,v 1.5 1999/01/07 19:16:57 mike Exp $". +// End of "$Id: Fl_Menu_.H,v 1.6 1999/02/03 08:43:30 bill Exp $". // diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 46a88ebc9..db7d706d0 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,5 +1,5 @@ // -// "$Id: fl_draw.H,v 1.6 1999/01/07 19:17:06 mike Exp $" +// "$Id: fl_draw.H,v 1.7 1999/02/03 08:43:30 bill Exp $" // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // @@ -42,6 +42,24 @@ void fl_pop_clip(); int fl_not_clipped(int x, int y, int w, int h); int fl_clip_box(int, int, int, int, int& x, int& y, int& w, int& h); +// line style: +// Enumerations chosen so zero is the default, unfortunatly this does +// not match values for either X or Windows... +enum Fl_LineStyle { + FL_SOLID = 0, + FL_DASH = 1, + FL_DOT = 2, + FL_DASHDOT = 3, + FL_DASHDOTDOT = 4, + FL_CAP_FLAT = 0x0100, + FL_CAP_ROUND = 0x0200, + FL_CAP_SQUARE = 0x0300, + FL_JOIN_MITER = 0x1000, + FL_JOIN_ROUND = 0x2000, + FL_JOIN_BEVEL = 0x3000, +}; +void fl_line_style(int style, int width = 0, char* dashes = 0); + // points: void fl_point(int x, int y); @@ -158,5 +176,5 @@ int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scalable); #endif // -// End of "$Id: fl_draw.H,v 1.6 1999/01/07 19:17:06 mike Exp $". +// End of "$Id: fl_draw.H,v 1.7 1999/02/03 08:43:30 bill Exp $". // diff --git a/documentation/Fl_Menu_.html b/documentation/Fl_Menu_.html index 3120ccb76..69f5b1efc 100644 --- a/documentation/Fl_Menu_.html +++ b/documentation/Fl_Menu_.html @@ -40,20 +40,21 @@ methods to build it dynamically.