From d5b47034a7575151963f1fc85a4630f68208e73a Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Sat, 13 May 2000 20:03:20 +0000 Subject: [PATCH] Added Fl::first_window(window) to change which window is at the top of the window list. This window is used as the "parent" of any modal windows you create so it is a good idea to be able to change it. Normally it is whatever window got the last event. Fixed Fl_Menu::global handler to use first_window so if a modal window pops up in response it is parented to the window containing the menubar rather than the current top window. This was an annoying bug! Copied fl_line_style() and the line_style demo over from fltk 2.0 because I am tired of mailing this code to people. Better to advertise this as "added fl_line_style() function to set line thickness, dash patterns, and end caps". Fixed the documentation for these changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1117 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl.H | 5 +- FL/fl_draw.H | 22 ++++++- documentation/Fl_Window.html | 18 ++--- documentation/drawing.html | 41 ++++++++++++ documentation/functions.html | 20 ++++-- src/Fl.cxx | 24 +++++-- src/Fl_Menu_global.cxx | 5 +- src/Makefile | 5 +- test/Makefile | 8 +-- test/demo.menu | 3 +- test/line_style.cxx | 123 +++++++++++++++++++++++++++++++++++ 11 files changed, 237 insertions(+), 37 deletions(-) create mode 100644 test/line_style.cxx diff --git a/FL/Fl.H b/FL/Fl.H index c4570306b..c48f91b65 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1,5 +1,5 @@ // -// "$Id: Fl.H,v 1.8.2.4 2000/04/25 22:15:43 mike Exp $" +// "$Id: Fl.H,v 1.8.2.5 2000/05/13 20:03:14 bill Exp $" // // Main header file for the Fast Light Tool Kit (FLTK). // @@ -105,6 +105,7 @@ public: static FL_EXPORT void (*error)(const char*, ...); static FL_EXPORT void (*fatal)(const char*, ...); static FL_EXPORT Fl_Window* first_window(); + static FL_EXPORT void first_window(Fl_Window*); static FL_EXPORT Fl_Window* next_window(const Fl_Window*); static FL_EXPORT Fl_Window* modal() {return modal_;} static FL_EXPORT Fl_Window* grab() {return grab_;} @@ -210,5 +211,5 @@ public: #endif // -// End of "$Id: Fl.H,v 1.8.2.4 2000/04/25 22:15:43 mike Exp $". +// End of "$Id: Fl.H,v 1.8.2.5 2000/05/13 20:03:14 bill Exp $". // diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 786ffdc91..75ed41f08 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,5 +1,5 @@ // -// "$Id: fl_draw.H,v 1.9.2.2 2000/04/25 22:15:58 mike Exp $" +// "$Id: fl_draw.H,v 1.9.2.3 2000/05/13 20:03:14 bill Exp $" // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // @@ -46,6 +46,24 @@ FL_EXPORT int fl_clip_box(int, int, int, int, int& x, int& y, int& w, int& h); // points: FL_EXPORT void fl_point(int x, int y); +// line type: +FL_EXPORT void fl_line_style(int style, int width=0, char* dashes=0); +enum { + FL_SOLID = 0, + FL_DASH = 1, + FL_DOT = 2, + FL_DASHDOT = 3, + FL_DASHDOTDOT = 4, + + FL_CAP_FLAT = 0x100, + FL_CAP_ROUND = 0x200, + FL_CAP_SQUARE = 0x300, + + FL_JOIN_MITER = 0x1000, + FL_JOIN_ROUND = 0x2000, + FL_JOIN_BEVEL = 0x3000 +}; + // rectangles tweaked to exactly fill the pixel rectangle: FL_EXPORT void fl_rect(int x, int y, int w, int h); FL_EXPORT void fl_rectf(int x, int y, int w, int h); @@ -161,5 +179,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal #endif // -// End of "$Id: fl_draw.H,v 1.9.2.2 2000/04/25 22:15:58 mike Exp $". +// End of "$Id: fl_draw.H,v 1.9.2.3 2000/05/13 20:03:14 bill Exp $". // diff --git a/documentation/Fl_Window.html b/documentation/Fl_Window.html index 350a28c7c..87ac71072 100644 --- a/documentation/Fl_Window.html +++ b/documentation/Fl_Window.html @@ -49,32 +49,30 @@ exit(0) if this is the last top-level window.