source: rtems-graphics-toolkit/fltk-1.1.10/documentation/migration.html @ 513eea1

Last change on this file since 513eea1 was 513eea1, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/10 at 22:43:24

2010-01-08 Joel Sherrill <joel.sherrill@…>

fltk 1.1.10. imported

  • ORIGIN: Updated.
  • Property mode set to 100644
File size: 4.4 KB
Line 
1<HTML>
2<HEAD>
3        <TITLE>G - Migrating Code from FLTK 1.0.x</TITLE>
4</HEAD>
5<BODY>
6
7<H1 ALIGN="RIGHT"><A NAME="migration">G - Migrating Code from FLTK 1.0.x</A></H1>
8
9<P>This appendix describes the differences between the FLTK
101.0.x and FLTK 1.1.x functions and classes.</P>
11
12<H2>Color Values</H2>
13
14<P>Color values are now stored in a 32-bit unsigned integer
15instead of the unsigned character in 1.0.x. This allows for the
16specification of 24-bit RGB values or 8-bit FLTK color indices.
17
18<P><TT>FL_BLACK</TT> and <TT>FL_WHITE</TT> now remain black and
19white, even if the base color of the gray ramp is changed using
20<A HREF="Fl.html#Fl.background"><TT>Fl::background()</TT></A>.
21<TT>FL_DARK3</TT> and <TT>FL_LIGHT3</TT> can be used instead to
22draw a very dark or a very bright background hue.</P>
23
24<P>Widgets use the new color symbols <TT>FL_FORGROUND_COLOR</TT>,
25<TT>FL_BACKGROUND_COLOR</TT>, <TT>FL_BACKGROUND2_COLOR</TT>,
26<TT>FL_INACTIVE_COLOR</TT>, and <TT>FL_SELECTION_COLOR</TT>.
27More details can be found in the chapter
28<A HREF="enumerations.html#colors">Enumerations</A>.</P>
29
30<H2>Cut and Paste Support</H2>
31
32<P>The FLTK clipboard is now broken into two parts - a local
33selection value and a cut-and-paste value. This allows FLTK to
34support things like highlighting and replacing text that was
35previously cut or copied, which makes FLTK applications behave
36like traditional GUI applications.
37
38<H2>File Chooser</H2>
39
40<P>The file chooser in FLTK 1.1.x is significantly different
41than the one supplied with FLTK 1.0.x. Any code that directly
42references the old <TT>FCB</TT> class or members will need
43to be ported to the new <A
44HREF="Fl_File_Chooser.html"><TT>Fl_File_Chooser</TT></A>
45class.</P>
46
47<H2>Function Names</H2>
48
49<P>Some function names have changed from FLTK 1.0.x to 1.1.x in
50order to avoid name space collisions. You can still use the old
51function names by defining the <CODE>FLTK_1_0_COMPAT</CODE>
52symbol on the command-line when you compile
53(<CODE>-DFLTK_1_0_COMPAT</CODE>) or in your source, e.g.:
54
55<UL><PRE>
56#define FLTK_1_0_COMPAT
57#include &lt;FL/Fl.H&gt;
58#include &lt;FL/Enumerations.H&gt;
59#include &lt;FL/filename.H&gt;
60</PRE></UL>
61
62<P>The following table shows the old and new function names:</P>
63
64<CENTER><TABLE WIDTH="80%" BORDER="1">
65<TR>
66        <TH>Old 1.0.x Name</TH>
67        <TH>New 1.1.x Name</TH>
68</TR>
69<TR>
70        <TD>contrast()</TD>
71        <TD>fl_contrast()</TD>
72</TR>
73<TR>
74        <TD>down()</TD>
75        <TD>fl_down()</TD>
76</TR>
77<TR>
78        <TD>filename_absolute()</TD>
79        <TD>fl_filename_absolute()</TD>
80</TR>
81<TR>
82        <TD>filename_expand()</TD>
83        <TD>fl_filename_expand()</TD>
84</TR>
85<TR>
86        <TD>filename_ext()</TD>
87        <TD>fl_filename_ext()</TD>
88</TR>
89<TR>
90        <TD>filename_isdir()</TD>
91        <TD>fl_filename_isdir()</TD>
92</TR>
93<TR>
94        <TD>filename_list()</TD>
95        <TD>fl_filename_list()</TD>
96</TR>
97<TR>
98        <TD>filename_match()</TD>
99        <TD>fl_filename_match()</TD>
100</TR>
101<TR>
102        <TD>filename_name()</TD>
103        <TD>fl_filename_name()</TD>
104</TR>
105<TR>
106        <TD>filename_relative()</TD>
107        <TD>fl_filename_relative()</TD>
108</TR>
109<TR>
110        <TD>filename_setext()</TD>
111        <TD>fl_filename_setext()</TD>
112</TR>
113<TR>
114        <TD>frame()</TD>
115        <TD>fl_frame()</TD>
116</TR>
117<TR>
118        <TD>inactive()</TD>
119        <TD>fl_inactive()</TD>
120</TR>
121<TR>
122        <TD>numericsort()</TD>
123        <TD>fl_numericsort()</TD>
124</TR>
125</TABLE></CENTER>
126
127<H2>Image Support</H2>
128
129<P>Image support in FLTK has been significantly revamped in
1301.1.x. The <A HREF="Fl_Image.html"><TT>Fl_Image</TT></A> class
131is now a proper base class, with the core image drawing
132functionality in the <A
133HREF="Fl_Bitmap.html"><TT>Fl_Bitmap</TT></A>, <A
134HREF="Fl_Pixmap.html"><TT>Fl_Pixmap</TT></A>, and <A
135HREF="Fl_RGB_Image.html"><TT>Fl_RGB_Image</TT></A> classes.
136
137<P>BMP, GIF, JPEG, PNG, XBM, and XPM image files can now be
138loaded using the appropriate image classes, and the <A
139HREF="Fl_Shared_Image.html"><TT>Fl_Shared_Image</TT></A> class
140can be used to cache images in memory.
141
142<P>Image labels are no longer provided as an add-on label type.
143If you use the old <TT>label()</TT> methods on an image, the
144widget's <TT>image()</TT> method is called to set the image
145as the label.
146
147<P>Image labels in menu items must still use the old labeltype
148mechanism to preserve source compatibility.
149
150<H2>Keyboard Navigation</H2>
151
152<P>FLTK 1.1.x now supports keyboard navigation and control with
153all widgets. To restore the old FLTK 1.0.x behavior so that only
154text widgets get keyboard focus, call the <A
155HREF="Fl.html#Fl.visible_focus"><CODE>Fl::visible_focus()</CODE></A>
156method to disable it:
157
158<UL><PRE>
159Fl::visible_focus(0);
160</PRE></UL>
161
162</BODY>
163</HTML>
Note: See TracBrowser for help on using the repository browser.