You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
4.3KB

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