- Remove find_library(LIB_GLEW ...) from 'resources.cmake'
- Use the variable FLTK_GLEW_DIR to "find" a user supplied GLEW library
for OpenGL3 example programs (examples/OpenGL3*.cxx).
Both static and shared libs (DLLs) are supported, but the static
library is preferred to avoid DLL dependencies.
- Define preprocessor macro 'GLEW_STATIC' by CMake compile definitions
if and only if the static glew library (glew32s) was found and linked.
The previous code defined 'GLEW_STATIC' unconditionally in the source
code which led to undefined references if a shared lib (DLL) was used.
Also: set build requirement of OpenGL3 tests to C++11 to enable
building in C++98 mode (if the compiler allows C++11).
Note: this may be removed in 1.5.0 when FLTK requires C++11 anyway.
This is a big commit and there are too many changes to list them all.
The main changes are:
- rename all CMake build options to 'FLTK_*'
- export library targets with namespace (prefix) 'fltk::'
- standardize shared library target names with suffix '-shared'
- set public build properties on libraries for consumers
- document library names and aliases in README.CMake.txt
- document changes in "Migrating Code from FLTK 1.3 to 1.4"
- partial backwards compatibility for old user projects
Included but not directly related changes:
- fix Windows (Visual Studio) DLL build
- add CMake function fl_debug_target() to show target properties
- don't build test programs if FLTK is a subproject
- internal: reformat CMake code: remove space before '('
Thanks to Matthias and Manolo for their help, testing, and feeback.
examples/howto-remap-numpad-keyboard-keys.cxx:
Substitute Fl::event_key() as well which is required for some input
widgets - maybe only on some platforms (seemed to work on X11 but
not on Wayland).
Also: fix typos and whitespace.
This addresses some issues pointed out by GitHub Issue #875.
Documentation lacked details about Fl_Multi_Label assignment and
correct memory handling.
The new methods
- Fl_Menu_Item::image_label(const Fl_Image *) and
- Fl_Menu_Item::multi_label(const Fl_Multi_Label *)
provide a cleaner interface to assign images and Fl_Multi_Label's
to menu items.
examples/howto-menu-with-images.cxx: carify some issues, fix leak,
and use new Fl_Menu_Item::multi_label(const Fl_Multi_Label *).
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8
This new function closes the gap that previously only Visual Studio
applications converted their commandlines to UTF-8.
Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
selected functions and methods
Experimental, may be removed before release:
- use either Fl_Int_Vector or std::vector in Fl_Table depending
on CMake OPTION_USE_STD or configure --enable-use_std
Move all fl_filename* functions that use Fl_String to fluid
Main changes in fluid:
- add fluid_filename.h and .cxx
- include "fluid_filename.h" rather than <FL/filename.H>
Update fl_input(), fl_password() and test/ask
- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
std::string if enabled (FLTK_USE_STD)
- FL/Fl_Grid.H: header file
- src/Fl_Grid.cxx: implementation
- examples/grid-simple.cxx: simple example program
- test/cube.cxx: use Fl_Grid for layout
- test/grid_alignment.cxx: test cell alignment and other functions
- test/grid_buttons.cxx: demo program as discussed in fltk.general
- test/grid_login.cxx: like test/flex_login.cxx but with Fl_Grid
- test/flex_login.cxx: modified to match test/grid_login.cxx
- add Fl_Scheme_Choice widget for quick scheme selection
- fix label alignment of selection box
- set selection_color()
- set selectbox()
- make the tree the resizable() of the window
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
Change some method names to comply with FLTK style as discussed
in fltk.coredev, thread "Fl_Flex method name question".
* Rename Fl_Flex::margins(...) to Fl_Flex::margin(...)
(use singular form for all margin related methods)
* Remove Fl_Flex::setSize() and isSetSize() "backwards compatibility" methods
* Rename Fl_Flex::set_size(...) to fixed(...)
Note: the latter affects existing (pre-release) fluid (.fl) files: you may
want to edit and replace "set_size_tuples" with "fixed_size_tuples"
As reported in fltk.coredev in thread
"CMAKE build with build examples. On and test OFF fails"
$ cmake .. -D FLTK_BUILD_EXAMPLES=ON -D FLTK_BUILD_TEST=OFF
failed with: Unknown CMake command "FLTK_RUN_FLUID".
The code failed with 2 or more widgets when FLTK would trigger
partial redraws of the widgets, unless the Fl_Gl_Window was FL_DAMAGE_ALL.
This commit also adds a second FLTK widget to example/OpenGL3test to
check this multiple widget situation, and fixes an error where operator ! was used
instead of ~ .
This commit allows to switch between FL_DOUBLE / FL_SINGLE modes
in widget-containing GL3 windows.
Demo program examples/OpenGL3test is modified to show FLTK widgets
even if the platform does not support OpenGL 3.
Under non-macOS platforms, the key is to call glUseProgram(0); after having used OpenGL 3
which allows to then use OpenGL 1 and draw FLTK widgets over the OpenGL3 scene.
Under macOS, this is impossible because macOS GL3 contexts are not compatible
with GL1. The solution implemented here is to create an additional Fl_Gl_Window
placed above and sized as the GL3-based window, to give it a non opaque,
GL1-based context, and to put the FLTK widgets in that additional window.
Elaborated on Fl_Cairo_Window's use of FLTK style coordinates,
and how this differs from cairo's default native normalized
coordinate system, and shows how to switch from one to the other.
Also, small comment fix to the cairo example regarding the "X" color.
Albrecht submitted this in issue 358.
Tested the variations:
cmake .. -- examples and cairo off
cmake -D FLTK_BUILD_EXAMPLES=on -- examples on, cairo off
cmake -D FLTK_BUILD_EXAMPLES=on -D OPTION_CAIRO=on .. -- examples on, cairo on
When examples are 'on', they build into the bin/examples directory.
Since this is the first cairo example in the examples directory,
it necessarily involved changes to the Makefile and to fltk-config
to properly handle the absence/existance of the cairo libs.
TBD: Add docs to the cario widget describing coordinate system
and how it differs from the default cairo normalized coordinate system.