2008-09-13 19:55:32 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
\page migration_1_1 G - Migrating Code from FLTK 1.0 to 1.1
|
|
|
|
|
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
This appendix describes the differences between the FLTK
|
|
|
|
1.0.x and FLTK 1.1.x functions and classes.
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_color Color Values
|
|
|
|
|
|
|
|
Color values are now stored in a 32-bit unsigned integer
|
2008-09-13 19:55:32 +04:00
|
|
|
instead of the unsigned character in 1.0.x. This allows for the
|
|
|
|
specification of 24-bit RGB values or 8-bit FLTK color indices.
|
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
<tt>FL_BLACK</tt> and <tt>FL_WHITE</tt> now remain black and
|
2008-09-13 19:55:32 +04:00
|
|
|
white, even if the base color of the gray ramp is changed using
|
2008-10-11 16:46:11 +04:00
|
|
|
<A HREF="Fl.html#Fl.background"><tt>Fl::background()</tt></A>.
|
|
|
|
<tt>FL_DARK3</tt> and <tt>FL_LIGHT3</tt> can be used instead to
|
|
|
|
draw a very dark or a very bright background hue.
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
Widgets use the new color symbols <tt>FL_FORGROUND_COLOR</tt>,
|
|
|
|
<tt>FL_BACKGROUND_COLOR</tt>, <tt>FL_BACKGROUND2_COLOR</tt>,
|
|
|
|
<tt>FL_INACTIVE_COLOR</tt>, and <tt>FL_SELECTION_COLOR</tt>.
|
2008-09-13 19:55:32 +04:00
|
|
|
More details can be found in the chapter
|
2008-10-11 16:46:11 +04:00
|
|
|
<A HREF="enumerations.html#colors">Enumerations</A>.
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_cutnpaste Cut and Paste Support
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
The FLTK clipboard is now broken into two parts - a local
|
2008-09-13 19:55:32 +04:00
|
|
|
selection value and a cut-and-paste value. This allows FLTK to
|
|
|
|
support things like highlighting and replacing text that was
|
|
|
|
previously cut or copied, which makes FLTK applications behave
|
|
|
|
like traditional GUI applications.
|
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_file_chooser File Chooser
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
The file chooser in FLTK 1.1.x is significantly different
|
2008-09-13 19:55:32 +04:00
|
|
|
than the one supplied with FLTK 1.0.x. Any code that directly
|
2008-10-11 16:46:11 +04:00
|
|
|
references the old <tt>FCB</tt> class or members will need
|
|
|
|
to be ported to the new
|
|
|
|
<A HREF="Fl_File_Chooser.html"><tt>Fl_File_Chooser</tt></A>
|
|
|
|
class.
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_functions Function Names
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
Some function names have changed from FLTK 1.0.x to 1.1.x in
|
2008-09-13 19:55:32 +04:00
|
|
|
order to avoid name space collisions. You can still use the old
|
2008-10-11 16:46:11 +04:00
|
|
|
function names by defining the <tt>FLTK_1_0_COMPAT</tt>
|
2008-09-13 19:55:32 +04:00
|
|
|
symbol on the command-line when you compile
|
2008-10-11 16:46:11 +04:00
|
|
|
(<tt>-DFLTK_1_0_COMPAT</tt>) or in your source, e.g.:
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-09-18 01:13:03 +04:00
|
|
|
\code
|
2008-09-13 19:55:32 +04:00
|
|
|
#define FLTK_1_0_COMPAT
|
2008-09-18 01:13:03 +04:00
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Enumerations.H>
|
|
|
|
#include <FL/filename.H>
|
|
|
|
\endcode
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
The following table shows the old and new function names:
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
<CENTER>
|
|
|
|
<TABLE WIDTH="80%" BORDER="1">
|
2008-09-13 19:55:32 +04:00
|
|
|
<TR>
|
|
|
|
<TH>Old 1.0.x Name</TH>
|
|
|
|
<TH>New 1.1.x Name</TH>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>contrast()</TD>
|
|
|
|
<TD>fl_contrast()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>down()</TD>
|
|
|
|
<TD>fl_down()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_absolute()</TD>
|
|
|
|
<TD>fl_filename_absolute()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_expand()</TD>
|
|
|
|
<TD>fl_filename_expand()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_ext()</TD>
|
|
|
|
<TD>fl_filename_ext()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_isdir()</TD>
|
|
|
|
<TD>fl_filename_isdir()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_list()</TD>
|
|
|
|
<TD>fl_filename_list()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_match()</TD>
|
|
|
|
<TD>fl_filename_match()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_name()</TD>
|
|
|
|
<TD>fl_filename_name()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_relative()</TD>
|
|
|
|
<TD>fl_filename_relative()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>filename_setext()</TD>
|
|
|
|
<TD>fl_filename_setext()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>frame()</TD>
|
|
|
|
<TD>fl_frame()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>inactive()</TD>
|
|
|
|
<TD>fl_inactive()</TD>
|
|
|
|
</TR>
|
|
|
|
<TR>
|
|
|
|
<TD>numericsort()</TD>
|
|
|
|
<TD>fl_numericsort()</TD>
|
|
|
|
</TR>
|
2008-10-11 16:46:11 +04:00
|
|
|
</TABLE>
|
|
|
|
</CENTER>
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_images Image Support
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
Image support in FLTK has been significantly revamped in
|
|
|
|
1.1.x. The <A HREF="Fl_Image.html"><tt>Fl_Image</tt></A> class
|
2008-09-13 19:55:32 +04:00
|
|
|
is now a proper base class, with the core image drawing
|
2008-10-11 16:46:11 +04:00
|
|
|
functionality in the
|
|
|
|
<A HREF="Fl_Bitmap.html"><tt>Fl_Bitmap</tt></A>,
|
|
|
|
<A HREF="Fl_Pixmap.html"><tt>Fl_Pixmap</tt></A>,
|
|
|
|
and
|
|
|
|
<A HREF="Fl_RGB_Image.html"><tt>Fl_RGB_Image</tt></A>
|
|
|
|
classes.
|
|
|
|
|
|
|
|
BMP, GIF, JPEG, PNG, XBM, and XPM image files can now be
|
|
|
|
loaded using the appropriate image classes, and the
|
|
|
|
<A HREF="Fl_Shared_Image.html"><tt>Fl_Shared_Image</tt></A>
|
|
|
|
class can be used to cache images in memory.
|
|
|
|
|
|
|
|
Image labels are no longer provided as an add-on label type.
|
|
|
|
If you use the old <tt>label()</tt> methods on an image, the
|
|
|
|
widget's <tt>image()</tt> method is called to set the image
|
2008-09-13 19:55:32 +04:00
|
|
|
as the label.
|
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
Image labels in menu items must still use the old labeltype
|
2008-09-13 19:55:32 +04:00
|
|
|
mechanism to preserve source compatibility.
|
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
\section migration_1_1_keyboard Keyboard Navigation
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-10-11 16:46:11 +04:00
|
|
|
FLTK 1.1.x now supports keyboard navigation and control with
|
2008-09-13 19:55:32 +04:00
|
|
|
all widgets. To restore the old FLTK 1.0.x behavior so that only
|
2008-10-11 16:46:11 +04:00
|
|
|
text widgets get keyboard focus, call the
|
|
|
|
<A HREF="Fl.html#Fl.visible_focus"><CODE>Fl::visible_focus()</CODE></A>
|
2008-09-13 19:55:32 +04:00
|
|
|
method to disable it:
|
|
|
|
|
2008-09-18 01:13:03 +04:00
|
|
|
\code
|
2008-09-13 19:55:32 +04:00
|
|
|
Fl::visible_focus(0);
|
2008-09-18 01:13:03 +04:00
|
|
|
\endcode
|
2008-09-13 19:55:32 +04:00
|
|
|
|
2008-09-29 03:24:36 +04:00
|
|
|
<hr>
|
|
|
|
<a class="el" href="index.html">[Index]</a>
|
|
|
|
<a class="el" href="osissues.html">[Previous]</a>
|
|
|
|
\ref osissues
|
|
|
|
<a class="el" href="migration_1_3.html">[Next]</a>
|
|
|
|
\ref migration_1_3
|
|
|
|
|
2008-09-13 19:55:32 +04:00
|
|
|
*/
|