summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-05-13 20:03:20 +0000
committerBill Spitzak <spitzak@gmail.com>2000-05-13 20:03:20 +0000
commitd5b47034a7575151963f1fc85a4630f68208e73a (patch)
tree023ff7f35eeda76f2343cd895b4e2ea2101319b8 /src
parent2d826eb564160432259480504537e5797eced931 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx24
-rw-r--r--src/Fl_Menu_global.cxx5
-rw-r--r--src/Makefile5
3 files changed, 23 insertions, 11 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index c2252a923..62b504eba 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,6 +1,6 @@
#include <stdio.h>
//
-// "$Id: Fl.cxx,v 1.24.2.20 2000/05/11 21:58:09 bill Exp $"
+// "$Id: Fl.cxx,v 1.24.2.21 2000/05/13 20:03:17 bill Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -272,14 +272,24 @@ Fl_Window* fl_find(Window xid) {
return 0;
}
-void Fl::redraw() {
- for (Fl_X* x = Fl_X::first; x; x = x->next) x->w->redraw();
+Fl_Window* Fl::first_window() {
+ Fl_X* x = Fl_X::first;
+ return x ? x->w : 0;
}
-Fl_Window* Fl::first_window() {Fl_X* x = Fl_X::first; return x ? x->w : 0;}
-
Fl_Window* Fl::next_window(const Fl_Window* w) {
- Fl_X* x = Fl_X::i(w)->next; return x ? x->w : 0;}
+ Fl_X* x = Fl_X::i(w)->next;
+ return x ? x->w : 0;
+}
+
+void Fl::first_window(Fl_Window* window) {
+ if (!window || !window->shown()) return;
+ fl_find(fl_xid(window));
+}
+
+void Fl::redraw() {
+ for (Fl_X* x = Fl_X::first; x; x = x->next) x->w->redraw();
+}
////////////////////////////////////////////////////////////////
// Event handlers:
@@ -696,5 +706,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.20 2000/05/11 21:58:09 bill Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.21 2000/05/13 20:03:17 bill Exp $".
//
diff --git a/src/Fl_Menu_global.cxx b/src/Fl_Menu_global.cxx
index 032c27375..24be52073 100644
--- a/src/Fl_Menu_global.cxx
+++ b/src/Fl_Menu_global.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_global.cxx,v 1.5.2.1 2000/04/25 22:16:28 mike Exp $"
+// "$Id: Fl_Menu_global.cxx,v 1.5.2.2 2000/05/13 20:03:18 bill Exp $"
//
// Global menu shortcut code for the Fast Light Tool Kit (FLTK).
//
@@ -34,6 +34,7 @@ static Fl_Menu_* the_widget;
static int handler(int e) {
if (e != FL_SHORTCUT || Fl::modal()) return 0;
+ Fl::first_window(the_widget->window());
return the_widget->handle(e);
}
@@ -43,5 +44,5 @@ void Fl_Menu_::global() {
}
//
-// End of "$Id: Fl_Menu_global.cxx,v 1.5.2.1 2000/04/25 22:16:28 mike Exp $".
+// End of "$Id: Fl_Menu_global.cxx,v 1.5.2.2 2000/05/13 20:03:18 bill Exp $".
//
diff --git a/src/Makefile b/src/Makefile
index c6cd4ece3..0f24c28d9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile,v 1.18.2.10 2000/04/25 22:16:37 mike Exp $"
+# "$Id: Makefile,v 1.18.2.11 2000/05/13 20:03:18 bill Exp $"
#
# Library makefile for the Fast Light Tool Kit (FLTK).
#
@@ -114,6 +114,7 @@ CPPFILES = \
fl_file_chooser.cxx \
fl_font.cxx \
fl_labeltype.cxx \
+ fl_line_style.cxx \
fl_oval_box.cxx \
fl_overlay.cxx \
fl_overlay_visual.cxx \
@@ -206,5 +207,5 @@ install: $(LIBRARY) $(DSONAME)
ln -s FL $(includedir)/Fl
#
-# End of "$Id: Makefile,v 1.18.2.10 2000/04/25 22:16:37 mike Exp $".
+# End of "$Id: Makefile,v 1.18.2.11 2000/05/13 20:03:18 bill Exp $".
#