Commit Graph

204 Commits

Author SHA1 Message Date
Albrecht Schlosser 8b1ec4c531 Fix Visual Studio (MSVC) compiler warnings 2023-03-09 17:47:51 +01:00
Albrecht Schlosser 70bdf69279 Move animated gif images to the test/images folder
... to make them accessible to the help_dialog test if built with CMake.
2023-02-23 19:28:27 +01:00
Albrecht Schlosser 880fc26857 Fix clang compiler warning
Warning was: "implicit conversion from 'int' to 'float' changes value
  from 2147483647 to 2147483648"

Not a big deal in this context, but anyway.
2023-02-07 16:17:54 +01:00
Albrecht Schlosser fdc614ea25 Fix examples/.gitignore (add missing files) 2023-02-05 19:52:53 +01:00
Albrecht Schlosser 130a1c21a7 Fix deprecated warnings in examples/table* demo programs
Also: adjust comments, update copyright year
2023-02-04 19:21:53 +01:00
Albrecht Schlosser 4e75549e7b Update dependencies and fix whitespace errors
- replace tabs with spaces
- remove trailing whitespace
2023-02-02 17:09:14 +01:00
wcout 2ddfd9d949
Animated GIF support (Fl_Anim_GIF_Image class) (#375) 2023-01-21 17:27:58 +01:00
Albrecht Schlosser 420042aefb Improve examples/chart-simple demo program
Make sure that the first chart entry is not zero because this wouldn't
show the first part of FL_SPECIALPIE_CHART separated from the circle.
2023-01-16 00:30:32 +01:00
Albrecht Schlosser a29c0e36fd Add Fl_Scheme_Choice to examples/tree-custom-draw-items
- add Fl_Scheme_Choice widget for quick scheme selection
- fix label alignment of selection box
- set selection_color()
- set selectbox()
- make the tree the resizable() of the window
2023-01-12 19:21:09 +01:00
Matthias Melcher 44c874b731
Use `FL_OVERRIDE` for all overridden virtual methods (#611)
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()
2022-12-30 19:14:36 +01:00
Albrecht Schlosser 44a2547394
Rename some Fl_Flex methods for FLTK compliance (#594)
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"
2022-12-15 16:46:40 +01:00
Albrecht Schlosser f375ff9689 CMake: fix building examples w/o test programs
As reported in fltk.coredev in thread
  "CMAKE build with build examples. On and test OFF fails"

$ cmake .. -D FLTK_BUILD_EXAMPLES=ON -D FLTK_BUILD_TEST=OFF

failed with: Unknown CMake command "FLTK_RUN_FLUID".
2022-11-19 11:55:45 +01:00
Albrecht Schlosser c570bd8f96 Fix trailing whitespace 2022-11-01 20:06:22 +01:00
ManoloFLTK 6732044a07 Fix use of several FLTK widgets above an GL scene.
The code failed with 2 or more widgets when FLTK would trigger
partial redraws of the widgets, unless the Fl_Gl_Window was FL_DAMAGE_ALL.

This commit also adds a second FLTK widget to example/OpenGL3test to
check this multiple widget situation, and fixes an error where operator ! was used
instead of ~ .
2022-10-06 08:43:09 +02:00
ManoloFLTK da66e21e1d Support of FLTK widgets in OpenGL 3 windows - cont'd.
This commit allows to switch between FL_DOUBLE / FL_SINGLE modes
in widget-containing GL3 windows.
Demo program examples/OpenGL3test is modified to show FLTK widgets
even if the platform does not support OpenGL 3.
2022-09-29 09:39:21 +02:00
ManoloFLTK c2efb0d849 macOS: support of FLTK widgets in OpenGL 3 windows - cont'd.
This code is OK under macOS 10 9 and 13.
2022-09-28 17:06:00 +02:00
ManoloFLTK 59fc60ea4c Simpler code to support FLTK widgets in macOS OpenGL 3 windows.
Also, the application-level code to add widgets to a GL3 window becomes
platform-independent.
2022-09-27 14:12:39 +02:00
ManoloFLTK 2ffd4e4f1a Replace all calls to sprintf() by calls to snprintf(). 2022-09-26 16:12:18 +02:00
ManoloFLTK 89f9671b40 Add cross-platform support for adding widgets to an OpenGL3-based Fl_Gl_Window.
Under non-macOS platforms, the key is to call glUseProgram(0); after having used OpenGL 3
which allows to then use OpenGL 1 and draw FLTK widgets over the OpenGL3 scene.

Under macOS, this is impossible because macOS GL3 contexts are not compatible
with GL1. The solution implemented here is to create an additional Fl_Gl_Window
placed above and sized as the GL3-based window, to give it a non opaque,
GL1-based context, and to put the FLTK widgets in that additional window.
2022-09-25 16:39:40 +02:00
ManoloFLTK 9c0c04c50d Use adequate #include for fl_wl_display(). 2022-09-23 08:46:26 +02:00
ManoloFLTK 6b63516890 Wayland: fix error detection during call to glewInit(). 2022-09-22 08:07:46 +02:00
Albrecht Schlosser a5b9cc888b Add option to test Fl_Flex in test/pack.cxx
This new feature demonstrates that Fl_Flex can be used (almost) as
a drop-in replacement of Fl_Pack.

Add missing file to examples/.gitignore.
2022-08-08 11:07:40 +02:00
Albrecht Schlosser e6c2503453 Add Fl_Flex demo "howto-flex-simple" to examples
This demo program uses an Fl_Flex widget with one row of buttons.
2022-08-07 18:01:59 +02:00
Albrecht Schlosser c74a482756 Make Cairo example compatible with Cairo version < 1.12 (#436) 2022-04-26 15:36:29 +02:00
Albrecht Schlosser 345e04c083 CMake: Fix OpenGL3 examples libglew link order (#226) 2022-03-09 22:38:05 +01:00
Albrecht Schlosser fbf7a347ec CMake/MinGW/MSYS2: fix building examples with libglew32 (#226)
CMake/resources.cmake: add NAMES option to find_library

examples/CMakeLists.txt: fix linking libGLEW/libglew32
2022-03-07 15:05:07 +01:00
ManoloFLTK 3718effc43 Add the Wayland platform to FLTK 1.4 2022-03-04 15:41:00 +01:00
Albrecht Schlosser 04ccc8cc46 Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2022-01-23 18:12:47 +01:00
Albrecht Schlosser cd611e3957 Remove unnecessary CMake test statement (#358)
Sorry for the noise, this statement was included in my proposed patch.
2022-01-17 15:17:17 +01:00
Greg Ercolano 196430b016 Issue #358 cont'd: Fl_Cairo_Window coord system docs
Elaborated on Fl_Cairo_Window's use of FLTK style coordinates,
    and how this differs from cairo's default native normalized
    coordinate system, and shows how to switch from one to the other.

    Also, small comment fix to the cairo example regarding the "X" color.
2022-01-16 16:59:49 -08:00
Greg Ercolano 313212b497 Adding Albrecht's CMakeLists.txt patch
Albrecht submitted this in issue 358.
    Tested the variations:

    	cmake ..		                               -- examples and cairo off
	cmake -D FLTK_BUILD_EXAMPLES=on                        -- examples on, cairo off
	cmake -D FLTK_BUILD_EXAMPLES=on -D OPTION_CAIRO=on ..  -- examples on, cairo on

    When examples are 'on', they build into the bin/examples directory.
2022-01-16 15:42:23 -08:00
Greg Ercolano 6546814a23 For issue #358 - adds examples/cairo-draw-x.cxx
Since this is the first cairo example in the examples directory,
    it necessarily involved changes to the Makefile and to fltk-config
    to properly handle the absence/existance of the cairo libs.

    TBD: Add docs to the cario widget describing coordinate system
    and how it differs from the default cairo normalized coordinate system.
2022-01-16 15:22:16 -08:00
Albrecht Schlosser 0bc06e8f1a Reformat and move clipboard demo from examples to test folder
The clipboard demo is more a test program than an example and very
useful even if the examples are not built.

Also update dependencies.
2021-11-18 13:44:41 +01:00
Albrecht Schlosser 55f3df268c Fix remaining VS compiler warnings in example programs 2021-11-16 21:25:54 +01:00
Albrecht Schlosser 5e7eede311 Add missing files (executables) to .gitignore files 2021-11-08 19:44:40 +01:00
Greg Ercolano 9e0f140f0a Remove stray tab 2021-09-01 10:05:36 -07:00
Albrecht Schlosser 0f57e272a7 Fix MSVC 'fileno' warning in example program (#109) 2021-08-31 18:12:41 +02:00
fire-eggs 753631a0b5 Fix MSVC compiler warnings (PR #267) 2021-08-30 22:13:32 +02:00
Greg Ercolano 975d34de43 Fix VS2017 'pclose' error, and DIR formatting 2021-08-30 11:56:21 -07:00
Albrecht Schlosser 418699fcea Fix two compiler warnings [-Wunused-variable] 2021-08-30 14:28:35 +02:00
Albrecht Schlosser 6ac305a508 Remove compiler warnings '-Wextra-semi' (see also PR #266)
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.
2021-08-27 14:52:43 +02:00
fire-eggs 571ff10553 Fix "failure to call pclose" (#240) 2021-06-26 14:46:39 +02:00
Albrecht Schlosser 8d26d5ed4b Hide window in quit callback in wizard-simple example 2021-03-21 02:10:19 +01:00
Albrecht Schlosser 90dbf0c77d Fix menu-with-images example w/o using exit()
Use window->hide() in quit callback instead.
2021-03-21 01:58:54 +01:00
Albrecht Schlosser 41266df7ae Remove unnecessary system includes from public headers
Add includes of system headers in the implementation files
where necessary.
2021-03-21 00:42:28 +01:00
Albrecht Schlosser edd52ca1e8 Add fluid callback demo program to examples folder
This example demonstrates how to build an entire program using fluid
and how to add static and virtual class methods as callbacks.
2021-03-19 13:48:41 +01:00
Greg Ercolano 19ae897553 Added chart-simple example 2021-03-18 19:41:27 -07:00
Albrecht Schlosser bbaec9bd88 Update CMake and make files, minor edits only
There are no functional changes to be expected, mostly formatting
and comments.
2021-02-15 19:45:20 +01:00
Albrecht Schlosser 206675a3b1 Fix examples build (configure/make)
Fix more issues caused by moving fltk-versions from examples to test
and adding examples to the CMake build process (gitlab-ci)
2020-08-21 20:00:00 +02:00
Albrecht Schlosser 3b9a04ae2e CMake: add examples folder to build (optional)
- replace misnamed option 'OPTION_BUILD_EXAMPLES' with 'FLTK_BUILD_TEST'
- add option 'FLTK_BUILD_EXAMPLES' to build apps in examples folder
- move examples/fltk-versions.cxx to test/fltk-versions.cxx
- [Travis-CI] enable option 'FLTK_BUILD_EXAMPLES' for automatic builds
2020-08-21 18:55:12 +02:00