More doco updates.

All of the core widgets now consistently set changed() before
calling the callback function for a change in value; this allows
programs to check the changed() state in a callback to see why
they are being called (STR #475)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2004-07-27 16:02:21 +00:00
parent a529510e5b
commit 62c19c63d6
20 changed files with 141 additions and 95 deletions

View File

@ -1,7 +1,12 @@
CHANGES IN FLTK 1.1.5rc2
- Documentation updates (STR #365, STR #399, STR #407,
STR #412, STR #414, STR #462)
STR #412, STR #414, STR #452, STR #462)
- All of the core widgets now consistently set changed()
before calling the callback function for a change in
value; this allows programs to check the changed()
state in a callback to see why they are being called
(STR #475)
- Fl_File_Chooser did not handle some cases for filename
completion (STR #376)
- Fl_Help_View didn't properly compute the default

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Widget.H,v 1.6.2.4.2.23 2004/04/11 04:38:54 easysw Exp $"
// "$Id: Fl_Widget.H,v 1.6.2.4.2.24 2004/07/27 16:02:18 easysw Exp $"
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
@ -185,9 +185,9 @@ public:
int visible_focus() { return flags_ & VISIBLE_FOCUS; }
static void default_callback(Fl_Widget*, void*);
void do_callback() {callback_(this,user_data_);}
void do_callback(Fl_Widget* o,void* arg=0) {callback_(o,arg);}
void do_callback(Fl_Widget* o,long arg) {callback_(o,(void*)arg);}
void do_callback() {callback_(this,user_data_); if (callback_ != default_callback) clear_changed();}
void do_callback(Fl_Widget* o,void* arg=0) {callback_(o,arg); if (callback_ != default_callback) clear_changed();}
void do_callback(Fl_Widget* o,long arg) {callback_(o,(void*)arg); if (callback_ != default_callback) clear_changed();}
int test_shortcut();
static int test_shortcut(const char*);
int contains(const Fl_Widget*) const ;
@ -217,5 +217,5 @@ public:
#endif
//
// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.23 2004/04/11 04:38:54 easysw Exp $".
// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.24 2004/07/27 16:02:18 easysw Exp $".
//

View File

@ -20,7 +20,7 @@
</UL>
<H3>Description</H3>
This is the base class for browsers. To be useful it must be
subclassed and several virtual functions defined. The Forms-compatable
subclassed and several virtual functions defined. The Forms-compatible
browser and the file chooser's browser are subclassed off of this.
<P>This has been designed so that the subclass has complete control
over the storage of the data, although because <TT>next()</TT> and <TT>

View File

@ -127,16 +127,28 @@ char* shortcut, Fl_Callback*, void *user_data=0, int flags=0)</a><br>
int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*,
void *user_data=0, int flags=0)</h4>
Adds a new menu item, with a <TT>title</TT> string, <TT> shortcut</TT>
string, <TT>callback</TT>, argument to the callback, and flags. If
the menu array was directly set with menu(x) then copy() is done to
make a private array.
<p>Adds a new menu item, with a <TT>title</TT> string, <TT>
shortcut</TT> string, <TT>callback</TT>, argument to the
callback, and flags. If the menu array was directly set with
<tt>menu(x)</tt> then <tt>copy()</tt> is done to make a private
array.
<P>Text is a string of the form &quot;foo/bar/baz&quot;, this example
will result in a submenu called &quot;foo&quot; and one in that called
&quot;bar&quot; and and entry called &quot;baz&quot;. The text is
copied to new memory and can be freed. The other arguments (including
the shortcut) are copied into the menu item unchanged. </P>
<p>The characters "&amp;", "/", "\", and "_" are treated as
special characters in the label string. The "&amp;" character
specifies that the following character is an accelerator and
will be underlined. The "\" character is used to escape the next
character in the string. Labels starting with the "_" character
cause a divider to be placed before that menu item.</p>
<p>A label of the form &quot;foo/bar/baz&quot; will create a
submenus called &quot;foo&quot; and &quot;bar&quot; with an
entry called &quot;baz&quot;. The "/" character is ignored if it
appears as the first character of the label string, e.g.
"/foo/bar/baz".</p>
<p>The label string is copied to new memory and can be freed.
The other arguments (including the shortcut) are copied into the
menu item unchanged. </P>
<P>If an item exists already with that name then it is replaced with
this new one. Otherwise this new one is added to the end of the
@ -166,10 +178,12 @@ Text shortcuts are converted to integer shortcut by calling
<h4>int Fl_Menu_::add(const char *)</H4>
<P>The passed string is split at any '|' characters and then <TT>
add(s,0,0,0,0)</TT> is done with each section. This is often useful
if you are just using the value, and is compatable with Forms
and other GL programs. </P>
<P>The passed string is split at any '|' characters and then
<TT>add(s,0,0,0,0)</TT> is done with each section. This is
often useful if you are just using the value, and is compatible
with Forms and other GL programs. The section strings use the
same special characters as described for the long version of <a
href='#Fl_Menu_.add'><tt>add()</tt></a></p>
<H4><A name=Fl_Menu_.replace>void Fl_Menu_::replace(int n, const char *)</A>
</H4>

View File

@ -20,7 +20,7 @@ functions. Most of the XForms demo programs work without changes.
<P>You will also have to compile your Forms or XForms program using a
C++ compiler. The FLTK library does not provide C bindings or header
files. </P>
<P>Although FLTK was designed to be compatable with the GL Forms
<P>Although FLTK was designed to be compatible with the GL Forms
library (version 0.3 or so), XForms has bloated severely and it's
interface is X-specific. Therefore, XForms compatibility is no longer
a goal of FLTK. Compatibility was limited to things that were free, or

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.20 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.21 2004/07/27 16:02:19 easysw Exp $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
@ -510,7 +510,10 @@ int Fl_Browser_::select(void* l, int i, int docallbacks) {
display(l);
}
}
if (docallbacks) do_callback();
if (docallbacks) {
set_changed();
do_callback();
}
return 1;
}
@ -687,8 +690,8 @@ int Fl_Browser_::handle(int event) {
void* t = selection_; deselect(); selection_ = t;
}
if (change) {
set_changed();
if (when() & FL_WHEN_RELEASE) do_callback();
else if (!(when()&FL_WHEN_CHANGED)) set_changed();
} else {
if (when() & FL_WHEN_NOT_CHANGED) do_callback();
}
@ -758,5 +761,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.20 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.21 2004/07/27 16:02:19 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Button.cxx,v 1.4.2.6.2.22 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Button.cxx,v 1.4.2.6.2.23 2004/07/27 16:02:20 easysw Exp $"
//
// Button widget for the Fast Light Tool Kit (FLTK).
//
@ -81,6 +81,7 @@ int Fl_Button::handle(int event) {
newval = oldval;
if (newval != value_) {
value_ = newval;
set_changed();
redraw();
if (when() & FL_WHEN_CHANGED) do_callback();
}
@ -90,15 +91,14 @@ int Fl_Button::handle(int event) {
if (when() & FL_WHEN_NOT_CHANGED) do_callback();
return 1;
}
if (type() == FL_RADIO_BUTTON)
setonly();
else if (type() == FL_TOGGLE_BUTTON)
oldval = value_;
set_changed();
if (type() == FL_RADIO_BUTTON) setonly();
else if (type() == FL_TOGGLE_BUTTON) oldval = value_;
else {
value(oldval);
if (when() & FL_WHEN_CHANGED) do_callback();
}
if (when() & FL_WHEN_RELEASE) do_callback(); else set_changed();
if (when() & FL_WHEN_RELEASE) do_callback();
return 1;
case FL_SHORTCUT:
if (!(shortcut() ?
@ -108,12 +108,13 @@ int Fl_Button::handle(int event) {
if (type() == FL_RADIO_BUTTON && !value_) {
setonly();
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
} else if (type() == FL_TOGGLE_BUTTON) {
value(!value());
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
}
if (when() & FL_WHEN_RELEASE) do_callback(); else set_changed();
} else if (when() & FL_WHEN_RELEASE) do_callback();
return 1;
case FL_FOCUS :
case FL_UNFOCUS :
@ -131,6 +132,7 @@ int Fl_Button::handle(int event) {
case FL_KEYBOARD :
if (Fl::focus() == this && Fl::event_key() == ' ' &&
!(Fl::event_state() & (FL_SHIFT | FL_CTRL | FL_ALT | FL_META))) {
set_changed();
if (type() == FL_RADIO_BUTTON && !value_) {
setonly();
if (when() & FL_WHEN_CHANGED) do_callback();
@ -138,7 +140,7 @@ int Fl_Button::handle(int event) {
value(!value());
if (when() & FL_WHEN_CHANGED) do_callback();
}
if (when() & FL_WHEN_RELEASE) do_callback(); else set_changed();
if (when() & FL_WHEN_RELEASE) do_callback();
return 1;
}
default:
@ -156,5 +158,5 @@ Fl_Button::Fl_Button(int X, int Y, int W, int H, const char *l)
}
//
// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.22 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.23 2004/07/27 16:02:20 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.7 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.8 2004/07/27 16:02:20 easysw Exp $"
//
// Color chooser for the Fast Light Tool Kit (FLTK).
//
@ -125,6 +125,7 @@ int Fl_Color_Chooser::rgb(double R, double G, double B) {
double pv = value_;
rgb2hsv(R,G,B,hue_,saturation_,value_);
set_valuators();
set_changed();
if (value_ != pv) {
#ifdef UPDATE_HUE_BOX
huebox.damage(FL_DAMAGE_SCROLL);
@ -157,6 +158,7 @@ int Fl_Color_Chooser::hsv(double H, double S, double V) {
}
hsv2rgb(H,S,V,r_,g_,b_);
set_valuators();
set_changed();
return 1;
}
@ -521,5 +523,5 @@ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) {
}
//
// End of "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.7 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.8 2004/07/27 16:02:20 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_File_Input.cxx,v 1.1.2.11 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_File_Input.cxx,v 1.1.2.12 2004/07/27 16:02:20 easysw Exp $"
//
// File_Input header file for the Fast Light Tool Kit (FLTK).
//
@ -262,6 +262,7 @@ Fl_File_Input::handle_button(int event) // I - Event
value(newvalue, start - newvalue);
// Then do the callbacks, if necessary...
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
}
@ -270,5 +271,5 @@ Fl_File_Input::handle_button(int event) // I - Event
//
// End of "$Id: Fl_File_Input.cxx,v 1.1.2.11 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_File_Input.cxx,v 1.1.2.12 2004/07/27 16:02:20 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Help_View.cxx,v 1.1.2.52 2004/07/26 20:52:51 easysw Exp $"
// "$Id: Fl_Help_View.cxx,v 1.1.2.53 2004/07/27 16:02:20 easysw Exp $"
//
// Fl_Help_View widget routines.
//
@ -1372,6 +1372,7 @@ Fl_Help_View::format()
needspace = 0;
line = 0;
newalign = get_align(attrs, tolower(buf[1]) == 'h' ? CENTER : LEFT);
talign = newalign;
cells[column] = block - blocks_;
@ -1574,15 +1575,15 @@ Fl_Help_View::format()
// Reset scrolling if it needs to be...
if (scrollbar_.visible()) {
int hh = h() - 8;
if (hscrollbar_.visible()) hh -= 16;
if ((topline_ + hh) > size_) topline(size_ - hh);
int temph = h() - 8;
if (hscrollbar_.visible()) temph -= 16;
if ((topline_ + temph) > size_) topline(size_ - temph);
else topline(topline_);
} else topline(0);
if (hscrollbar_.visible()) {
int ww = w() - 24;
if ((leftline_ + ww) > hsize_) leftline(hsize_ - ww);
int tempw = w() - 24;
if ((leftline_ + tempw) > hsize_) leftline(hsize_ - tempw);
else leftline(leftline_);
} else leftline(0);
}
@ -2606,8 +2607,8 @@ Fl_Help_View::topline(int t) // I - Top line number
scrollbar_.value(topline_, h() - 24, 0, size_);
set_changed();
do_callback();
clear_changed();
redraw();
}
@ -2810,5 +2811,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.52 2004/07/26 20:52:51 easysw Exp $".
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.53 2004/07/27 16:02:20 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.29 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.30 2004/07/27 16:02:21 easysw Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@ -599,7 +599,8 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
mark_ = position_ = undoat;
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
return 1;
}
@ -636,7 +637,8 @@ int Fl_Input_::undo() {
position_ = b;
minimal_update(b1);
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
return 1;
}
@ -649,7 +651,8 @@ int Fl_Input_::copy_cuts() {
void Fl_Input_::maybe_do_callback() {
if (changed() || (when()&FL_WHEN_NOT_CHANGED)) {
clear_changed(); do_callback();}
do_callback();
}
}
int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
@ -852,5 +855,5 @@ Fl_Input_::~Fl_Input_() {
}
//
// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.29 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.30 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.9 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.10 2004/07/27 16:02:21 easysw Exp $"
//
// Common menu code for the Fast Light Tool Kit (FLTK).
//
@ -138,7 +138,6 @@ const Fl_Menu_Item* Fl_Menu_::picked(const Fl_Menu_Item* v) {
value_ = v;
if (when()&(FL_WHEN_CHANGED|FL_WHEN_RELEASE)) {
if (changed() || when()&FL_WHEN_NOT_CHANGED) {
clear_changed();
if (value_ && value_->callback_) value_->do_callback((Fl_Widget*)this);
else do_callback();
}
@ -225,5 +224,5 @@ void Fl_Menu_::clear() {
}
//
// End of "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.9 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.10 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.4 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.5 2004/07/27 16:02:21 easysw Exp $"
//
// Positioner widget for the Fast Light Tool Kit (FLTK).
//
@ -89,9 +89,11 @@ int Fl_Positioner::handle(int event, int X, int Y, int W, int H) {
if (yy > ymax) yy = ymax;
if (value(xx, yy)) set_changed();}
if (!(when() & FL_WHEN_CHANGED ||
when() & FL_WHEN_RELEASE && event == FL_RELEASE)) return 1;
(when() & FL_WHEN_RELEASE && event == FL_RELEASE))) return 1;
if (changed() || when()&FL_WHEN_NOT_CHANGED) {
clear_changed(); do_callback();}
if (event == FL_RELEASE) clear_changed();
do_callback();
}
return 1;
default:
return 0;
@ -129,5 +131,5 @@ void Fl_Positioner::ybounds(double a, double b) {
}
//
// End of "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.4 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.5 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.16 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.17 2004/07/27 16:02:21 easysw Exp $"
//
// Scroll bar widget for the Fast Light Tool Kit (FLTK).
//
@ -176,6 +176,7 @@ int Fl_Scrollbar::handle(int event) {
if (v != value()) {
Fl_Slider::value(v);
value_damage();
set_changed();
do_callback();
}
return 1;}
@ -242,5 +243,5 @@ Fl_Scrollbar::Fl_Scrollbar(int X, int Y, int W, int H, const char* L)
}
//
// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.16 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.17 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.19 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.20 2004/07/27 16:02:21 easysw Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@ -133,8 +133,13 @@ int Fl_Tabs::handle(int event) {
case FL_DRAG:
case FL_RELEASE:
o = which(Fl::event_x(), Fl::event_y());
if (event == FL_RELEASE) {push(0); if (o && value(o)) do_callback();}
else push(o);
if (event == FL_RELEASE) {
push(0);
if (o && value(o)) {
set_changed();
do_callback();
}
} else push(o);
if (Fl::visible_focus() && event == FL_RELEASE) Fl::focus(this);
return 1;
case FL_FOCUS:
@ -160,6 +165,7 @@ int Fl_Tabs::handle(int event) {
for (i = 1; i < children(); i ++)
if (child(i)->visible()) break;
value(child(i - 1));
set_changed();
do_callback();
return 1;
case FL_Right:
@ -167,6 +173,7 @@ int Fl_Tabs::handle(int event) {
for (i = 0; i < children(); i ++)
if (child(i)->visible()) break;
value(child(i + 1));
set_changed();
do_callback();
return 1;
case FL_Down:
@ -302,5 +309,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
}
//
// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.19 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.20 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.20 2004/07/26 20:52:52 easysw Exp $"
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.21 2004/07/27 16:02:21 easysw Exp $"
//
// Copyright 2001-2004 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@ -185,8 +185,8 @@ int Fl_Text_Editor::kf_default(int c, Fl_Text_Editor* e) {
if (e->insert_mode()) e->insert(s);
else e->overstrike(s);
e->show_insert_position();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
else e->set_changed();
return 1;
}
@ -199,7 +199,8 @@ int Fl_Text_Editor::kf_backspace(int, Fl_Text_Editor* e) {
e->buffer()->select(e->insert_position(), e->insert_position()+1);
kill_selection(e);
e->show_insert_position();
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return 1;
}
@ -207,7 +208,8 @@ int Fl_Text_Editor::kf_enter(int, Fl_Text_Editor* e) {
kill_selection(e);
e->insert("\n");
e->show_insert_position();
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return 1;
}
@ -342,7 +344,8 @@ int Fl_Text_Editor::kf_delete(int, Fl_Text_Editor* e) {
e->buffer()->select(e->insert_position(), e->insert_position()+1);
kill_selection(e);
e->show_insert_position();
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return 1;
}
@ -358,7 +361,8 @@ int Fl_Text_Editor::kf_copy(int, Fl_Text_Editor* e) {
int Fl_Text_Editor::kf_cut(int c, Fl_Text_Editor* e) {
kf_copy(c, e);
kill_selection(e);
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return 1;
}
@ -366,7 +370,8 @@ int Fl_Text_Editor::kf_paste(int, Fl_Text_Editor* e) {
kill_selection(e);
Fl::paste(*e, 1);
e->show_insert_position();
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return 1;
}
@ -381,7 +386,8 @@ int Fl_Text_Editor::kf_undo(int , Fl_Text_Editor* e) {
int ret = e->buffer()->undo(&crsr);
e->insert_position(crsr);
e->show_insert_position();
if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
e->set_changed();
if (e->when()&FL_WHEN_CHANGED) e->do_callback();
return ret;
}
@ -399,8 +405,8 @@ int Fl_Text_Editor::handle_key() {
else overstrike(Fl::event_text());
}
show_insert_position();
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
else set_changed();
return 1;
}
@ -417,8 +423,7 @@ int Fl_Text_Editor::handle_key() {
void Fl_Text_Editor::maybe_do_callback() {
// printf("Fl_Text_Editor::maybe_do_callback()\n");
// printf("changed()=%d, when()=%x\n", changed(), when());
if (changed() || (when()&FL_WHEN_NOT_CHANGED)) {
clear_changed(); do_callback();}
if (changed() || (when()&FL_WHEN_NOT_CHANGED)) do_callback();
}
int Fl_Text_Editor::handle(int event) {
@ -428,7 +433,8 @@ int Fl_Text_Editor::handle(int event) {
dragType = -1;
Fl::paste(*this, 0);
Fl::focus(this);
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
return 1;
}
@ -458,7 +464,8 @@ int Fl_Text_Editor::handle(int event) {
if (insert_mode()) insert(Fl::event_text());
else overstrike(Fl::event_text());
show_insert_position();
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
return 1;
case FL_ENTER:
@ -472,5 +479,5 @@ int Fl_Text_Editor::handle(int event) {
}
//
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.20 2004/07/26 20:52:52 easysw Exp $".
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.21 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Tile.cxx,v 1.5.2.5.2.6 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Tile.cxx,v 1.5.2.5.2.7 2004/07/27 16:02:21 easysw Exp $"
//
// Tile widget for the Fast Light Tool Kit (FLTK).
//
@ -187,6 +187,7 @@ int Fl_Tile::handle(int event) {
} else
newy = sy;
position(sx,sy,newx,newy);
if (event == FL_DRAG) set_changed();
do_callback();
return 1;}
@ -196,5 +197,5 @@ int Fl_Tile::handle(int event) {
}
//
// End of "$Id: Fl_Tile.cxx,v 1.5.2.5.2.6 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Tile.cxx,v 1.5.2.5.2.7 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.8 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.9 2004/07/27 16:02:21 easysw Exp $"
//
// Valuator widget for the Fast Light Tool Kit (FLTK).
//
@ -80,8 +80,8 @@ void Fl_Valuator::handle_drag(double v) {
if (v != value_) {
value_ = v;
value_damage();
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
else set_changed();
}
}
@ -92,8 +92,9 @@ void Fl_Valuator::handle_release() {
// initial position:
clear_changed();
// now do the callback only if slider in new position or always is on:
if (value_ != previous_value_ || when() & FL_WHEN_NOT_CHANGED)
if (value_ != previous_value_ || when() & FL_WHEN_NOT_CHANGED) {
do_callback();
}
}
}
@ -125,5 +126,5 @@ int Fl_Valuator::format(char* buffer) {
}
//
// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.8 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.9 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.9 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.10 2004/07/27 16:02:21 easysw Exp $"
//
// Value input widget for the Fast Light Tool Kit (FLTK).
//
@ -41,12 +41,8 @@ void Fl_Value_Input::input_cb(Fl_Widget*, void* v) {
else nv = strtol(t.input.value(), 0, 0);
if (nv != t.value() || t.when() & FL_WHEN_NOT_CHANGED) {
t.set_value(nv);
if (t.when()) {
t.clear_changed();
t.do_callback();
} else {
t.set_changed();
}
t.set_changed();
if (t.when()) t.do_callback();
}
}
@ -131,5 +127,5 @@ Fl_Value_Input::Fl_Value_Input(int X, int Y, int W, int H, const char* l)
}
//
// End of "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.9 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Value_Input.cxx,v 1.6.2.5.2.10 2004/07/27 16:02:21 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: forms_timer.cxx,v 1.4.2.3.2.6 2004/04/11 04:39:00 easysw Exp $"
// "$Id: forms_timer.cxx,v 1.4.2.3.2.7 2004/07/27 16:02:21 easysw Exp $"
//
// Forms timer object for the Fast Light Tool Kit (FLTK).
//
@ -111,6 +111,7 @@ void Fl_Timer::step() {
redraw();
Fl::add_timeout(FL_TIMER_BLINKRATE, stepcb, this);
}
set_changed();
do_callback();
} else {
if (type() == FL_VALUE_TIMER) redraw();
@ -162,5 +163,5 @@ void Fl_Timer::suspended(char d) {
}
//
// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.6 2004/04/11 04:39:00 easysw Exp $".
// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.7 2004/07/27 16:02:21 easysw Exp $".
//