Browse Source

It crashed when a group with exactly 1 child was deleted.

Overlay on a single buffered Fl_Gl_Window is faked more accurately when
there is no overlay hardware.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@639 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
branch-1.0
Bill Spitzak 26 years ago
parent
commit
7508ce1e31
  1. 6
      FL/Fl_Menu_.H
  2. 8
      src/Fl_Gl_Window.cxx
  3. 6
      src/Fl_Group.cxx
  4. 15
      src/Fl_Menu.cxx

6
FL/Fl_Menu_.H

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu_.H,v 1.7 1999/02/16 21:59:39 mike Exp $"
// "$Id: Fl_Menu_.H,v 1.7.2.1 1999/08/09 06:19:32 bill Exp $"
//
// Menu base class header file for the Fast Light Tool Kit (FLTK).
//
@ -38,7 +38,6 @@ class Fl_Menu_ : public Fl_Widget { @@ -38,7 +38,6 @@ class Fl_Menu_ : public Fl_Widget {
protected:
FL_EXPORT const Fl_Menu_Item* picked(const Fl_Menu_Item*);
uchar down_box_;
uchar textfont_;
uchar textsize_;
@ -46,6 +45,7 @@ protected: @@ -46,6 +45,7 @@ protected:
uchar alloc;
public:
FL_EXPORT const Fl_Menu_Item* picked(const Fl_Menu_Item*);
FL_EXPORT Fl_Menu_(int,int,int,int,const char * =0);
FL_EXPORT ~Fl_Menu_();
@ -93,5 +93,5 @@ public: @@ -93,5 +93,5 @@ public:
#endif
//
// End of "$Id: Fl_Menu_.H,v 1.7 1999/02/16 21:59:39 mike Exp $".
// End of "$Id: Fl_Menu_.H,v 1.7.2.1 1999/08/09 06:19:32 bill Exp $".
//

8
src/Fl_Gl_Window.cxx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.1 1999/03/18 20:04:12 bill Exp $"
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.2 1999/08/09 06:19:32 bill Exp $"
//
// OpenGL window code for the Fast Light Tool Kit (FLTK).
//
@ -255,9 +255,7 @@ void Fl_Gl_Window::flush() { @@ -255,9 +255,7 @@ void Fl_Gl_Window::flush() {
} else { // single-buffered context is simpler:
// this faking of the overlay is incorrect but worked good for
// one in-house program:
if (overlay != this || damage()!=FL_DAMAGE_OVERLAY || !Fl::pushed()) draw();
draw();
if (overlay == this) draw_overlay();
glFlush();
@ -328,5 +326,5 @@ void Fl_Gl_Window::draw_overlay() {} @@ -328,5 +326,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif
//
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.1 1999/03/18 20:04:12 bill Exp $".
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.2 1999/08/09 06:19:32 bill Exp $".
//

6
src/Fl_Group.cxx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// "$Id: Fl_Group.cxx,v 1.8.2.2 1999/07/22 21:37:03 bill Exp $"
// "$Id: Fl_Group.cxx,v 1.8.2.3 1999/08/09 06:19:32 bill Exp $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
@ -259,7 +259,7 @@ void Fl_Group::clear() { @@ -259,7 +259,7 @@ void Fl_Group::clear() {
int old_children = children();
// clear everything now, in case fl_fix_focus recursively calls us:
children_ = 0;
array_ = 0;
// array_ = 0; dont do this, it will clobber old_array if only one child
savedfocus_ = 0;
resizable_ = this;
init_sizes();
@ -503,5 +503,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { @@ -503,5 +503,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const {
}
//
// End of "$Id: Fl_Group.cxx,v 1.8.2.2 1999/07/22 21:37:03 bill Exp $".
// End of "$Id: Fl_Group.cxx,v 1.8.2.3 1999/08/09 06:19:32 bill Exp $".
//

15
src/Fl_Menu.cxx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu.cxx,v 1.18.2.1 1999/04/26 06:45:27 bill Exp $"
// "$Id: Fl_Menu.cxx,v 1.18.2.2 1999/08/09 06:19:33 bill Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@ -536,7 +536,16 @@ int menuwindow::handle(int e) { @@ -536,7 +536,16 @@ int menuwindow::handle(int e) {
// the second click (not the one that popped up the menu):
if (!Fl::event_is_click() || p.state == PUSH_STATE ||
p.menubar && p.current_item && !p.current_item->submenu() // button
) p.state = DONE_STATE;
) {
#if 0 // makes the check/radio items leave the menu up
const Fl_Menu_Item* m = p.current_item;
if (m && button && (m->flags & (FL_MENU_TOGGLE|FL_MENU_RADIO))) {
((Fl_Menu_*)button)->picked(m);
p.p[p.menu_number]->redraw();
} else
#endif
p.state = DONE_STATE;
}
return 1;
}
return Fl_Window::handle(e);
@ -719,5 +728,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { @@ -719,5 +728,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
// End of "$Id: Fl_Menu.cxx,v 1.18.2.1 1999/04/26 06:45:27 bill Exp $".
// End of "$Id: Fl_Menu.cxx,v 1.18.2.2 1999/08/09 06:19:33 bill Exp $".
//

Loading…
Cancel
Save