Commit Graph

8931 Commits

Author SHA1 Message Date
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
9ba4cd06dc CMake: add feature and configuration summary 2020-08-21 19:00:38 +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
Albrecht Schlosser
d91160a9e0 Remove platform specific code from test apps
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.
2020-08-21 18:54:40 +02:00
Albrecht Schlosser
f3005a44f8 CMake: move test executables to build/bin/test 2020-08-21 17:10:30 +02:00
Michael Dickens
4c012bd706 Fluid: when linking include LDFLAGS order
LDFLAGS often contains "-L*" flags as provided outside the build to tell the linker where to search for libraries. If these are included -before- the ones used for internal linkage as found in LINKSHARED, and FLTK is already installed on the system, then the already-installed FLTK libraries will be found before those internal to the build. Moving the LDFLAGS after LINKSHARED generally solves this issue. Worst case the move won't hurt linking since all of the flags are still included in the link command.
2020-08-20 17:34:57 +02:00
Albrecht Schlosser
adc3a29cdc Fix link and comments in example program
The mentioned link to fltk.general was incorrect; fixed and added
thread title for further reference.

Fixed typo and adjusted comments.
2020-08-20 12:42:53 +02:00
Albrecht Schlosser
fcd5239adc CMake: Fix macOS bundle wrapper generation
Now bundle wrapper scripts are created in the particular build folder,
i.e. in subdir 'Debug', 'Release' etc. in multi config builds (Xcode).
To do this, the scripts are now copied whenever the target is built
and not during the configuration phase.

To do: "install" wrapper scripts.
2020-08-18 16:23:25 +02:00
ManoloFLTK
b8b2805270 Make recent changes to support macOS 11.0 "Big Sur" active with 11.0 only.
An optimisation used for drawing to windows is not possible under 11.0.
This commits reinstalls it under macOS 10.14 and 10.15.
2020-08-17 17:21:53 +02:00
Albrecht Schlosser
5380706be7 Fix compiler warning in example [-Wliteral-suffix]
[gcc] warning: invalid suffix on literal; C++11 requires a space
  between literal and string macro [-Wliteral-suffix]
2020-08-15 13:30:11 +02:00
ManoloFLTK
32c316b78f Add Fl_Window::screen_num(int) to fully control window location
on multi-screen systems having distinct per-screen scaling factors.
2020-08-14 16:44:20 +02:00
Albrecht Schlosser
7b34385511 Fix simple SVG example (howto-simple-svg) 2020-08-13 20:25:03 +02:00
ManoloFLTK
8f32a29a8b Slightly simpler code in the drawRect:(NSRect) method 2020-08-11 15:18:56 +02:00
Greg Ercolano
cd26829099 Fix missing Alt-N shortcut for newly created favorites
Fl_File_Chooser's "Add Favorite" function wasn't including the
Alt-N shortcut when initially added. Now just calls update_favorites()
to rebuild the menu with proper shortcut numbering.
2020-08-10 09:32:06 -07:00
Greg Ercolano
7b797bf9ed Added Mike's feature list to Fl_File_Chooser docs
When Mike proposed Fl_File_Chooser, he included a list of features
in the voting contest: https://www.fltk.org/contest.php
Seemed like a good idea to include these in the widget's docs.
2020-08-10 09:05:09 -07:00
ManoloFLTK
e5b5189870 Add support of macOS 11.0 "Big Sur". 2020-08-10 07:31:50 +02:00
Greg Ercolano
0da41da713 Allow unix style paths for windows native filechooser
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
2020-08-08 19:10:57 -07:00
Greg Ercolano
b105dd726f Error string that was created is now saved with errmsg() 2020-08-07 16:29:52 -07:00
Albrecht Schlosser
91e8a0282c Remove useless 'if (...)'
- dasharray_ can never be NULL unless if memory allocation failed
  previously
