diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2000-10-21 20:01:56 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2000-10-21 20:01:56 +0000 |
| commit | 2cbf4041b3bf742c4ab23402234b956db9d83ce8 (patch) | |
| tree | f728cb1766fd2d6ba25348815bd5a93e6aa3692a /src | |
| parent | 710dcef237366e052ef74e68189546db6789e980 (diff) | |
Does not clear Fl::keysym on every event, this makes better back compatability and fixes Win2000
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_Group.cxx | 20 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 5 |
4 files changed, 21 insertions, 14 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index f278e0ca5..331bc295e 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.31 2000/10/17 06:40:53 spitzak Exp $" +// "$Id: Fl.cxx,v 1.24.2.32 2000/10/21 20:01:55 spitzak Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -372,6 +372,7 @@ void fl_fix_focus() { // set focus based on Fl::modal() and fl_xfocus Fl_Widget* w = fl_xfocus; if (w) { + Fl::e_keysym = 0; // make sure widgets don't think a keystroke moved focus while (w->parent()) w = w->parent(); if (Fl::modal()) w = Fl::modal(); if (!w->contains(Fl::focus())) @@ -733,5 +734,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.31 2000/10/17 06:40:53 spitzak Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.32 2000/10/21 20:01:55 spitzak Exp $". // diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index ce5f483a7..655110b9d 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Group.cxx,v 1.8.2.6 2000/06/05 21:20:51 mike Exp $" +// "$Id: Fl_Group.cxx,v 1.8.2.7 2000/10/21 20:01:56 spitzak Exp $" // // Group widget for the Fast Light Tool Kit (FLTK). // @@ -277,21 +277,29 @@ void Fl_Group::clear() { Fl_Group::~Fl_Group() {clear();} -void Fl_Group::insert(Fl_Widget &o, int i) { - if (o.parent()) ((Fl_Group*)(o.parent()))->remove(o); +void Fl_Group::insert(Fl_Widget &o, int index) { + if (o.parent()) { + Fl_Group* g = (Fl_Group*)(o.parent()); + int n = g->find(o); + if (g == this) { + if (index > n) index--; + if (index == n) return; + } + g->remove(o); + } o.parent_ = this; if (children_ == 0) { // use array pointer to point at single child array_ = (Fl_Widget**)&o; } else if (children_ == 1) { // go from 1 to 2 children Fl_Widget* t = (Fl_Widget*)array_; array_ = (Fl_Widget**)malloc(2*sizeof(Fl_Widget*)); - if (i) {array_[0] = t; array_[1] = &o;} + if (index) {array_[0] = t; array_[1] = &o;} else {array_[0] = &o; array_[1] = t;} } else { if (!(children_ & (children_-1))) // double number of children array_ = (Fl_Widget**)realloc((void*)array_, 2*children_*sizeof(Fl_Widget*)); - int j; for (j = children_; j > i; j--) array_[j] = array_[j-1]; + int j; for (j = children_; j > index; j--) array_[j] = array_[j-1]; array_[j] = &o; } children_++; @@ -505,5 +513,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { } // -// End of "$Id: Fl_Group.cxx,v 1.8.2.6 2000/06/05 21:20:51 mike Exp $". +// End of "$Id: Fl_Group.cxx,v 1.8.2.7 2000/10/21 20:01:56 spitzak Exp $". // diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 1f5eeb90b..8c1ec6b80 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.28 2000/06/20 05:47:38 bill Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.29 2000/10/21 20:01:56 spitzak Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -417,7 +417,6 @@ static Fl_Window* resize_bug_fix; static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - Fl::e_keysym = 0; #if 0 // Not sure what this is, it may be left over from earlier attempts to @@ -951,5 +950,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.28 2000/06/20 05:47:38 bill Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.29 2000/10/21 20:01:56 spitzak Exp $". // diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index bf71118af..e7f6e5aea 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_x.cxx,v 1.24.2.19 2000/08/20 04:35:16 spitzak Exp $" +// "$Id: Fl_x.cxx,v 1.24.2.20 2000/10/21 20:01:56 spitzak Exp $" // // X specific code for the Fast Light Tool Kit (FLTK). // @@ -364,7 +364,6 @@ static Fl_Window* resize_bug_fix; int fl_handle(const XEvent& xevent) { - Fl::e_keysym = 0; fl_xevent = &xevent; Window xid = xevent.xany.window; @@ -898,5 +897,5 @@ void Fl_Window::make_current() { #endif // -// End of "$Id: Fl_x.cxx,v 1.24.2.19 2000/08/20 04:35:16 spitzak Exp $". +// End of "$Id: Fl_x.cxx,v 1.24.2.20 2000/10/21 20:01:56 spitzak Exp $". // |
