Commit Graph

5510 Commits

Author SHA1 Message Date
ManoloFLTK
148e1df908 Further minor change to support macOS 11.0 "Big Sur". 2020-09-07 08:36:13 +02:00
Albrecht Schlosser
0e4137f66b
Fix Fl_Check_Browser.{H|cxx} indentation (#121) (#132)
* Fix Fl_Check_Browser.{H|cxx} indentation (#121)

... and some more whitespace errors as proposed by Greg
... in issue #121: Fl_Check_Browser--whitespace-patch.txt

Fixes #121

* Fix copyright years
2020-09-06 20:02:02 +02:00
fire-eggs
cdda89455c Fix issue with Fl_Tiled_Image: did not correctly draw
... to sub-region of widget.

Original patch (PR #114) modified by Albrecht-S:
 - fixed whitespace
 - removed modifications of test/unittest_images.cxx
2020-09-01 13:15:51 +02:00
Albrecht Schlosser
b65d3a249d Customize corner radius for rounded box/frame (#130)
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().

Documentation: update image of box types.

Fixes #130
2020-09-01 12:35:48 +02:00
Albrecht Schlosser
340e2ac3a1 Fix .clang-format and some whitespace errors
.clang-format: UseTab: ForIndentation -> Never

Update fluid generated files
2020-08-22 13:35:42 +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
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
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
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
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
ManoloFLTK
5fa367c2cf Fix for issue #50: usage in plugins on Linux. 2020-07-23 09:07:55 +02:00
Albrecht Schlosser
11dec24ccf Add missing driver folder to Makefile (clean) 2020-07-20 14:23:17 +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
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
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
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
Albrecht Schlosser
9925b0f128 Update Fl_Window docs, fix typos
No source code changes
2020-07-12 18:06:03 +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
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
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
Albrecht Schlosser
1da349579d Fix static code analyzer warnings
Note: there's more to do ...
2020-06-24 20:20:11 +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
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