Commit Graph

8884 Commits

Author SHA1 Message Date
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
Albrecht Schlosser
956a3bb160 CMake: simplify copying of test and demo files 2020-07-18 16:07:30 +02:00
ManoloFLTK
3bb3429670 Restore use of virtual Fl_Window::resize() to be notified when window moves.
A previous commit c66caf5dce
"Simpler implementation of Fl_Cocoa_Window_Driver::resize()"
made that Fl_Window::resize() was no longer called by FLTK when a
window is moved. This prevented the undocumented practice of
re-implementing the virtual function Fl_Window::resize() and use it
as a way to get a notification that a window was moved.
2020-07-17 15:08:33 +02:00
Albrecht Schlosser
a0638273c8 Documentation: update clock demo images
One of the images was cut off at the top or bottom.
Added window decoration with title, used a bright blue background.
2020-07-16 14:27:44 +02:00
Albrecht Schlosser
c380a91361 Windows: add icon to sudoku.exe (PR #36)
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.
2020-07-16 12:25:51 +02:00
Duncan Gibson
46c1500bf3 fix doxygen links in Fl_Group.H
fix dead links to Fl_Group::resizable(Fl_Box *box)
reorder paragraphs to highlight different behaviour
add link to new "How does resizing work?" chapter in dox
2020-07-15 19:43:21 +02:00
ManoloFLTK
13c1923b2a Restore file icons to 3 macOS test apps who have one 2020-07-15 17:06:05 +02:00
Albrecht Schlosser
720b84ef9d CMake: refactor and reformat CMake files
- 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
2020-07-15 00:34:53 +02:00
Greg Ercolano
5442503077 Merge branch 'issue-99a': add OS error messages to Fl_File_Chooser
Pulling in Greg & Albrecht's work on PR #99 and PR #103.

This includes supporting operating system error messages
in the user's local language, which took some extra effort.
2020-07-14 11:34:18 -07:00
Albrecht Schlosser
58296c373a Fix old URL's and forum/newsgroup names
- fltk.development has been renamed to fltk.coredev
- all FLTK URL's are now of the form https://www.fltk.org/
2020-07-14 15:16:05 +02:00
Greg Ercolano
da76085fe7 Import Albrecht's utf8 mods for FormatMessage() to fluid
Amended by Albrecht:
 - fix comments
 - add setlocale() to fluid

Note: the latter is also necessary to honor locale in GTK filechooser.
2020-07-14 13:14:37 +02:00
Albrecht Schlosser
845224f475 Windows: convert error message to UTF-8
We need to get the error message in "wide character" format and
convert it to UTF-8. The conversion would truncate it if the
buffer was too small, hence we don't need to check for overflow.

Tested on Windows 10 with VS 2010, including (faked) error codes with
non-ASCII characters (German).
2020-07-14 12:52:56 +02:00
Greg Ercolano
7426e762a4 setlocale() added to Fl_File_Chooser demos
This change ensures errors in local language.
See issue #99 for discussion on why this is needed.
2020-07-14 12:52:56 +02:00
Greg Ercolano
4471166f59 Extra fool-proofing, and suggested use of strerror_r()
strerror_r() sounds like the better thing to use, but if you
read the man page carefully, there are pitfalls of competing
GNU vs POSIX versions of the same function, with different
return values.

GNU version returns a pointer to the error string, which may
or may not use the error string supplied to use. Makes no sense.
Why not use the buffer the user prepared? Makes returning errors hard.
One thing GNU does underline is the string is always NUL terminated.

POSIX version doesn't return a string at all, it returns an int,
making handling the GNU cases impossible. POSIX /doesn't/ say
one way or the other about the string being NUL terminated, so
you have to make sure when you use it.

I trawled the net, seems this is a big annoying issue.
For now, leaving the code with strerror(), but we should change it.
2020-07-14 12:52:56 +02:00
Greg Ercolano
0693c70f57 First pass at fixing issue 99
A lot of code touched because low level functions needed to pass up
error messages reliably, and this had to propagate up the entire
driver hierarchy.

Tested OK *in English* on:
     > Linux
     > OSX 10.10.x
     > Windows VS2017
     > Windows mingw64
I have no way to test on Android, but it might work.

TODO: Needs testing in other languages to verify proper UTF8 error messages,
      esp. with Windows VS, due to complexities with FormatMessage() -- see get_ms_errmsg()
2020-07-14 12:52:56 +02:00
Duncan Gibson
7038559338 add resize documentation as per STR3433
add resize chapter to documentation, plus images,
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-13 23:12:54 +02:00
Greg Ercolano
44375763aa A few extra comments for table-spreadsheet.
Also small but unnecessary code change to reset row_edit/col
to zero after editing for example clarity.

Unnecessary b/c those vars are ignored anyway when input
visibility turned off, so change is more cosmetic codewise.
2020-07-13 09:47:26 -07:00
Albrecht Schlosser
9925b0f128 Update Fl_Window docs, fix typos
No source code changes
2020-07-12 18:06:03 +02:00
Albrecht Schlosser
8a3d3684ac Fluid: fix "trailing whitespace" errors (#100)
Fluid would write trailing whitespace at some points when generating
.cxx and .h files from .fl files.

This was an old issue but became obvious since we removed trailing
whitespace from source and header files recently.

This commit fixes all whitespace errors in files generated from .fl
files in the FLTK repository, i.e. in fluid/, src/, and test/ folders.

I can't guarantee that I found all possible whitespace errors, but
this commit:

Fixes #100
2020-07-11 18:48:42 +02:00
ManoloFLTK
e5fbfcbec1 Simpler code to support layer-based views that occur when macOS ≥ 10.14 2020-07-11 15:40:53 +02:00
ManoloFLTK
2984fe638c Fix for building without print support (GitHub issue #98). 2020-07-11 12:21:25 +02:00
Robert Schumacher
8d5eed3c82 Convert Fl_Group::array_ to union to better represent its behavior
Amended by Albrecht:

- rename union member variables as discussed
- add comments to new array_ union members

Fixes #96

Signed-off-by: Albrecht Schlosser <albrechts.fltk@online.de>
2020-07-10 18:09:28 +02:00
Greg Ercolano
2b88ce521d Shortcut tooltip elaborates on how to clear shortcut
A user was having trouble figuring this out on fltk.general,
seemed like a tooltip could have helped, so added it.
2020-07-06 21:31:25 -07:00
ManoloFLTK
2f0be9d537 Add member function FILE* Fl_PostScript_File_Device::file() 2020-07-06 21:01:42 +02:00
ManoloFLTK
0b5f92d1c7 Improve control of sheet containing file dialog window. 2020-07-06 21:01:42 +02:00
Albrecht Schlosser
f09e17c3c5 Remove $Id$ tags, update URL's, and more
- 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.
2020-07-06 20:28:20 +02:00
ManoloFLTK
b0e0c355ed Update doc of Fl_Help_View following addition of html entity &dagger; 2020-07-01 16:10:31 +02:00
ManoloFLTK
64de9bd3fc Add "&dagger;" HTML entity. 2020-07-01 11:58:41 +02:00
ManoloFLTK
e98d7d8df5 Fix test/help_dialog for CMake building and macOS platform. 2020-07-01 11:02:53 +02:00
Albrecht Schlosser
3b249de60a Clarify documentation (STR 3532)
Make clear that Fl::repeat_timeout() must only be called for the
same timeout it is handling. Related STR's:

https://www.fltk.org/str.php?L3532
https://www.fltk.org/str.php?L3516
2020-06-30 15:28:35 +02:00
ManoloFLTK
8d4b0c15f7 Move class Fl_SVG_File_Surface from libfltk to libfltk_images.
File examples/SVG_File_Surface.cxx is no longer useful because it was a very
partial implementation of what is now class Fl_SVG_File_Surface.
2020-06-29 11:36:09 +02:00
ManoloFLTK
26e6c3f930 Add classes Fl_SVG_File_Surface and Fl_EPS_File_Surface to draw to SVG and EPS.
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.
2020-06-27 09:56:00 +02:00
ManoloFLTK
93f19c3a24 Add files needed when building libpng for the arm64 architecture.
These files can be compiled-in for other architectures but produce no binary code.
2020-06-24 21:55:39 +02:00
Albrecht Schlosser
1da349579d Fix static code analyzer warnings
Note: there's more to do ...
2020-06-24 20:20:11 +02:00
Albrecht Schlosser
4c9b44f01e Update README.Pico.txt
- fix typos and minor, obvious errors
- reformat small parts
- remove trailing whitespace
2020-06-24 20:05:06 +02:00
Albrecht Schlosser
c12408b53f Avoid crash in Fl::next_window(win)
As documented, Fl::next_window(win) must only be called with a valid
*shown* window. The old code would crash if the argument was NULL
or the window was not shown.

The new code avoids the crash, issues an error message, and returns
NULL to the caller.
2020-06-24 19:58:33 +02:00
Taeril
930013638b Quick fix for inability to link with pango from fltk-config
Commit 6fe226cb80 introduced use of
pkg-config which broke linking from fltk-config if FLTK was
configured to use pango library.

This patch duplicates line from another if branch that just adds
libraries assuming that if pkg-config found pangoxft that there
are present all it's requirements.
2020-06-21 14:29:18 +02:00
Albrecht Schlosser
69d58f485a Remove superfluous dependency on forms library
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.
2020-06-21 13:39:25 +02:00
Greg Ercolano
0dc16dd8c9 Added fluid command line '-d' debug flag 2020-06-19 08:59:48 -07:00
Greg Ercolano
db07cea758 Fix problem with Windows pids being unsigned DWORDs
Had to get away from overloading PIDs with error codes,
so now error codes are returned separately from the PID.
2020-06-18 18:24:45 -07:00
ManoloFLTK
76da518b97 Document who's responsible for deletion of widget's image labels. 2020-06-18 10:21:28 +02:00
ManoloFLTK
87b73723ed macOS Window menu: select in menu new top window after window deletion 2020-06-17 20:09:15 +02:00
ManoloFLTK
5005d04765 More detailed documentation of Fl_SVG_Image::normalize(). 2020-06-16 12:04:20 +02:00
ManoloFLTK
46b89686df Allow using an Fl_SVG_Image object as window icon.
Fix for issue #90: Setting an svg image as a window icon causes a segfault.
2020-06-15 19:05:47 +02:00
Albrecht Schlosser
91b78572c7 Fix overly restrictive JPEG filter (#81)
See https://github.com/fltk/fltk/issues/81

Fixes #81
2020-06-15 02:17:20 +02:00
Albrecht Schlosser
a7a1e1594c Fix stale current_ pointer when deleting Fl_Group
If a user program accidentally deletes the "current" group, then
the pointer would still point at the deleted widget. This commit
prevents this and makes the Fl_Group's parent the current group.

Fixes issue #88.
2020-06-15 01:38:18 +02:00
Albrecht Schlosser
b8318480f5 CMake: Build static and shared libs side-by-side
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
2020-06-13 14:22:22 +02:00
Albrecht Schlosser
6279ab0586 CMake: Deprecate FLTK_USE_FILE (UseFLTK.cmake)
Cherry-pick the essential changes from FLTK 1.3 since this change
had not been ported to 1.4 yet.

To do: my current plan is to consolidate 1.3 and 1.4 CMake files
as far as possible (with the exceptions of source files, obviously)
and to redesign / refactor CMake files later in this process or
maybe only for 1.4 if it turns out to be too much to backport.
2020-06-13 13:51:35 +02:00