Commit a92c24f6 authored by Aaron M. Ucko's avatar Aaron M. Ucko

[svn-upgrade] Integrating new upstream version, fltk1.1 (1.1.8~r6038)

parent d22d9363
......@@ -4,7 +4,18 @@ CHANGES IN FLTK 1.1.8
STR #1457, STR #1458, STR #1460, STR #1481, STR #1578,
STR #1639, STR #1645, STR #1644, STR #1792, STR #1793,
STR #1742, STR #1777, STR #1794, STR #1827, STR #1843,
STR #1796, STR #1815, STR #1726, STR #1753, STR #1855)
STR #1796, STR #1815, STR #1726, STR #1753, STR #1855,
STR #1862, STR #1867, STR #1874)
- Added documentation about the potential limitations
of Fl::grab on newer operating systems (STR #1747)
- Fixed lockout when mixing popups and alerts
(STR # 1869)
- Fixed recursion crash in event handling (STR #1873)
- Fixed missing return coe in 'fltk-config' (STR #1875)
- Fixed inconsistencies with CHANGED flags (STR #1719)
- Fixed message sent to hidden widgets (STR #1849)
- Fixed width calculation in Fl_Help_ViewA (STR #1868)
- Fixed offset bug in OS X pixmap code (STR #1856)
- Fixed potential buffer overrun
in Fl_Preferences (STR #1853)
- Fixed method attributes in consecutive class
......
......@@ -38,6 +38,7 @@
#include <FL/Fl_Input.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/fl_draw.H>
#include <string.h>
class Fl_Input_Choice : public Fl_Group {
// Private class to handle slightly 'special' behavior of menu button
......@@ -60,19 +61,41 @@ class Fl_Input_Choice : public Fl_Group {
static void menu_cb(Fl_Widget*, void *data) {
Fl_Input_Choice *o=(Fl_Input_Choice *)data;
const Fl_Menu_Item *item = o->menubutton()->mvalue();
if ( item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER) ) return; // ignore submenus
o->inp_->value(o->menu_->text());
o->inp_->set_changed();
o->do_callback();
if (item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER)) return; // ignore submenus
if (!strcmp(o->inp_->value(), o->menu_->text()))
{
o->Fl_Widget::clear_changed();
if (o->when() & FL_WHEN_NOT_CHANGED)
o->do_callback();
}
else
{
o->inp_->value(o->menu_->text());
o->inp_->set_changed();
o->Fl_Widget::set_changed();
if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
o->do_callback();
}
if (o->callback() != default_callback)
{
o->Fl_Widget::clear_changed();
o->inp_->clear_changed();
}
}
static void inp_cb(Fl_Widget*, void *data) {
Fl_Input_Choice *o=(Fl_Input_Choice *)data;
if (o->inp_->changed())
if (o->inp_->changed()) {
o->Fl_Widget::set_changed();
else
if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
o->do_callback();
} else {
o->Fl_Widget::clear_changed();
o->do_callback();
if (o->when() & FL_WHEN_NOT_CHANGED)
o->do_callback();
}
if (o->callback() != default_callback)
o->Fl_Widget::clear_changed();
}
......@@ -96,6 +119,7 @@ public:
inp_w(), inp_h());
inp_->callback(inp_cb, (void*)this);
inp_->box(FL_FLAT_BOX); // cosmetic
inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED);
menu_ = new InputMenuButton(menu_x(), menu_y(),
menu_w(), menu_h());
menu_->callback(menu_cb, (void*)this);
......
......@@ -943,6 +943,9 @@ and faster on the system.
<P><I>Be careful that your program does not enter an infinite loop
while <tt>grab()</tt> is on. On X this will lock up your screen!</I>
To avoid this potential lockup, all newer operating systems seem to
limit mouse pointer grabbing to the time during which a mouse button
is held down. Some OS's may noy support grabbing at all.
<H4><A NAME="Fl.h">int h();</A></H4>
......
......@@ -948,11 +948,6 @@ double-buffering natively.
<P>Create an RGB offscreen buffer with <tt>w*h</tt> pixels.
<H4><A NAME=fl_create_offscreen_with_alpha>Fl_Offscreen fl_create_offscreen_with_alpha(int w, int h)</A></H4>
<P>Create an RGBA offscreen buffer. Alpha blending is not available
on all platforms.
<H4><A NAME=fl_delete_offscreen>void fl_delete_offscreen(Fl_Offscreen)</A></H4>
<P>Delete a previously created offscreen buffer. All drawings are lost.
......
......@@ -55,8 +55,8 @@ The mouse position is in <a
href="Fl.html#Fl.event_x"><tt>Fl::event_x()</tt></a> and <a
href="Fl.html#Fl.event_y"><tt>Fl::event_y()</tt></a>.
<P>To receive <CODE>FL_DRAG</CODE> events you must also respond to the
<CODE>FL_PUSH</CODE> and <CODE>FL_RELEASE</CODE> events.
<P>In order to receive <TT>FL_DRAG</TT> events, the widget must
return non-zero when handling <TT>FL_PUSH</TT>.</P>
<H3>FL_RELEASE</H3>
......@@ -64,12 +64,18 @@ href="Fl.html#Fl.event_y"><tt>Fl::event_y()</tt></a>.
button by calling <A
href="Fl.html#Fl.event_button"><TT>Fl::event_button()</TT></A>.
<P>In order to receive the <TT>FL_RELEASE</TT> event, the widget must
return non-zero when handling <TT>FL_PUSH</TT>.</P>
<H3>FL_MOVE</H3>
<P>The mouse has moved without any mouse buttons held down.
This event is sent to the <A
href="Fl.html#Fl.belowmouse"><TT>Fl::belowmouse()</TT></A>
widget.
widget.</P>
<P>In order to receive <TT>FL_MOVE</TT> events, the widget must
return non-zero when handling <TT>FL_ENTER</TT>.</P>
<H3>FL_MOUSEWHEEL</H3>
......@@ -97,6 +103,9 @@ events.
<P>The mouse has moved out of the widget.
<P>In order to receive the <TT>FL_LEAVE</TT> event, the widget must
return non-zero when handling <TT>FL_ENTER</TT>.</P>
<H3>FL_FOCUS</H3>
<P>This indicates an <I>attempt</I> to give a widget the
......
......@@ -46,7 +46,6 @@ A</A>.
<LI><A HREF="#fl_contrast"><TT>fl_contrast</TT></A></LI>
<LI><A HREF="drawing.html#fl_copy_offscreen"><TT>fl_copy_offscreen</TT></A></LI>
<LI><A HREF="drawing.html#fl_create_offscreen"><TT>fl_create_offscreen</TT></A></LI>
<LI><A HREF="drawing.html#fl_create_offscreen_with_alpha"><TT>fl_create_offscreen_with_alpha</TT></A></LI>
<LI><A HREF="#fl_cursor"><TT>fl_cursor</TT></A></LI>
<LI><A HREF="drawing.html#fl_curve"><TT>fl_curve</TT></A></LI>
<LI><A HREF="#fl_darker"><TT>fl_darker</TT></A></LI>
......@@ -275,7 +274,6 @@ A</A>.
<UL>
<LI><A HREF="drawing.html#fl_copy_offscreen"><TT>fl_copy_offscreen</TT></A></LI>
<LI><A HREF="drawing.html#fl_create_offscreen"><TT>fl_create_offscreen</TT></A></LI>
<LI><A HREF="drawing.html#fl_create_offscreen_with_alpha"><TT>fl_create_offscreen_with_alpha</TT></A></LI>
<LI><A HREF="drawing.html#fl_delete_offscreen"><TT>fl_delete_offscreen</TT></A></LI>
<LI><A HREF="drawing.html#fl_end_offscreen"><TT>fl_end_offscreen</TT></A></LI>
</UL>
......
......@@ -37,6 +37,7 @@ For a description of the <TT>fl_</TT> functions, see
<A HREF="Fl_File_Browser.html">Fl_File_Browser</A><BR>
<A HREF="Fl_File_Chooser.html">Fl_File_Chooser</A><BR>
<A HREF="Fl_File_Icon.html">Fl_File_Icon</A><BR>
<A HREF="Fl_File_Input.html">Fl_File_Input</A><BR>
<A HREF="Fl_Float_Input.html">Fl_Float_Input</A><BR>
<A HREF="Fl_Free.html">Fl_Free</A><BR>
<A HREF="Fl_GIF_Image.html">Fl_GIF_Image</A><BR>
......@@ -57,8 +58,8 @@ For a description of the <TT>fl_</TT> functions, see
<A HREF="Fl_Menu_.html">Fl_Menu_</A><BR>
<A HREF="Fl_Menu_Item.html">Fl_Menu_Item</A><BR>
<A HREF="Fl_Menu_Window.html">Fl_Menu_Window</A><BR>
<A HREF="Fl_Multi_Browser.html">Fl_Multi_Browser</A><BR>
</TD><TD>
<A HREF="Fl_Multi_Browser.html">Fl_Multi_Browser</A><BR>
<A HREF="Fl_Multiline_Input.html">Fl_Multiline_Input</A><BR>
<A HREF="Fl_Multiline_Output.html">Fl_Multiline_Output</A><BR>
<A HREF="Fl_Output.html">Fl_Output</A><BR>
......@@ -195,14 +196,15 @@ For a description of the <TT>fl_</TT> functions, see
<UL>
<LI><A HREF="Fl_Input.html#Fl_Input">Fl_Input</A>
<UL>
<LI><A HREF="Fl_File_Input.html#Fl_File_Input">Fl_File_Input</A>
<LI><A HREF="Fl_Float_Input.html#Fl_Float_Input">Fl_Float_Input</A>
<LI><A HREF="Fl_Int_Input.html#Fl_Int_Input">Fl_Int_Input</A>
<LI><A HREF="Fl_Multiline_Input.html#Fl_Multiline_Input">Fl_Multiline_Input</A>
<LI><A HREF="Fl_Secret_Input.html#Fl_Secret_Input">Fl_Secret_Input</A>
</UL>
<LI><A HREF="Fl_Output.html#Fl_Output">Fl_Output</A>
<UL>
<LI><A HREF="Fl_Multiline_Output.html#Fl_Multiline_Output">Fl_Multiline_Output</A>
<LI><A HREF="Fl_Output.html#Fl_Output">Fl_Output</A>
<UL>
<LI><A HREF="Fl_Multiline_Output.html#Fl_Multiline_Output">Fl_Multiline_Output</A>
</UL>
</UL>
</UL>
<LI><A HREF="Fl_Menu_.html#Fl_Menu_">Fl_Menu_</A>
......
#!/bin/sh
#
# "$Id: fltk-config.in 6001 2007-12-16 20:44:28Z mike $"
# "$Id: fltk-config.in 6032 2008-02-20 18:10:13Z matt $"
#
# FLTK configuration utility.
#
......@@ -271,6 +271,12 @@ if test -n "$compile"; then
echo $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
$CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
# stop after compilation in case of errors
err=$?
if test $err != 0; then
exit $err
fi
fi
if test -n "$post" -a "$POSTBUILD" != ":"; then
......@@ -333,5 +339,5 @@ if test "$echo_libs" = "yes"; then
fi
#
# End of "$Id: fltk-config.in 6001 2007-12-16 20:44:28Z mike $".
# End of "$Id: fltk-config.in 6032 2008-02-20 18:10:13Z matt $".
#
//
// "$Id: Fl_Button.cxx 5489 2006-09-25 16:36:52Z mike $"
// "$Id: Fl_Button.cxx 6031 2008-02-20 17:59:13Z matt $"
//
// Button widget for the Fast Light Tool Kit (FLTK).
//
......@@ -85,7 +85,10 @@ int Fl_Button::handle(int event) {
if (type() == FL_RADIO_BUTTON) newval = 1;
else newval = !oldval;
} else
{
clear_changed();
newval = oldval;
}
if (newval != value_) {
value_ = newval;
set_changed();
......@@ -103,6 +106,7 @@ int Fl_Button::handle(int event) {
else if (type() == FL_TOGGLE_BUTTON) oldval = value_;
else {
value(oldval);
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
}
if (when() & FL_WHEN_RELEASE) do_callback();
......@@ -165,5 +169,5 @@ Fl_Button::Fl_Button(int X, int Y, int W, int H, const char *l)
}
//
// End of "$Id: Fl_Button.cxx 5489 2006-09-25 16:36:52Z mike $".
// End of "$Id: Fl_Button.cxx 6031 2008-02-20 17:59:13Z matt $".
//
//
// "$Id: Fl_Group.cxx 6002 2007-12-16 23:34:06Z mike $"
// "$Id: Fl_Group.cxx 6030 2008-02-20 17:42:08Z matt $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
......@@ -260,9 +260,7 @@ int Fl_Group::handle(int event) {
if (children()) {
for (int j = i;;) {
if (a[j]->takesevents() || event != FL_MOUSEWHEEL) {
if (send(a[j], event)) return 1;
}
if (a[j]->takesevents()) if (send(a[j], event)) return 1;
j++;
if (j >= children()) j = 0;
if (j == i) break;
......@@ -618,5 +616,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& widget) const {
}
//
// End of "$Id: Fl_Group.cxx 6002 2007-12-16 23:34:06Z mike $".
// End of "$Id: Fl_Group.cxx 6030 2008-02-20 17:42:08Z matt $".
//
//
// "$Id: Fl_Help_View.cxx 6000 2007-12-16 18:51:17Z mike $"
// "$Id: Fl_Help_View.cxx 6029 2008-02-20 17:39:07Z matt $"
//
// Fl_Help_View widget routines.
//
......@@ -1101,7 +1101,7 @@ Fl_Help_View::format()
// Reset document width...
hsize_ = w() - Fl::scrollbar_size();
hsize_ = w() - Fl::scrollbar_size() - Fl::box_dw(b);
done = 0;
while (!done)
......@@ -1853,14 +1853,14 @@ Fl_Help_View::format()
// Reset scrolling if it needs to be...
if (scrollbar_.visible()) {
int temph = h() - Fl::box_dh(box());
int temph = h() - Fl::box_dh(b);
if (hscrollbar_.visible()) temph -= ss;
if ((topline_ + temph) > size_) topline(size_ - temph);
else topline(topline_);
} else topline(0);
if (hscrollbar_.visible()) {
int tempw = w() - ss - Fl::box_dw(box());
int tempw = w() - ss - Fl::box_dw(b);
if ((leftline_ + tempw) > hsize_) leftline(hsize_ - tempw);
else leftline(leftline_);
} else leftline(0);
......@@ -3450,5 +3450,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
// End of "$Id: Fl_Help_View.cxx 6000 2007-12-16 18:51:17Z mike $".
// End of "$Id: Fl_Help_View.cxx 6029 2008-02-20 17:39:07Z matt $".
//
//
// "$Id: Fl_Input.cxx 5671 2007-02-08 07:58:47Z matt $"
// "$Id: Fl_Input.cxx 6031 2008-02-20 17:59:13Z matt $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
......@@ -409,9 +409,10 @@ int Fl_Input::handle(int event) {
// user double or triple clicked to select word or whole text
copy(0);
}
// For output widgets, do the callback so the app knows the user
// did something with the mouse...
if (readonly()) do_callback();
// perform the RELEASE callback
if (when() & FL_WHEN_RELEASE)
maybe_do_callback();
return 1;
case FL_DND_ENTER:
......@@ -468,5 +469,5 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l)
}
//
// End of "$Id: Fl_Input.cxx 5671 2007-02-08 07:58:47Z matt $".
// End of "$Id: Fl_Input.cxx 6031 2008-02-20 17:59:13Z matt $".
//
//
// "$Id: Fl_Input_.cxx 5532 2006-10-29 13:43:31Z mike $"
// "$Id: Fl_Input_.cxx 6031 2008-02-20 17:59:13Z matt $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
......@@ -715,7 +715,9 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
} else //if (Fl::selection_owner() != this)
minimal_update(mark_, position_);
case FL_HIDE:
if (when() & FL_WHEN_RELEASE) maybe_do_callback();
if (!readonly() &&
(when() & (FL_WHEN_RELEASE | FL_WHEN_NOT_CHANGED)))
maybe_do_callback();
return 1;
case FL_PUSH:
......@@ -902,5 +904,5 @@ Fl_Input_::~Fl_Input_() {
}
//
// End of "$Id: Fl_Input_.cxx 5532 2006-10-29 13:43:31Z mike $".
// End of "$Id: Fl_Input_.cxx 6031 2008-02-20 17:59:13Z matt $".
//
//
// "$Id: Fl_mac.cxx 6003 2007-12-18 09:41:12Z matt $"
// "$Id: Fl_mac.cxx 6033 2008-02-20 18:17:34Z matt $"
//
// MacOS specific code for the Fast Light Tool Kit (FLTK).
//
......@@ -850,7 +850,7 @@ static pascal OSStatus carbonWindowHandler( EventHandlerCallRef nextHandler, Eve
if ( !window->parent() ) Fl::handle( FL_HIDE, window);
break;
case kEventWindowActivated:
if ( window!=activeWindow )
if ( window->shown() && window!=activeWindow )
{
GetWindowClass( fl_xid( window ), &winClass );
if ( winClass != kHelpWindowClass ) { // help windows can't get the focus!
......@@ -899,6 +899,11 @@ static pascal OSStatus carbonMousewheelHandler( EventHandlerCallRef nextHandler,
fl_os_event = event;
Fl_Window *window = (Fl_Window*)userData;
if ( !window->shown() )
{
fl_unlock_function();
return noErr;
}
Fl::first_window(window);
EventMouseWheelAxis axis;
......@@ -954,6 +959,11 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even
fl_os_event = event;
Fl_Window *window = (Fl_Window*)userData;
if ( !window->shown() )
{
fl_unlock_function();
return noErr;
}
Fl::first_window(window);
Point pos;
GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &pos );
......@@ -2457,6 +2467,5 @@ void MacUnmapWindow(Fl_Window *w, WindowPtr p) {
}
//
// End of "$Id: Fl_mac.cxx 6003 2007-12-18 09:41:12Z matt $".
// End of "$Id: Fl_mac.cxx 6033 2008-02-20 18:17:34Z matt $".
//
//
// "$Id: fl_ask.cxx 5981 2007-11-19 16:21:19Z matt $"
// "$Id: fl_ask.cxx 6035 2008-02-20 18:33:25Z matt $"
//
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
//
......@@ -208,6 +208,10 @@ static int innards(const char* fmt, va_list ap,
button[0]->shortcut(FL_Escape);
message_form->show();
// deactivate Fl::grab(), because it is incompatible with Fl::readqueue()
Fl_Window* g = Fl::grab();
if (g) // do an alternative grab to avoid floating menus, if possible
Fl::grab(message_form);
int r;
for (;;) {
Fl_Widget *o = Fl::readqueue();
......@@ -217,6 +221,8 @@ static int innards(const char* fmt, va_list ap,
else if (o == button[2]) {r = 2; break;}
else if (o == message_form) {r = 0; break;}
}
if (g) // regrab the previous popup menu, if there was one
Fl::grab(g);
message_form->hide();
icon->label(prev_icon_label);
return r;
......@@ -361,5 +367,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) {
}
//
// End of "$Id: fl_ask.cxx 5981 2007-11-19 16:21:19Z matt $".
// End of "$Id: fl_ask.cxx 6035 2008-02-20 18:33:25Z matt $".
//
//
// "$Id: fl_draw_pixmap.cxx 5190 2006-06-09 16:16:34Z mike $"
// "$Id: fl_draw_pixmap.cxx 6026 2008-02-14 18:17:06Z matt $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
......@@ -323,10 +323,9 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
CGColorSpaceRelease(lut);
CGDataProviderRelease(src);
CGRect rect = { { x, y} , { d.w, d.h } };
Fl_X::q_begin_image(rect, x, y, d.w, d.h);
Fl_X::q_begin_image(rect, 0, 0, d.w, d.h);
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
CGContextFlush(fl_gc);
CGImageRelease(img);
delete array;
......@@ -337,5 +336,5 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
}
//
// End of "$Id: fl_draw_pixmap.cxx 5190 2006-06-09 16:16:34Z mike $".
// End of "$Id: fl_draw_pixmap.cxx 6026 2008-02-14 18:17:06Z matt $".
//
//
// "$Id: hello.cxx 6018 2008-01-10 21:56:46Z matt $"
// "$Id: hello.cxx 6036 2008-02-20 18:36:38Z matt $"
//
// Hello, World! program for the Fast Light Tool Kit (FLTK).
//
......@@ -44,5 +44,6 @@ int main(int argc, char **argv) {
}
//
// End of "$Id: hello.cxx 6018 2008-01-10 21:56:46Z matt $".
// End of "$Id: hello.cxx 6036 2008-02-20 18:36:38Z matt $".
//
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment