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("...")
Add close buttons for Fl_Tabs
Introducing callback reasons
FLUID shows all FL_WHEN_... options
Adding Fl_Tabs overflow types
Improved test/tabs to show new features
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()
- Add internal fl_contrast_cielab() as the new default.
- Keep old function as internal fl_contrast_legacy().
- Add fl_contrast_mode() to switch between fl_contrast() functions.
- Add fl_contrast_level() to fine tune fl_contrast() per mode.
- Add option to register and use a custom contrast function.
- Add test/contrast.cxx test program.
- Move all fl_contrast() related code to a new file src/fl_contrast.cxx.
- Add fl_lightness() convenience function for perceived lightness.
- Add fl_luminance() convenience function for physical luminance.
- replace enum value 'FRAMES' with 'const unsigned int frames'
- replace enum value 'DIM' with 'const unsigned int dim'
- remove commented statements that have never been used.
Note: this also changes uppercase enum values to lowercase constants.
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"
This test helps check for issues with multiline widgets
drawing text properly.
The README-unittests.txt was added to help developers
add new unit tests easily.
Many thanks to @darealshinji for contributing all the code
for this new FLTK image class (see branch Fl_ICO_Image of https://github.com/darealshinji/fltk).
Add an invisible box as resizable() to 'demogrp' to avoid bad resizing
behavior while the debug terminal is enabled. The old version would
disable some buttons including the 'exit' button if the window was
resized to a smaller size.
Simplify the popup menu (remove strcmp()).
Support different margin sizes on all four edges. Default margin
and gap size is now 0 (compatible with Fl_Pack).
Doxygen: move the description from the constructor to the class
declaration which constitutes a "description".
Make some methods virtual and/or 'const'.
Clarify demo programs, make them even more "FLTK style".
This work is based on the repository and latest commit:
https://github.com/osen/FL_Flex.git
commit 36e4ed75a00daac825b87e81295818b4650991f5
Author: Karsten Pedersen <...>
Date: Fri Apr 23 12:06:16 2021 +0000
Added Fltk (LGPL) license.
This widget is similar to Fl_Pack and supports either one row or one
column of widgets but has some more features. Test and demo programs
are included:
test/flex_login.cxx: simple "login window" demo program
test/flex_demo.cxx: slightly more complex demo program
The original demo programs can still be compiled and built with
the new widget provided you '#include <FL/Fl_Flex.H>'.
Backwards compatible methods are included (except debug()).
The original widget has been modified to match FLTK standards and
enhanced in several ways, including:
- support box frames
- add HORIZONTAL and VERTICAL enum values (as in Fl_Pack)
- add horizontal() method (as in Fl_Pack)
- use type() rather than internal 'direction' variable
- add standard widget constructor (x, y, w, h, label)
- add margin and gap accessors rather than hard coding constants
- improve test and demo programs
- add documentation
- replace <vector> with array as required by FLTK CMP
- rename camelCase method names, keeping old names for compatibility:
- change 'setSize(Fl_Widget*, int)' to 'set_size(Fl_Widget*, int)'
- change 'bool isSetSize(Fl_Widget*)' to 'int set_size(Fl_Widget*)'
- remove debug() method
- add a way to "unset" fixed size: set_size(Fl_Widget *, 0)
- add layout() method to force recalculation of children
- unify resizeRow() and resizeCol() methods to avoid code duplication
- improve widget size calculation.
- set variables UNITTEST_LIBS and UNITTEST_LIBS_SHARED appropriately
- use these variables in build instructions
This includes normal and shared builds with and w/o OpenGL.
Note that this fix includes "../src/flstring.h" which makes the source
file no longer compileable without the full source code, e.g. by
using "fltk-config --compile ...". This might be fixed later. (?)
* Fix build system for unites,
* Updated unittest to check OpenGL drawing.
Making sure that OpenGL drawing is exactly the same
as native drawing to make FLTK widget rendering
look the same in GL windows.
* Make OpenGL optional.
* Implemented clipping in OpenGL
* unites drawing fast shapes
* Fixed CMake
* Updating unittest.
Added tests for fl_pi and fl_arc (int)
Renamed tab to render complex shapes.
* Improved OpenGL FLTK drawing emulation.
* Fixed GTK ROUND DOWN BOX
* Fixing Makefile for unittest
* Correctly aligning OpenGL text.
* Fixed text alignment in GL windows.
Explained the "FLTK over GL " example in Cube.
* Overlapping test.
* Better GL graphics alignment.
* Drawing the focus rect.
* Adding Alpha Channel support for GL.
* Added FLTK-on-GL documentation.
* Added filename function to Fl_Preferences
Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.
* ERROR is a macro on Windows, don't use it
* Added Fl_Preferences::dirty().
User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.
* Fl_Preferences::get binary data returns # of bytes read.
* Verified group deletion code
* Fl_Preferences ignores locale.
This will make .prefs files interchangeable
between different computers.
* Updating the Preferences Mode to ignore locale.
* Fixes in docs.
... as discussed in fltk.coredev in thread "RFC: introduce public
config header <FL/fl_config.h>", see:
https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ
- Rename abi-version.h to fl_config.h, rename input files,
update dependencies, .gitignore, CMake, configure and Makefiles.
- Include Cairo options in FL/fl_config.h
- Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency.
- Include <FL/fl_config.h> in config.h and wherever necessary,
fix include order (move FL/Fl.H to the top) and more.
- Move USE_X11 to fl_config.h and rename to FLTK_USE_X11
- Do not include <config.h> in Cairo demo program which is no
longer required in Cairo programs since FLTK 1.4.0
In Fluid, selecting a menu button, and selecting it again to make it
movable would also grab the text input focus, which would prevent
the enclosing window from using arrow key events to manipulate
the selected widget.
Add coordinates and layout section to user manual
add section to user manual to clarify the use of window-relative
coordinates in both Fl_Group and Fl_Window containers, and include
brief descriptions of current layout manager widgets in one place.
add test/coordinates.cxx, test/wizard.cxx and related screenshots
under documentation/src.
update CMakeLists.txt, Makefile and .gitignore for new files.
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
The previous name existed already with different case (fl_string.h)
in the FL folder which broke the build on macOS and Windows.
This may be a temporary fix - until I find a better way.
Adding only 2 of 3 new examples is intentional (9 per menu level).
Figure numbers have been removed in all the HTML docs recently for
better maintainability.
add example(s) showing Albrecht's innovative overlap resizable
technique to the "How does resizing work?" documentation and tests
See "resizable question" original discussion thread under:
https://www.fltk.org/newsgroups.php?gfltk.general+v:39635
The intention is to make it more convenient for developers to add
one or more test programs for their tests by editing only one
variable (extra_tests).
I compiled with `-Wextra-semi -Werror=extra-semi` on Linux and Windows
(cross-compiled on Linux) and removed all "extra semicolon" warnings
I could find. I didn't check on macOS (yet).
Note: Linux configured with and w/o Pango but not w/o Xft. Compilation
with other options (e.g. Cairo) might still emit such warnings.
- add missing dependencies to build the shared libfltk_cairo(.dylib)
- remove incorrect dependency on cairo from libfltk
- add cairo_test-shared demo (linked with shared libs)
Fl::event_key() display needs to be converted to UTF-8 for keycodes
outside the ASCII range (0xa0 - 0xff). Such keycodes can be found
on international keyboards.
Format code according to the CMP, add instructions on how to copy
the code to the fluid tutorial, and update the tutorial with the
current code of test/CubeView.h and test/CubeView.cxx.
macOS Big Sur 11.3 introduced a new "security feature" such that
app bundles created from existing bundle templates in downloaded
files (tar distibutions, expanded) could no longer be executed
without unsetting the "quarantine" attribute. This commit fixes
this by creating all bundles from scratch.
Known *workaround* for older tarballs and snapshots:
$ xattr -d -r com.apple.quarantine xxx.app
There's no need to blow up the source file by including the bitmap
file literally in the source code. Use '#include' instead.
Another benefit is that the original source file is referenced in
the source code so it is not accidentally removed.
Since FL/platform.H defines USE_X11 for the X11 platform, it's better to target
the X11 platform by
#include <FL/platform.H>
#if USE_X11
rather than by
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
that would have to grow with future platforms.
- add DOCTYPE, <head> and <body> statements
- make the file more standards conformant
- update OL tests, add nested OL/UL test
- add 'alt' tags to image refs
Note: the 'NAME' tag is obsolete and should be replaced with 'ID'
but Fl_Help_View does not parse 'ID' tags (yet).
- rewrite to use pkg-config with both autoconf + CMake
- remove hardcoded library names
- fix build dependencies and search directories
- remove or replace old and unused variables
- update README files
To be done:
- implement fallback for autoconf/configure if pkg-config is missing
- fix pango build (uses cairo internally)
Output was incorrect, partly to stdout and stderr, resp.
As Manolo noted in fltk.general, Fl_Window::screen_num() is the
correct API to retrieve the screen number of a window rather than
Fl::screen_num(...).
This is intended to be used as
(a) an example of event handling and
(b) a test program to visualize many event related variables
This first version is compatible with FLTK 1.3.x but lacks the screen
scaling factor under 1.3.x (which is always assumed to be 100%).
Note: this does not reflect any system or monitor related settings.
Based on Greg's mods in 'cube-v5a-patch.txt' in this issue #157 comment:
https://github.com/fltk/fltk/issues/157#issuecomment-732496554
Simplify the layout and keep border widths constant:
- combine left GL window + buttons (ct_group) in left group (lt_grp)
- make the cube Fl_Gl_Windows the resizable()s of their respective groups.
The latter keeps the margin widths constant.
Use cairo-PostScript to output PostScript when pango is available.
This allows to draw in vectorial form any script.
Before, only the Latin script could be drawn to PostScript in vectorial form.
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().
Documentation: update image of box types.
Fixes#130
Test programs that open files don't use platform specific code.
They don't open files from macOS bundles.
Support files must either be in the current working directory or
given on the command line.
On macOS this requires a full path when using bundles.
Allows and preserves unix style paths if user specifies them,
otherwise uses Windows style. This allows end users to use either
style path and get behavior they expect in cross-platform environments.
Addresses problems raised by issue #122
- create subdir test/images
- copy images used by test/help_dialog to this subdir
- fix image URL's in test/help_dialog.html accordingly
CMake: copy the entire test/images folder to the <build>/data folder
This enables the demo test/help_dialog.cxx to find its images.
Resources like demo.menu and help_dialog.html are no longer read
from the bundle directory on macOS. They are read from the build
folder build/data or in case of classic autoconf/make builds from
the source directory. We don't need to copy the files into the
bundle folder, they are copied to the build/data folder on all
platforms anyway.
Albrecht:
- move fl_chdir(data_path) up before fl_getcwd() prints it
- add statements to open the argument (i.e. file) with data_path
- update comments, remove obsolete code
Greg:
- on Mac we need absolute path for child filename parameters
This is an attempt to unify the code for all build systems (CMake,
autotools with make), platforms (operating systems) and toolchains
(make + gcc/clang, Visual Studio IDE, Xcode ...) to avoid duplicate
code and clarify the differences for future devs and to simplify
maintenance.
The goal is to minimize the platform specific code.
Much of the new code are comments to describe the different situations.
The main program does now all the "hard work" to construct the paths
necessary to access the other applications and data files.
Use macOS specific code to determine the application path (app_path)
in main() instead of function dobut(), when test apps are activated.
Remove obsolete comments and dead code.
Tested on Windows and Linux with both autotools/configure/make
and CMake with make (Linux + MinGW), Visual Studio.
- move target (demo) specific code from macro to CMakeLists.txt
- refactor macOS specific code for a cleaner structure
- improve documentation
Note: CMake ignores platform specific code like creating bundles on
other platforms, hence the entire code could be simplified (less
conditional code)
The changes proposed by Tadej Panjtar (tpanj) were obsolete WRT
current Git repo. Thanks to tpanj anyway, I did also apply the
simplifications of sudoku.rc.
- raise minimum CMake version from 2.6.3 to 3.2.3 (Jun 01, 2015)
- indent all CMake files according to the CMP (2 col.)
- refactor FLTK version number definitions and usage
- unify CMake and autoconf/configure variable names:
- FL_VERSION -> FLTK_VERSION
- FL_MAJOR_VERSION -> FLTK_VERSION_MAJOR
- etc. for _MINOR_ and _PATCH_, respectively
- note: this does not affect FL_VERSION etc. in source code
- generate "export headers" for all libraries (experimental: OFF)
- port some forgotten goodies from branch-1.3 to master
- merge and improve macro 'create_example' (WIP)
- remove "temporary" options and code for older CMake versions
- include and use 'GenerateExportHeader' (experimental, WIP: OFF)
- note: created header files are not yet used
- build only *one* DLL with Visual Studio (tested, works)
- similar to the bundled IDE projects in 1.3.x
- add some dynamically linked test/demo programs ('*-shared')
if shared libraries are built (WIP)
- split 'macros.cmake': use one file per macro
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
Test programs device and pixmap_browser use these new classes.
Class Fl_SVG_File_Surface can be optionally made non functional using the
--disable-svg configure option or turning off OPTION_USE_SVG in CMake.
Class Fl_EPS_File_Surface can be optionally made non functional using the
--disable-print configure option or turning off OPTION_PRINT_SUPPORT in CMake.
Some of the test programs were linked with libfltk_forms which was
unnecessary. The only one requiring this is the forms demo.
[CMake] reordered linked FLTK libs in dependency order.
Clean up library and variable names.
Remove '_SHARED' suffix from library (output) filenames.
This commit was inspired by David Runge ('dvzrv'), thanks.
See PR #21.
Fixes#21
We use the host system's `fluid` when cross-compiling. This must be
executable as `fluid`, i.e. it must be in the PATH or otherwise
defined, for instance as an alias.
Add argument 'center' to position the message box centered over
the given x/y coordinates.
Add another method to supply a widget or window to center the
message box over.
Fix documentation and don't use INT_MIN to avoid having to
include limits.h in user code.
Metrowerks CodeWarrior was an ancient macOS compiler (discontinued
since 2005) that defined the macro __MWERKS__. Code using this macro
and several comments have been removed.
That doc says:
"Top-level windows initially have visible() set to 0 and parent() set to NULL"
and here sw is created as a top-level window, so it must be made visible
either by set_visible() or by show().
The demo exhibits a sometimes annoying /feature/ to spin the entire
puzzle if a user happens to click and/or drag the mouse somewhere on
the puzzle's background rather than on a puzzle piece.
A new command line option '-n' disables this feature entirely.
The extended menu and keyboard commands learned a new option and
keyboard shortcut 'n' => "Normal Position" to stop spinning and
to reset the puzzle to its original position.
The space key is another (hidden) shortcut for 'n'.
MacOS uses bundles instead of executables. CMake creates those bundles in various locations, depending on the generator used (Xcode or Makefiles). I tried to fix all instances where demo apps did not find the resources they needed. This probably must be done for Linux and MSWindows as well.
Usage of Fl::readqueue() is not recommended (should be deprecated?),
hence we shouldn't use it in our demo program(s).
To do: remove Fl::readqueue() usage from fluid.
This adds source png and xcf files for checkers pieces.
Also adds Makefile rules using xxd to convert .png -> .h as requested by Albrecht
in issue #29, (hmm, no comment numbers github?)..message dated "June 22nd 2019 4:22am PDT".
OP noticed our one-bit xbm images demonstrated an X11 driver bug
on certain hardware. While it's good that our test programs show the bug
(e.g. test/bitmap), it's bad that our games do.
Removed the 16 xbm files used by checkers which simulated transparency
with dithered images, and replaced with 4 "hexdump" png files that are
cleaner/simpler looking for such lores pieces (46x46 pixels).
Will follow up with a separate commit for the source .png and gimp .xcf
file I used for making the pieces.