In accellerator (see my previous mod).
Changed callback parameter cast from a) void* to Button** to b) void* to
Widget**. Widget has LOTS of great new features in 2.x. Very nice. The
work-around in 1.x was quite involved at times.
-------------
TODO. This is my personal todo because I don't want to mess with the
base system too much until I have all the other stuff (including
schemes?) working.
Mouse clicks aren't right in X. The double click timeout is too short
(should be 400 ms +/- 100 ms) and the event loop isn't eating up button
release events the way the old one did. This is important, but I can't
remember where I noticed it.
Currently trying this, and it seems to help.
in run.cxx around line 1220 ------------
* /// rs-> testing.
/*
if (abs(e_x_root-px)+abs(e_y_root-py) > 3
|| event_time >= ptime+(push?1000:200))
*/
// Note: dbl-click timer = 400 ms, release/reset = 1 second.
// Hopefully I'm interpreting this correctly?? -rs
if (abs(e_x_root-px)+abs(e_y_root-py) > 3
|| event_time >= ptime+(push?400:1000))
// ... etc...
{
e_is_click = 0;
*
--------------
Code migration tools.
*NO WARRANTEES? You betcha. This is radical, but can save you time.
Keep backups.
*
Here's a script I used to get about 90 percent of the fix-ups in the
test folder done. I commented out the ones I created as I used them.
It's not a complete list but if you like to live dangerously, here you go.
I have not included the C code for 'replace-in-file'. If you don't know
how to write one yourself you probably shouldn't be messing with this.
Game? Change the long names first to avoid creating new strings you
need to modify.
Also.. The fnr code could be modified to create a translation table.
Also, also, this will NOT fix stuff like the bug in the adjuster demo
where similarly named widgets act very very differently.
I'm off to see what's up with the image demos, so you're on your own
with this.
-----------> doit.sh (It's a plain text file, so type 'sh doit.sh' to run)
## cd to the correct folder as/or if required.
# find and replace globally in the directory, requires
# a search and replace utility that will read ONE entire file
# copy the file with replaced text to a new buffer and write
# that new buffer out to the original filename. My utility is
# is replace-in-file <srchstr> <replacementstr> <filename>
# this is the bash function that does find/replace globally
fnr() # <srch> <replace>
{
srch=$1
repl=$2
for file in *
do
replace-in-file $srch $repl $file
done
}
#fnr fltk/compat/FL/Fl_Value_Slider.H fltk/ValueSlider.h
#fnr fl_line_style fltk::line_style
#fnr "fl_rect(" "fltk::strokerect("
#fnr fltk/fl_message.h fltk/ask.h
#fnr fl_message fltk::message
#fnr Fl_Window fltk::Window
### do NOT doit MenuItem MenuItem
#fnr Fl_Widget fltk::Widget
#fnr Fl_Box fltk::Box
#fnr Fl_Value_Slider fltk::ValueSlider
#fnr Fl_Choice fltk::Choice
#fnr Fl_Slider fltk::Slider
#fnr Fl_Browser fltk::Browser
#fnr Fl_Button fltk::Button
#fnr Fl_Return_Button fltk::ReturnButton
#fnr fl_input fltk::input
#fnr Fl::run fltk::run
##
#fnr Fl_Align_Group fltk::AlignGroup
#fnr Fl_Align fltk::Align
#fnr FL_ALIGN_TOP fltk::ALIGN_TOP
#fnr FL_ALIGN_BOTTOM fltk::ALIGN_BOTTOM
#fnr FL_ALIGN_LEFT fltk::ALIGN_LEFT
#fnr FL_ALIGN_RIGHT fltk::ALIGN_RIGHT
#fnr FL_ALIGN_TOP_LEFT "fltk::ALIGN_LEFT | fltk::ALIGN_TOP"
##
#fnr FL_NO_BOX fltk::NO_BOX
#fnr FL_DOWN_BOX fltk::DOWN_BOX
#fnr Fl_Callback fltk::Callback
## X stuff
#fnr fl_display fltk::xdisplay
#fnr fl_screen fltk::xscreen
#fnr fl_visual fltk::xvisual
#fnr Fl_Group fltk::Group
#fnr Fl_Button fltk::Button
#fnr Fl::args fltk::args
##
#fnr Fl::help fltk::help
#fnr fl_xpixel fltk::xpixel
#fnr fl_colormap fltk::xcolormap
#fnr fltk/fl_draw fltk/draw
#fnr fl_color fltk::color
#fnr FL_BLACK fltk::BLACK
##
#fnr 'FL_SOLID' 'fltk::SOLID'
#fnr 'FL_DASH' 'fltk::DASH'
#fnr 'FL_DOT' 'fltk::DOT'
#fnr 'FL_DASHDOT' 'fltk::DASHDOT'
#fnr 'FL_DASHDOTDOT' 'fltk::DASHDOTDOT'
##
#fnr FL_CAP_FLAT fltk::CAP_FLAT
#fnr FL_CAP_ROUND fltk::CAP_ROUND
#fnr FL_CAP_SQUARE fltk::CAP_SQUARE
#fnr FL_JOIN_MITER fltk::JOIN_MITER
#fnr FL_JOIN_ROUND fltk::JOIN_ROUND
#fnr FL_JOIN_BEVEL fltk::JOIN_BEVEL
##
#fnr fl_vertex fltk::addvertex
#fnr fl_begin_line strokepath
#fnr fl_end_line closepath
### fixups
#fnr fltk/compat/FL/fltk:: fltk/
#fnr fltk/fltk:: fltk/
#fnr Button.H Button.h
#fnr Group.H Group.h
#fnr Window.H Window.h
## risky but some "fltk::" stuff may need to be unquoted.
##fnr "\"fltk::" "\""
exit
## must be done manually. These apply also to descendents of these classes.
Valuators: bounds() => range()
Choice: menu() => item()
fl_rgb() in the context of a color(rgb(...)) MIGHT not be needed at all.
thus:
fltk::color(fl_rgb((uchar)(sliders[0]->value()),
(uchar)(sliders[1]->value()),
(uchar)(sliders[2]->value())));
becomes:
fltk::color((uchar)(sliders[0]->value()),
(uchar)(sliders[1]->value()),
(uchar)(sliders[2]->value()));
# not verified yet, now that I think of it.
Choice: mvalue()->argument() => item()->argument()
fl_file_chooser:
fltk::file_chooser
<fltk/file_chooser.h>
... etc.
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs