Commit Graph

1304 Commits

Author SHA1 Message Date
Matthias Melcher
abb2971654 Fix Fl_Tabs callback in Overflow mode (#1031). 2024-08-02 21:15:18 +02:00
Albrecht Schlosser
53469038ce Enable setting a fixed font for 'wine' in test/handle_keys.cxx
... w/o editing a file. The default font is "Liberation Mono".

Just set environment variable FLTK_USING_WINE=1 to enable this feature.

Rationale: on /my/ current test system the font chosen by `wine` for
FL_COURIER is a proportional font whereas the display in Fl_Terminal
requires a fixed font for correct output. Font "Liberation Mono"
solves this long standing issue for me w/o having to change source code
but other Linux systems may require a different font.
2024-07-31 17:04:34 +02:00
Albrecht Schlosser
a7d00ae558 Resize line sizes and widths dynamically in test/line_style_docs
Resize the window to see the effect: line sizes increase with the box
size and become wider depending on the box size. Minimal line width
of the "wide" lines has been changed from 4 to 5, maximal width is
now 9. Distinct widths are { 5, 7, 8, 9 }.

Note: the default (thin) line width is now 1 rather than 0 since the
  default 0 may render badly.

Screenshot in documentation has been updated.
2024-07-23 17:18:40 +02:00
Albrecht Schlosser
7f24a0d6d8 Update docs and screenshot for fl_line_style() (#1016)
As a follow-up to the discussion I used the posted screenshot demo
(thanks to Greg), redesigned it using Fl_Grid, and added it as a
new test program, including Makefiles and CMakeLists.txt.

New file: test/line_style_docs.cxx to create screenshot. Note that the
old test/line_style.cxx is not obsolete, it can be used to test the
line styles interactively.

Docs have been updated in both chapter "Drawing Things" and the
function description.

Also added the new demo to test/demo.menu under "Images for Manual...".
2024-07-21 22:34:02 +02:00
Greg Ercolano
6776f89872 Fix horiz connection lines (#1008) 2024-07-08 12:13:44 -07:00
Albrecht Schlosser
d411d39092 Improve test/handle_keys.cxx
- colorize output
- improve formatting
- log status of Fl::OPTION_SIMPLE_ZOOM_SHORTCUT
2024-07-01 00:30:35 +02:00
Greg Ercolano
54f44d5ac9 Fix compiler warnings 2024-06-30 09:25:31 -07:00
Albrecht Schlosser
64cd50c130 Update test/input_choice demo (#978)
- add Fl_Choice widget for layout comparison
- rewrite button callbacks
- improve layout and other details

This is a follow-up to issue #978, "merging" the existing input_choice
demo with "choicetest_v3" as mentioned.
2024-06-27 03:19:26 +02:00
Greg Ercolano
5c7ba51be3 Fix Fl_Input_Choice vs Fl_Choice drawing issues (#978)
Differences in size of arrows and overall look varies
with different schemes applied for issue raised by Philip Rose
first on fltk.general:

Subject: Discrepancy between Fl_Choice and Fl_Input_Choice
2024-06-26 15:40:41 -07:00
Albrecht Schlosser
b8cba7c41e Update dependencies 2024-06-21 18:16:44 +02:00
Albrecht Schlosser
9820d9f555 Fix and improve fl_contrast() calculations
- src/fl_contrast.cxx:
  - FL_CONTRAST_LEGACY: reset black/white threshold from 55 to 50
  - FL_CONTRAST_CIELAB: change default contrast level from 55 to 39

- test/contrast.cxx:
  - set default contrast mode to CIELAB
  - add "random color" button to test random foreground colors (text)
  - slightly increase terminal size
  - make the Fl_Terminal widget the resizable() of the window
2024-05-16 19:58:24 +02:00
ManoloFLTK
66c37e5128 Fix crash in test/cube under macOS when using Quit menubar item 2024-05-14 18:15:05 +02:00
ManoloFLTK
25ffce6cdf configure-based build: move terminal to fluid-dependent section 2024-05-10 08:20:31 +02:00
Albrecht Schlosser
175931bccd CMake: simplify compiler detection for '-Wshadow' test 2024-05-01 16:07:58 +02:00
ManoloFLTK
9472ff546c Implement and document new class Fl_PDF_File_Surface 2024-04-30 10:22:47 +02:00
Albrecht Schlosser
576f7bb9cc Enable 'shadow_variables' test on macOS using AppleClang
The CMake compiler ID on macOS is AppleClang rather than Clang.
This commit checks for this compiler ID as well.
2024-04-22 16:54:25 +02:00
Albrecht Schlosser
3fc8875756 Add missing 'x11.H' to exclusion list (STR 2728) 2024-04-18 17:33:57 +02:00
Albrecht Schlosser
bb45198413 Test public headers for shadowed variables (STR 2728)
This program is built only when using CMake and a GNU or Clang
compiler to detect shadowed variables in header files.

Developers should fix such warnings whenever they see them during the
build to avoid user reports.
2024-04-18 17:13:09 +02:00
Greg Ercolano
31170c4731 Rename putchar() to plot_char() (#944)
Some old platforms (NetBSD, AIX) implement the common stdio "putchar()"
function as a global macro which poisons the global namespace, preventing
all C and C++ programs from using "putchar()" as a function or method.

There was a long thread about this in fltk.coredev during the period
Mar 25 2024 ~ Apr 4 2024, subject "RFC: Fl_Terminal::putchar() in public API"
as to why we have no choice but to not use putchar() as a method name.
2024-04-06 23:36:04 -07:00
Albrecht Schlosser
05ddf0f600 Move test/fromdos.c to misc/fromdos.c where it belongs
This is a test file for developers only. Use with caution.
2024-04-02 17:02:01 +02:00
Albrecht Schlosser
af90841fbc Update dependencies, whitespace, and Fl_File_Chooser.cxx
Rewrite src/Fl_File_Chooser.cxx from its .fl source file
2024-03-19 15:39:18 +01:00
Albrecht Schlosser
81d47f71d6 Fix VS compiler warning, write "copied" message to tty
... rather than popping up a message window.
2024-03-18 19:34:32 +01:00
ManoloFLTK
792cfc27e7 native-filechooser has preview panel with FLTK_USE_X11 and macOS 2024-03-18 18:22:41 +01:00
Albrecht Schlosser
193c5285cd Improve linking of test/cairo_test.cxx demo program
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 ..."
2024-03-16 23:24:01 +01:00
Albrecht Schlosser
8b094e8af3 Fix a bunch of compiler warnings, particularly for old compilers
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.
2024-03-15 20:42:42 +01:00
Albrecht Schlosser
26f5b38a01 Update documentation, remove/edit explicit FLTK versions
... to simplify further version updates.

Add more deprecation notices concerning autotools/configure
to README.Unix.txt.
2024-03-14 17:16:43 +01:00
Albrecht Schlosser
9f4cea25bf Improve keyboard event test program: add copy button
... to copy selected or the full text to the clipboard.
2024-03-12 22:33:34 +01:00
Albrecht Schlosser
5e4f51ac6b Fix several compiler warnings
Three unrelated but only minor warnings.
2024-03-12 21:47:33 +01:00
Greg Ercolano
38af0c823b Add Fl_Terminal to "Scrollbar Size" unittest (#931)
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.
2024-03-11 13:20:17 -07:00
Albrecht Schlosser
62d85333bd Improve handling of events in test/handle_keys.cxx
(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.
2024-03-11 17:07:56 +01:00
Albrecht Schlosser
7bbe75c84e Add another keyboard event test program test/handle_keys.cxx
This program logs all keyboard events to a built-in Fl_Terminal widget.

WIP: version 0.80
2024-03-09 15:17:34 +01:00
Albrecht Schlosser
290e95eaef Use FL_Alt_Gr key definition in test/keyboard
... and reformat key definition table
2024-03-09 14:03:51 +01:00
Albrecht Schlosser
602cd7a990 Use fixed font in test/clipboard for text display
This is more like a text editor would display text.

Todo: make the font selection optional (later).
2024-03-09 13:56:09 +01:00
Albrecht Schlosser
4c0a2ffb81 Fix shortcut (Esc) handling in test/keyboard.cxx
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.
2024-03-05 03:08:30 +01:00
ManoloFLTK
72840ea2c1 Fix: Filechooser preview of XML file shows it as a corrupt image (#926) 2024-03-04 21:15:47 +01:00
ManoloFLTK
2e315e5424 native-filechooser: add call to fl_register_images() and explain why 2024-03-03 08:33:27 +01:00
Matthias Melcher
f1c9b198bb Promote fl_strlcpy to <FL/fl_string_functions.h> 2024-03-02 23:49:35 +01:00
Matthias Melcher
4ccadff4b9 Fix test/editor use of strncy to strlcpy 2024-03-02 23:14:07 +01:00
ManoloFLTK
0818d4ec5b Fix: Fl_Window::fullscreen() does not work correctly on Mac (#920) 2024-02-26 12:15:47 +01:00
ManoloFLTK
ba5ed296e9 Improve implementation of the macOS Window menu
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.
2024-02-20 16:00:01 +01:00
Greg Ercolano
00cdb1757f Added attribute checks to test/terminal for recent changes. 2024-02-16 13:14:15 -08:00
Albrecht Schlosser
809ceea075 Fix Cairo related build issues (missing Cairo lib)
... particularly for shared libs
2024-02-09 19:41:45 +01:00
Albrecht Schlosser
ede53b8a50 Fix cairo_test-shared build as well (#902) 2024-02-09 17:35:26 +01:00
ManoloFLTK
ffeaeec5bd Move FLTK_USE_SVG from config.h to FL/fl_config.h 2024-02-09 13:36:16 +01:00
Albrecht Schlosser
3895068aa1 Fix "cairo_test fails to link due to undefined's" (#902)
Restore "too much optimized" CMake code.

The issue would only be visible if neither FLTK_GRAPHICS_CAIRO nor
FLTK_BACKEND_WAYLAND was active.
2024-02-09 12:38:14 +01:00
Albrecht Schlosser
fd5cd80935 Introduce "Modern CMake" in FLTK
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.
2024-02-07 18:37:34 +01:00
Matthias Melcher
f0c1eff069 Fix typo in function name in editor. 2024-02-06 22:00:11 +01:00
Matthias Melcher
78ae78b118 Add dynamic title to test/editor 2024-02-06 21:25:43 +01:00
ManoloFLTK
6d98c6a8b1
Restore 3-way close window dialog (#900) 2024-02-06 20:27:18 +01:00
Matthias Melcher
d9612e3cc7
RFC: Different approach to Editor tutorial (see #189) (#883)
Update test/editor code and tutorial (#189, #883)

Different, sequential approach to Editor tutorial
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-01-29 11:43:34 +01:00