Skip to content

Commit

Permalink
Fixed tooltips under WIN32 - no more toolbar buttons...
Browse files Browse the repository at this point in the history
Fl_Group::handle() didn't pass FL_RELEASE events to
Fl_Browser_ and similar subclasses of Fl_Group; updated to
pass only to widget that should receive the event.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1547 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Aug 3, 2001
1 parent 0771e7c commit 5994add
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/Fl_Browser_.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.2 2001/08/02 21:11:43 easysw Exp $"
// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.3 2001/08/03 15:48:20 easysw Exp $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
Expand All @@ -23,6 +23,7 @@
// Please report all bugs and problems to "fltk-bugs@fltk.org".
//

#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Browser_.H>
Expand Down Expand Up @@ -497,7 +498,6 @@ int Fl_Browser_::select_only(void* l, int docallbacks) {
}

int Fl_Browser_::handle(int event) {

// must do shortcuts first or the scrollbar will get them...
if ((event == FL_SHORTCUT || event == FL_KEYBOARD)
&& type() >= FL_HOLD_BROWSER) {
Expand Down Expand Up @@ -715,5 +715,5 @@ void Fl_Browser_::item_select(void*, int) {}
int Fl_Browser_::item_selected(void* l) const {return l==selection_;}

//
// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.2 2001/08/02 21:11:43 easysw Exp $".
// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.3 2001/08/03 15:48:20 easysw Exp $".
//
1 change: 1 addition & 0 deletions src/Fl_FileChooser.cxx
Expand Up @@ -104,6 +104,7 @@ Fl_FileChooser::Fl_FileChooser(const char *d, const char *p, int t, const char *
w->hotspot(o);
{ Fl_FileBrowser* o = fileList = new Fl_FileBrowser(10, 45, 355, 180);
o->type(2);
o->when(FL_WHEN_RELEASE_ALWAYS);
o->callback((Fl_Callback*)cb_fileList);
Fl_Group::current()->resizable(o);
w->hotspot(o);
Expand Down
14 changes: 11 additions & 3 deletions src/Fl_Group.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Group.cxx,v 1.8.2.8.2.3 2001/08/02 21:11:43 easysw Exp $"
// "$Id: Fl_Group.cxx,v 1.8.2.8.2.4 2001/08/03 15:48:20 easysw Exp $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -169,6 +169,15 @@ int Fl_Group::handle(int event) {
}
return 0;

case FL_RELEASE:
for (i = children(); i--;) {
o = a[i];
if (o->takesevents() && Fl::event_inside(o)) {
if (send(o,FL_RELEASE)) return 1;
}
}
return 0;

case FL_DEACTIVATE:
case FL_ACTIVATE:
for (i = children(); i--;) {
Expand Down Expand Up @@ -205,7 +214,6 @@ int Fl_Group::handle(int event) {
}

return 0;

}
}

Expand Down Expand Up @@ -538,5 +546,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const {
}

//
// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.3 2001/08/02 21:11:43 easysw Exp $".
// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.4 2001/08/03 15:48:20 easysw Exp $".
//
5 changes: 3 additions & 2 deletions src/Fl_Widget.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.1 2001/08/02 15:31:59 easysw Exp $"
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.2 2001/08/03 15:48:20 easysw Exp $"
//
// Base widget class for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -80,6 +80,7 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
label_.font = FL_HELVETICA;
label_.size = FL_NORMAL_SIZE;
label_.color = FL_BLACK;
tooltip_ = 0;
callback_ = default_callback;
user_data_ = 0;
type_ = 0;
Expand Down Expand Up @@ -205,5 +206,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const {
}

//
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.1 2001/08/02 15:31:59 easysw Exp $".
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.2 2001/08/03 15:48:20 easysw Exp $".
//
10 changes: 6 additions & 4 deletions src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_win32.cxx,v 1.33.2.37.2.2 2001/08/03 02:28:32 easysw Exp $"
// "$Id: Fl_win32.cxx,v 1.33.2.37.2.3 2001/08/03 15:48:20 easysw Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -726,6 +726,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
x(X); y(Y);
flags |= SWP_NOSIZE;
}
if (!border()) flags |= SWP_NOACTIVATE;
if (resize_from_program && shown()) {
int dummy, bt, bx, by;
//Ignore window managing when resizing, so that windows (and more
Expand Down Expand Up @@ -837,7 +838,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
while (w->parent()) w = w->window();
parent = fl_xid(w);
if (!w->visible()) showit = 0;
}
} else if (Fl::grab()) parent = fl_xid(Fl::grab());
}

Fl_X* x = new Fl_X;
Expand Down Expand Up @@ -868,7 +869,8 @@ Fl_X* Fl_X::make(Fl_Window* w) {
// If we've captured the mouse, we dont want do activate any
// other windows from the code, or we loose the capture.
ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE :
fl_capture? SW_SHOWNOACTIVATE : SW_SHOWNORMAL);
(Fl::grab() || (style & WS_POPUP)) ? SW_SHOWNOACTIVATE : SW_SHOWNORMAL);

if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
return x;
}
Expand Down Expand Up @@ -991,5 +993,5 @@ void Fl_Window::make_current() {
}

//
// End of "$Id: Fl_win32.cxx,v 1.33.2.37.2.2 2001/08/03 02:28:32 easysw Exp $".
// End of "$Id: Fl_win32.cxx,v 1.33.2.37.2.3 2001/08/03 15:48:20 easysw Exp $".
//
6 changes: 4 additions & 2 deletions src/fl_file_chooser.cxx
@@ -1,5 +1,5 @@
//
// "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.1 2001/08/02 16:17:04 easysw Exp $"
// "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.2 2001/08/03 15:48:20 easysw Exp $"
//
// File chooser widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -37,6 +37,8 @@ void fl_file_chooser_callback(void (*cb)(const char*)) {

char* fl_file_chooser(const char* message, const char* pat, const char* fname)
{
if (!fname || !*fname) fname = ".";

if (!fc) fc = new Fl_FileChooser(fname, pat, Fl_FileChooser::CREATE, message);
else {
fc->filter(pat);
Expand All @@ -54,5 +56,5 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname)


//
// End of "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.1 2001/08/02 16:17:04 easysw Exp $".
// End of "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.2 2001/08/03 15:48:20 easysw Exp $".
//
4 changes: 2 additions & 2 deletions visualc/editor.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions visualc/fltkdll.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions visualc/fltkgldll.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5994add

Please sign in to comment.