Commit Graph

1382 Commits

Author SHA1 Message Date
Matthias Melcher
83fab8cb0f Fix Fl_Pack to support more box types.
Old code supported only frame styles, this code
can now handle box types with a background.
2025-12-29 16:21:17 +01:00
Albrecht Schlosser
22c1730261 Add Fl_Scheme::plastic_color_average() method [#464]
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
This method can be used to set a more appropriate color average to
prevent "graying out" the box colors of the 'plastic' scheme.
Alternatively environment variable 'FLTK_PLASTIC_AVERAGE' can be used
to set the color average value. See docs for details.

Set color average to 45% in test/unittests demo program.
2025-12-25 19:34:08 +01:00
Matthias Melcher
33199dab78 FLUID: Add support for lambda callbacks.
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
Starting the callback text with a '[' assumes that
the rest of the callback is a lambda and generates
inlined code for it.
2025-12-22 23:12:42 +01:00
ManoloFLTK
78908dfe7d Add "Copy" button to test/pixmap_browser
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
2025-12-11 18:40:14 +01:00
Matthias Melcher
70527b3bf0 Improve access to C++ symbols.
For events, fonts, and callback reasons
2025-11-29 21:01:53 +01:00
Albrecht Schlosser
6aa95584e0 Improve and simplify test/clipboard.cxx
- replace FL_OVERRIDE and NULL with 'override' and 'nullptr', resp.
- remove useless global variable (declare it locally in main)
- standardize callbacks using standard callback signatures
- rename some callbacks with more appropriate names
- fix layout of image display and image size info
- improve alignment of text display
- set window size_range (minimal window size)
2025-11-29 20:05:13 +01:00
Matthias Melcher
86b9df01ee Add initial log support for sliders (#1232).
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
Works for all slider types.
Adds tick marks to "nice slider".
Defaults to linear if min or max is zero.
There is room for improvement for drawing the tick marks.
2025-11-26 14:08:58 +01:00
Matthias Melcher
56955a33a3 Additional menu code cleanup.
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
Better variable names,
More descriptive integer types.
2025-11-21 19:57:50 +01:00
Matthias Melcher
910c7d18eb Fix a few more warnings by Clang.
- Apple Clang 17.0.0.
- png, z, jpeg lib integer cast warnings remain
- FLTK callback function cast warnings remain.
2025-11-21 13:37:54 +01:00
Matthias Melcher
8dcc99279e Adjust some pen driver comments.
Made global variables private.
2025-11-20 22:24:21 +01:00
Matthias Melcher
94008f57c3 Add headline menu item style (#1059)
A menu item can be designated as a headline.
Fully integrated and used in Fluid.
2025-11-19 16:58:08 +01:00
Matthias Melcher
2182bd60c0 Remove hidden vector font editor from test/font
Undiscovered for 10 years, this crude vector font generator
snuck into the font test ten years ago through a careless
commit by yours truly. It's time to go now.
2025-11-19 13:27:43 +01:00
Greg Ercolano
2b5d1e557f Add display_columns() controller
Also fixed 'c' shortcut described in the onscreen help to show "Color Bars".
2025-11-17 12:54:01 -08:00
Matthias Melcher
fa65cd6321 Add pen/stylus/tablet API and driver for macOS (#1326)
* define the pen/tablet support API
* add pen event handler stub as a fallback
* add pen device test "penpal".
* Add macOS pen/stylus/tablet driver.
* Add Oxygen documentation.
2025-11-17 21:10:01 +01:00
ManoloFLTK
afc16b3331 Remove from Doxygen files information about removed configure-based build system.
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
2025-09-08 12:49:41 +02:00
Albrecht Schlosser
80e561c78e Improve test/threads demo program
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
- format "Max Prime" output as integer number
- use a fixed font for better readability
- close all windows when the user closes one of them
- use standard background and text colors
2025-07-14 16:53:23 +02:00
Albrecht Schlosser
5d68428a00 Fix trailing whitespace and convert a few tabs to spaces
... according to CMP
2025-07-08 15:25:14 +02:00
Matthias Melcher
2a1677802f Fl_Help_View: Restoring bad includes for back compatibility
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
2025-07-05 20:39:55 +02:00
Albrecht Schlosser
9a5bdf40a4 Enable building "extra tests" with a newer C++ standard
"extra tests" are defined in test/CMakeLists.txt for FLTK devs to allow
quickly building test programs with minimal edits. The new feature
can be used to set a higher C++ standard for these test programs.
See instructions in test/CMakeLists.txt.

Note: this is only intended to be used for quick tests and *must* not
  be committed and pushed to the main repository for obvious reasons.
2025-07-02 17:19:22 +02:00
Albrecht Schlosser
dbd54b8557 Add wrap mode to clipboard viewer
- use Fl_Flex to arrange multiple buttons
- switch buttons dynamically depending on tabs (text or image)
2025-07-01 11:03:41 +02:00
Albrecht Schlosser
088d98389c Improve threads demo test/threads.cxx (#1263)
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
- Replace Fl_Browser with Fl_Terminal which uses a constant buffer size

- Don't lock the GUI for every single prime. Collect primes for at
  least 0.25 seconds before calling Fl::awake(handler, buffer)

- Use (two) alternate buffers for collecting prime data.

- Use Fl::lock() *only* to protect thread data at initialization time.

Observation on Debian 12, CPU: 12-core, 12th Gen Intel Core i7-1260P:
  speedup > factor 4, using multiple cores,
  GUI fully functional: scrolling the display, resizing, ...
  Tested natively (X11 + Wayland) and cross-compiled for Windows,
  using `wine`.
2025-06-22 16:46:44 +02:00
Matthias Melcher
eadea6a992 Update Fl::await() and friends API and documentation
This creates the base for #1263, but does not fix it yet.
2025-06-19 15:33:38 +02:00
Albrecht Schlosser
bcf51371d2 Simplify CMake build config for test and demo programs
Define platform specific library names as CMake variables so they can
be used to build demo programs w/o platform specific instructions.

This includes optional components (e.g. OpenGL) and the MSVC specific
extra object library (call_main) and the fact that we build only one
"monolithic" shared library with MSVC.

Also, enable building FLTK Forms library in CI builds.
2025-05-08 21:34:13 +02:00
Albrecht Schlosser
1066b69c8e Fix "fully support ... own shared libraries" (#1238)
- If shared libraries are built, then fluid, fltk-options, and the
  "games" are linked against the shared FLTK libraries. On some
  platforms the static and the shared versions of fluid and
  fltk-options are built. The games are only built if
  FLTK_BUILD_TEST is enabled.

- The CMake 'install' target now installs the games (if built)
  and their man pages on all platforms (no matter if that is
  useful, for instance on Windows).

- On macOS 'CMAKE_INSTALL_RPATH' is set so *installed* programs
  automatically find their shared FLTK libraries. The "shared"
  versions of fluid and fltk-options got their own '.plist' files.
  This works for both the executables themselves as well as those
  included in bundles. There may be more to do on the macOS platform.
2025-04-21 19:50:12 +02:00
Matthias Melcher
fc91880faf Reactivating Mergeback functionality. (#1226)
Reactivated code.
Various fixes.
New documentation.
2025-04-15 14:47:24 +02:00
Matthias Melcher
f4978a0149 Adding the FL_MENU_CHATTY flag to Fl_Menu_Item.
If set, menu items will also call the callback when highlighting changes.
The reason is given with Fl::callback_reason(). #941
2025-04-01 17:00:56 +02:00
Matthias Melcher
0eb6bb8e6d Fixing a few more compiler warnings.
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
2025-03-30 00:51:34 +01:00
Matthias Melcher
b2b5e47ede Somewhat better example for dynamic tooltip. 2025-03-30 00:25:18 +01:00
Matthias Melcher
61c2b798be Adding missing overrides 2025-03-29 23:52:29 +01:00
Matthias Melcher
5dd1062df5 Adding FL_BEFORE_MENU event to classes derived from Fl_Menu_ 2025-03-29 23:36:19 +01:00
Matthias Melcher
b7189192e2 Adds a new event FL_TOOLTIP_EVENT...
... and Fl_Tootip::override_text() to allow users to dynamically
generate tooltips.
2025-03-29 22:40:18 +01:00
Albrecht Schlosser
1ccafa83b2 Remove obsolete build option 'FLTK_OPTION_STD'
This option is no longer needed since FLTK 1.5 always requires C++11.
2025-03-19 14:44:16 +01:00
Albrecht Schlosser
5b648d2cfc Fix out-of-bounds access in test/checkers.cxx
Some checks are pending
Build and Test / build-linux (push) Waiting to run
Build and Test / build-wayland (push) Waiting to run
Build and Test / build-macos (push) Waiting to run
Build and Test / build-windows (push) Waiting to run
For details please see description in the source code in
  test/checkers.cxx lines 620++

This commit also disables unused code: function dumpnode() which is
  used only in VT100 mode.
2025-03-18 20:31:48 +01:00
Matthias Melcher
51a55bc736 Fluid: restructuring and rejuvenation of the source code.
Some checks are pending
Build and Test / build-linux (push) Waiting to run
Build and Test / build-wayland (push) Waiting to run
Build and Test / build-macos (push) Waiting to run
Build and Test / build-windows (push) Waiting to run
* Add classes for application and project
* Removed all globals from Fluid.h
* Extracting args and project history into their own classes
* Moving globals into Application class
* Initialize values inside headers for some classes.
* Undo functionality wrapped in a class inside Project.
* File reader and writer are now linked to a project.
* Avoid global project access
* Nodes (former Types) will be managed by a new Tree class.
* Removed static members (hidden globals) form Node/Fl_Type.
* Adding Tree iterator.
* Use nullptr instead of 0, NULL, or 0L
* Renamed Fl_..._Type to ..._Node, FL_OVERRIDE -> override
* Renaming ..._type to ...::prototype
* Splitting Widget Panel into multiple files.
* Moved callback code into widget panel file.
* Cleaning up Fluid_Image -> Image_asset
* Moving Fd_Snap_Action into new namespace fld::app::Snap_Action etc.
* Moved mergeback into proj folder.
* `enum ID` is now `enum class Type`.
2025-03-16 17:16:12 -04:00
Albrecht Schlosser
8838e976a0 More (mostly) documentation updates for FLTK 1.5.0
All files: remove autoconf/configure related stuff, update links.

- README.txt: describe prerequisites, provide generic instructions
  on how to use CMake to build FLTK
- test/demo.cxx: remove code used for configure/make build
- test/CMakeLists.txt: remove obsolete 'target_compile_definitions()'
2025-03-10 15:43:12 +01:00
Albrecht Schlosser
347d35a8c0 Update README and configure related stuff for 1.5.0
- remove configure stuff from more README files
- move documentation/README.txt to README.documentation.txt
2025-03-08 17:10:32 +01:00
Albrecht Schlosser
7d58f06a20 Remove 'configure' from README's and sources (partially)
More to come...
2025-03-08 15:19:48 +01:00
Matthias Melcher
6acda521cc Removes the remaining references to Fl_String.
Some checks are pending
Build and Test / build-linux (push) Waiting to run
Build and Test / build-wayland (push) Waiting to run
Build and Test / build-macos (push) Waiting to run
Build and Test / build-windows (push) Waiting to run
Still to do: rename fl_filename... to fl_filename..._str
and introduce into core library.
2025-03-07 01:15:57 +01:00
Matthias Melcher
3068c7a0af Fl_String is now just an alias for std::string.
All mentions of Fl_String will be replaced with std::string
and the Fl_String implementation will be removed.
2025-03-07 00:12:40 +01:00
Albrecht Schlosser
dc07f927f1 Fl_Group: convert array of children to std::vector
Note: this is only a hidden implementation detail: all concerned
variables are private, and the code is simplified (less error prone).

Size of Fl_Group on 64-bit Linux: 168 -> 176 Bytes (+8 Bytes).

test/group.cxx: test for Fl_Group::{add, insert, remove} etc.
2025-03-06 18:31:31 +01:00
Albrecht Schlosser
191b33e0de Update version numbers to 1.5.0 2025-03-06 18:16:03 +01:00
Albrecht Schlosser
e2ca1a39c8 Remove autotools (configure/make) support 2025-03-06 17:12:52 +01:00
Albrecht Schlosser
45476d093c test/editor: ensure buffer termination
... in source file and documentation
2025-02-19 17:14:25 +01:00
ManoloFLTK
af5b2cf464 fullscreen test app: prevent combination of fullscreen + maximize
Also, use more explicit button names
2025-02-03 12:22:07 +01:00
ManoloFLTK
2a58560b7d tedst/utf8: Change default font used under Windows for "Unicode Display Test"
The Windows doc at https://learn.microsoft.com/en-us/typography/font-list/arial-unicode-ms
 of the "Arial Unicode MS" font reads
"The font was included with Office but not Windows. …
We stopped servicing and updating Arial Unicode and no longer install it as part of Office."
Using that font is therefore not the best choice.
This commmit uses "Microsoft Sans Serif" instead available in all Windows versions
since Windows 2000.
2025-01-19 18:39:38 +01:00
Albrecht Schlosser
6784ae807c Fix compiler warnings (VS 2019)
Found with warning level: /W3
2024-12-10 23:12:22 +01:00
Albrecht Schlosser
fe8177ea2c Update Fluid (.fl) files for release 1.4.1 2024-12-09 20:46:01 +01:00
Matthias Melcher
e24de6f89c glpuzzle: smoother animation at 72fps 2024-12-06 13:25:13 +01:00
Matthias Melcher
c61e3f63f6 glpuzzle: fixes timer and trackball max speed
Using 50fps instead of maximum render speed.
Trackball limited to non-head-spinning speeds.
2024-12-06 13:21:28 +01:00
Albrecht Schlosser
ff161187e7 Improve timer statistics in test/cube demo
These timer statistics are useful to see the interaction of OpenGL
drawing and FLTK timers (Fl::add_timer + Fl::repeat_timer).
2024-12-04 16:42:53 +01:00