- if dasharray_ was NULL, the previous strcmp() would have crashed
  anyway (but it can't be NULL, see above)
2020-08-05 14:34:45 +02:00
ManoloFLTK
5b1c7249a5 Remove memory leak. 2020-08-04 11:06:59 +02:00
ManoloFLTK
81941c5597 Remove useless Fl_GDI_Graphics_Driver::reset_spot() 2020-08-03 17:32:09 +02:00
Albrecht Schlosser
4d0b04456e Update dependencies + fluid/generated files 2020-08-03 13:03:14 +02:00
Greg Ercolano
3d18d325f6 Commiting fluid generated template_panel.h as per issue #116
Regarding this comment thread:
https://github.com/fltk/fltk/pull/116#discussion_r458517450
2020-08-02 10:56:40 -07:00
erco77
7abc09ad89
Merge pull request #116 from erco77/fl_strdup
fl_strdup() implemented + deployed
2020-08-01 14:35:44 -07:00
Greg Ercolano
e9688822ec Convert example from strdup -> std::string 2020-08-01 14:19:40 -07:00
Greg Ercolano
b409588012 Remove unneeded strdup from example, fold tabs 2020-08-01 14:19:40 -07:00
Greg Ercolano
2141c63628 Implement + deploy fl_strdup() 2020-08-01 14:19:40 -07:00
Greg Ercolano
7514a73ba7 Solves issue #117, memcmp -> strncmp
Closes #117.
2020-07-31 07:00:46 -07:00
ManoloFLTK
889acc7d74 Fix use of an SVG image in Fl_Tiled_Image when display is rescaled. 2020-07-30 17:41:35 +02:00
ManoloFLTK
f9bdb5a4db Documentation: complete the inheritance diagram from class Fl_Surface_Device. 2020-07-29 19:54:57 +02:00
ManoloFLTK
41a6ade72b Fix for issue #119. Drawing artefacts for SVG images without XRender.
Xlib: Drawing SVG images in scaled mode without XRender has drawing artefacts.
2020-07-28 17:57:39 +02:00
ManoloFLTK
b40e218c01 Fix for "Crashing regression in MacOS code" in fltk.coredev. 2020-07-27 17:04:27 +02:00
ManoloFLTK
e3270a6032 Simpler macOS-specific code in main(). 2020-07-25 12:43:43 +02:00
Albrecht Schlosser
bfb3b3abd8 Remove typedefs Fl_String and Fl_CString
These unused typedefs are not used anywhere and should not be defined
at all.

Remove typedef 'Fl_String' as decided in fltk.coredev.
Remove typedef 'Fl_CString' as well for the same reason.
2020-07-24 20:12:06 +02:00
ManoloFLTK
5839817c51 Fix problem when calling Fl_Window::fullscreen_off() in certain circumstances.
The problem was discovered in fltk.coredev "Crashing regression in MacOS code"
2020-07-24 18:41:53 +02:00
Albrecht Schlosser
118c67c804 Git-ignore resize-example* test programs 2020-07-23 12:46:02 +02:00
ManoloFLTK
e2d3b03899 Simpler macOS-specific code. 2020-07-23 09:24:29 +02:00
ManoloFLTK
5fa367c2cf Fix for issue #50: usage in plugins on Linux. 2020-07-23 09:07:55 +02:00
Albrecht Schlosser
332003cd13 Create macOS "bundle wrapper" scripts (#115)
These scripts must be installed side by side with the bundle with the
same name and run the executable inside the bundle when executed.
2020-07-23 02:07:43 +02:00
Albrecht Schlosser
f357f4311c Use local images in test/help_dialog(.html)
- 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.
2020-07-23 01:53:24 +02:00
Albrecht Schlosser
0015e64671 macOS: don't add resource files to demo.app
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.
2020-07-22 23:36:20 +02:00
Albrecht Schlosser
b2ad5e4cfd
Merge pull request #111 - refactor test/demo.cxx
Simplify, clarify and fix bugs in test/demo.cxx

As discussed and confirmed test/demo.cxx works now in all known and
supported build systems.
2020-07-21 22:46:48 +02:00
Albrecht Schlosser
4957dd48c2 Fix macOS code + remove obsolete code
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
2020-07-21 11:41:37 +02:00
Greg Ercolano
889ab64962 Add Fl_Simple_Terminal for cross platform debugging 2020-07-21 11:11:03 +02:00
Albrecht Schlosser
af7f485e06 Consolidate test/demo for all build systems
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.
2020-07-21 11:11:03 +02:00
Albrecht Schlosser
11dec24ccf Add missing driver folder to Makefile (clean) 2020-07-20 14:23:17 +02:00
Duncan Gibson
c132ac564e add resize examples as per STR3433
add example code for creating images for resize.dox
based on Article #415: How does resizing work?
https://www.fltk.org/articles.php?L415

see also https://www.fltk.org/str.php?L3433
2020-07-20 14:08:47 +02:00
Albrecht Schlosser
4858882e1e CMake: simplify create_example macro
- 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)
2020-07-20 11:02:01 +02:00
Albrecht Schlosser
df683013d2 Restore tabs in html test file
These tabs were intentional and had been replaced with spaces
in the big whitespace fix.

This file is an exception!
2020-07-20 10:32:59 +02:00
Albrecht Schlosser
1657654377 CMake: fix FLTK_RUN_FLUID macro
The target variable should be set outside of the loop.
2020-07-20 10:19:47 +02:00