With modern CMake libcairo doesn't need to linked explicitly in the
test/cairo_test.cxx demo program. Either '-lcairo' is implied by
linking with fltk::fltk or it is not used at all.
This fixes a linker warning on macOS:
"ld: warning: ignoring duplicate libraries ..."
Works now much better with old C99 and C++98 standard compilers.
Fixed: C++ comments in C files and headers included by C files.
There are still some warnings with C90 though but these would be
hard to fix and left as-is for now.
test/fractals.cxx: some arrays were too small by 1, or the compiler
warned at least (false positive?). Anyway, it's fixed now.
This involved enlarging the unittest main window to make room
for the additional test.
Adding this test revealed a problem in Fl_Terminal's global
scrollbar size handling, which is fixed here as well.
Also fixed a small issue in the demo's debugging terminal
with the horiz scrollbar.
(1) Ensure that the terminal widgets doesn't use keyboard events.
Advantage: keyboard navigation and selection doesn't interfere
with the display.
Drawback: Contents of the terminal can no longer be copied.
This will be addressed in a later update.
(2) Thanks to Manolo for his addition of the "GUI scaling" button.
Although GUI scaling can be useful, it can also be annoying while
testing shortcuts.
(3) Changed all light buttons to check buttons.
Esc is intentionally consumed by the test program (see comment) but
other keystrokes (shortcuts) must pass to allow zooming with ctrl/+/-/0.
The old code filtered all shortcuts which turned out to be wrong.
Not being able to zoom was caused by a previous commit that lowered
the priority of the zoom key handler - which alone was not wrong.
The macOS Window menu is connected to the item array of the macOS menubar
via FL_SUBMENU_POINTER. This facilitates memorization of pointers
to items of the macOS menubar because the item array no longer changes
each time a window opens of gets closed.
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.
Keyboard behavior for button types was not consistent with mouse
click behavior. This change avoids callbacks when pressed radio buttons
are pressed again.
This library is no longer needed in FLTK itself. There is only one
demo program (test/forms.cxx) that uses it if it is built. The demo
program displays a message if fltk_forms is not available.
The default is 'enabled' for backwards compatibility but this may
be changed to 'disabled' in a future version.
- 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).