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).
- some documentation missing
- Fl_Tile::resize() not satisfying yet
- minimums work, maximums currently ignored
- 0 size children may make program hang
New public methods:
void clear(void);
void clear(Fl_Color val);
old protected methods made public:
void clear_screen(bool scroll_to_hist=true); // ESC [ 2 J
void clear_screen_home(bool scroll_to_hist=true); // ESC [ H ESC [ 2 J
void cursor_home(void); // ESC [ 0 H
test/terminal modified to test these, and added separate tests
for both the API and ANSI code ways to do these ops.
textcolor() needed for consistency, color() behavior documented.
Both added to the test/terminal app.
Elaborated on the special background "see through" color value + behavior,
tested with color() in test/terminal app.
Define GLDEMO_LIBS and GLDEMO_SHARED: these definitions can be used
to build OpenGL demo programs that can also be built w/o OpenGL
Examples: fullscreen, handle_events, unittests
- 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_Grid: force layout() on resize() - needed for GL subwindows
- test/cube.cxx:
- use end() in constructor of class cube_box
- ensure not to change the current group when adding a button
- 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
- remove static variables and functions
- make move_intersection() virtual
- add (protected) cursor access methods
These changes were inspired by STR 2791 where the user proposing an
enhancement was not able to subclass Fl_Tile properly. This commit
fixes the mentioned issues and enables subclassing without copying
internal code.
... "when there's no current window".
Silently ignore GLUT function calls that need a current window if the
current window is NULL, return 0 from functions that return an 'int'.
Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers().
This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise.
Note: the chosen implementation to ignore GLUT calls silently appears
to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error
messages and exit. The latter could be implemented as well but would
be much more work.
The user can add an arbitrary number of highly configurable
shell commands through the setting panel. The commands can
be saved as user preferences, inside the .fl file, or exported
to an external file. Shell scripts can be limited to individual
platforms, can have shortcut keys, etc. .
* documentation will follow
* support to call `fltk-config` will follow
This code was (and is still) commented out but it *would* trigger
a "stack buffer overflow" error *if* uncommented.
The new code demonstrates how a binary object (Fl_Preferences 'bed')
can be dumped to a preferences file in binary format (if activated).
Todo: fluid-shared can't (yet) be built agains the shared fltk lib
because of some linker errors. Needs investigation.
Note: fluid-shared is basically a test program to demonstrate linking
against the shared FLTK libs but doesn't work yet using VS (MSVC).
This is no problem for the functionality.
fl_filename_absolute can no generate a path using arbitrary source paths.
Fl_Menu_ adds find_item_with_user_data and find_item_with_argument
Fl_String adds find(string, start)
See fltk.general, thread "Is handling simultaneous Left-click and
Right-click drags supported?" from Jul 12, 2023
Status: FL_DRAG operation is terminated when one mouse button is
released, even if more than one button is actually down. Subsequent
mouse movement is reported as FL_MOVE rather than FL_DRAG, this is
under investigation.
* interactive layout alignment rewritten
* interface for new alignment rules
* new alignment dialog box
* user defined layout rules added
* layout rules can be stored in projects, settings, and external files
* Valgrind verification
Flushing the Cairo context is necessary on Windows to make Cairo
drawings appear on the device (screen). This new method makes it easy
for user code to do this correctly after using Cairo drawings.
- add Fl::cairo_flush(cairo_t *)
- document Fl::cairo_flush(cairo_t *)
- reformat Cairo doxygen docs and code (partially)
- use the new method in Fl_Cairo_Window
- use the new method in test/cairo_test.cxx
- other minor (text) changes in test/cairo_test.cxx
- add test/cairo_test to the demo menu (test/demo.menu)
On the Windows platform Cairo drawings must be flushed explicitly.
This is done in Fl_Cairo_Window after calling the draw callback but
it was neither done nor documented in test/cairo_test.cxx when using
another type of Window with its overloaded draw() method, i.e. when
FLTK was configured with --enable-cairoext or CMake OPTION_CAIROEXT.
Note: user code must either explicitly flush the Cairo drawings as
done here or destroy the Cairo context which is not done in this demo
because the Cairo context should be kept alive.
- remove separate libfltk_cairo to avoid cyclic dependencies, but
- keep a dummy libfltk_cairo in 1.4.0 for backwards compatibility
- move cairo/Fl_Cairo.cxx to src/Fl_Cairo.cxx
- add preliminary Cairo support for Visual Studio (MSVC)
Static linking is not affected by this change, but users building
with hand-made Makefiles will have to remove libfltk_cairo starting
with FLTK 1.4.0. The dummy library can be linked for backwards
compatibility but it will be removed later (in 1.4.x or 1.5.0).
The shared FLTK library libfltk.{so|dylib|dll|..} depends on libcairo
if and only if FLTK is built with one of the Cairo options. This has
always been the case for OPTION_CAIROEXT but is now also true if only
OPTION_CAIRO is selected, i.e. FLTK programs linked with a Cairo
enabled shared FLTK library will also be linked with libcairo. The same
is true for configure options --enable-cairo and --enable-cairoext,
respectively.
Preliminary Cairo support for MSVC now detects a Cairo installation
using the CMake variable FLTK_CAIRO_DIR which must be set by the user.
Note that this feature is temporary and may be changed in the future
for a better and more comfortable version.
- add true unittest and Fl_String testing
- interface and printout are similar to gtest
without requiring external linkage.
just run `unittest --core`.
- new Fl_String API
- extended API to fl_input_str and fl_password_str
- co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
Removing all globals in file writer (#653 )
Fix some static analyser complaints
Valgrind: handle width==0 in GfxDrivers on Wayland and X11
Don't use `Fl_Input_::static_value`, it accesses previous
buffer that may be deleted
Project file write encapsulated, removing globals
Encapsulating project file reader, removing states in glbals
Project i/o increased source code readability
Although the memory "leak" is not really an issue in this demo
program (memory is returned anyway), "fixing" the leak warning
issued by valgrind and address sanitizer demonstrates the new
feature to "bind" images.
Detected by valgrind :
==16102== Conditional jump or move depends on uninitialised value(s)
==16102== at 0x449A10: Drawing_Area::idle() (mandelbrot.cxx:143)
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.
Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.
Todo:
- add features to add new schemes during runtime (partially done)
- update status when the scheme is changed by Fl::scheme("...")