Commit Graph

2574 Commits

Author SHA1 Message Date
ManoloFLTK
b5516449a6 Wayland: fix interactive moving and resizing of a subwindow - cont'd (#987)
This commit removes changes in class Fl_Group introduced in 1c6a0c1.
2024-07-01 17:02:27 +02:00
Cyprinus Carpio
b55dc47aae
Documentation: remove implication of concave 3 sided polygons existence (#1000) 2024-07-01 16:51:22 +02:00
Cyprinus Carpio
a69c5c5c92
Fl_Tree +/- buttons are no longer drawn using bitmaps, different default line color (#995)
Fl_Tree changed to support system color themes (PR #995)

merging CyprinusCarpio's mods carried over from from issue #972.

* Fl_Tree: use named (colormap) colors to support system color themes (see issue #972). changed connectorcolor() default from gray ramp color to FL_INACTIVE_COLOR (Fl_Color(8)), and similar named colormap colors for icon drawing.

* Fl_Tree ⊞ / ⊟ icons (and on macs, ▶ / ▼icons) are now drawn w/fl_draw() functions instead of with xpm bitmaps for colormap control

---------
Co-authored-by: Greg Ercolano <erco@seriss.com>
2024-06-30 09:08:00 -07:00
ManoloFLTK
1c6a0c1a8f Wayland: fix interactive moving and resizing of a subwindow - cont'd (#987)
This fix requires to be able to recognize whether Fl_Wayland_Window_Driver::resize() is called
by a resize operation of an encompassing widget or not.
To do that, private static int variable group_resize_depth_ is added to class Fl_Group
and an accessor to this variable is added to class Fl_Window_Driver.
2024-06-29 14:57:54 +02:00
Greg Ercolano
a678dba2e3 More copyright updates (#978) 2024-06-26 16:02:12 -07: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
ManoloFLTK
54cff14f87 Fix for "Fl_Pack should override clear() to set resizable(0)" (#993) 2024-06-23 08:50:29 +02:00
Albrecht Schlosser
d9c8cebfbe Remove trailing whitespace
no code changes
2024-06-21 18:10:33 +02:00
Albrecht Schlosser
456d53c403
Add Fl::remove_next_timeout(...) to remove only one timeout (#992)
This method also returns the data pointer of the removed timeout.

This new method is generally useful for user code and particularly
necessary to fix issue #991.

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-06-21 17:35:01 +02:00
ManoloFLTK
7d98413d46 macOS 15.0 Sequoia: fix capture of window titlebars
The previous procedure using CGWindowListCreateImageFromArray()
is obsoleted in macOS 15.0 .
The new procedure requires an additional framework: ScreenCaptureKit;
FLTK uses it only for macOS ≥ 15.0
2024-06-14 11:55:53 +02:00
ManoloFLTK
6712130f22 Document how to control window location in screen under Wayland 2024-06-03 15:05:04 +02:00
ManoloFLTK
d792ed21f5 Fix Child Windows under Wayland are clipped on resizing … (#987) 2024-06-02 08:28:40 +02:00
ManoloFLTK
04949f1349 Fix typo in doc of Fl_Double_Window::as_double_window() 2024-05-30 08:26:57 +02:00
Matthias Melcher
e325c2e4a0 Adding new call Fl_Window::get_size_range(), #981 2024-05-26 17:50:47 +02:00
Albrecht Schlosser
d0922792ae Improve fl_contrast() functionality and documentation
- swap 3rd and 4th parameter of fl_contrast()
- change 'Fl_Fontsize fs' to a neutral 'int size' parameter
- clarify documentation of fl_contrast_level() and that different
  contrast algorithms use different level values
- clarify that level 39 for the CIELAB mode results in "sufficient"
  contrast, i.e. /readable/ text which is the only intention of
  fl_contrast().

Reasoning: swapping the arguments looks more natural, i.e. the context
before another argument (size) is what one would usually expect. Since
the 'size' argument doesn't have be a font size, making it a simple
'int size' is more flexible and correct for future extensions.
2024-05-17 14:20:01 +02:00
ManoloFLTK
a9085c3b11 Change member function args to Fl_Menu_Bar::play_menu(const Fl_Menu_Item *) 2024-05-15 11:50:32 +02:00
ManoloFLTK
79c3db48cf New member function Fl_Menu_Bar::play_menu(const char *title) 2024-05-14 17:46:25 +02:00
ManoloFLTK
95eb4cb91a Remove change erroneously committed at 4eb98c0 2024-05-13 13:07:14 +02:00
ManoloFLTK
4eb98c0af4 Fl_Menu_Bar: document how to programmatically open menu from menubar 2024-05-13 12:46:47 +02:00
Albrecht Schlosser
e5afb8a532 Enable suppression of "deprecated" warnings (FL_NO_DEPRECATE)
This is intended for backwards compatibility with FLTK 1.3.x code
ported to 1.4.0.

Users defining FL_NO_DEPRECATE can compile old (1.3.x) code w/o
seeing lots of "deprecated" warnings. A legitimate use case is if
old (1.3) code is intended to be used with both FLTK 1.3 and 1.4.

FL_NO_DEPRECATE should NOT be defined if the user's code is targeted
at 1.4.x or later. Users should fix their code to be prepared for
the next minor release (e.g. 1.5.0).

Todo: document this.
2024-05-11 17:14:28 +02:00
ManoloFLTK
d428a00443 Have menu items drawn with same colors in all platforms (#969)
Also, remove this text from the doc of Fl_Menu_::down_box()
    "If this is FL_NO_BOX then it acts like
    FL_THIN_UP_BOX and selection_color() acts like
    FL_WHITE, for back compatibility."
that was true only for the Windows platform and that required
selection_color to be replaced by white for menu items which is
not what FLTK 1.4 expects.

The new state of menu item drawings is as follows :
- all platforms draw menu items with the same symbolic colors
- selected items and menu titles are drawn with the selection color
as background color
- menu items are drawn by default with no box but can be given one
by Fl_Menu_::down_box(Fl_Boxtype)
- the text of selected items is drawn with the menu's color
unless fl_contrast() finds it does not make enough contrast with
the background (selection color) and substitutes it with a more
adapted color
- the Windows platform uses a visibly different hue for its default
selection color from what other platforms use
2024-05-08 13:26:13 +02:00
ManoloFLTK
9472ff546c Implement and document new class Fl_PDF_File_Surface 2024-04-30 10:22:47 +02:00
Matthias Melcher
281ec24c8f Box types can now defined and draw their own focus frame, STR 2145, #659 2024-04-26 12:42:11 +02:00
ManoloFLTK
5ec7176e81 Fix for Fl_Native_File_Chooser::filter_value() - cont'd (#899) 2024-04-22 18:35:59 +02:00
ManoloFLTK
abfc8ee52f Fix: Fl_Native_File_Chooser::filter_value() [Kdialog] always returns 0 (#899)
- remove build option FLTK_USE_KDIALOG replaced by an Fl::option() option
- new run-time option OPTION_FNFC_USES_KDIALOG
- make options OPTION_FNFC_USES_KDIALOG and OPTION_FNFC_USES_ZENITY
false by default
- add mention of new program fltk-options in the doc of Fl::option()
- change logic of choice of the native file chooser under X11/Wayland:
the zenity and kdialog choosers are opt-in; otherwise the GTK file chooser
is used, unless opted out with  OPTION_FNFC_USES_GTK
- document that zenity may be interesting for sandboxed apps
- document that both zenity and kdialog make member functions
Fl_Native_File_Chooser::filter_value() inoperable
2024-04-22 16:34:08 +02:00
Albrecht Schlosser
2c21e520f4 Fix potential compiler warnings in public headers [-Wshadow]
These warnings would be issued if users compiled their programs with
diagnostics '-Wshadow' turned on using gcc, clang, and maybe other
compilers.
2024-04-18 16:27:29 +02:00
Albrecht Schlosser
8ca1e0ca03 Fix 'int Fl_Menu_::value()' if item is in a submenu (STR 3241)
More precise: ... if the last picked item is in a "detached submenu",
i.e. in one addressed by another menu item with the FL_SUBMENU_POINTER
flag set.

Also: document *why* this is the case, and what the result value is.
2024-04-17 19:14:59 +02:00
Matthias Melcher
2818a36064 Add example to fl_arc docs. 2024-04-14 14:09:02 +02:00
Albrecht Schlosser
05a95e146b Fix Fl_Terminal::handle_unknown_char() for plot_char() (#948)
- Add 'int Fl_Terminal::handle_unknown_char(int drow, int dcol)'
  to write the "unknown" character to the intended display position.

- Define Fl_Terminal::unknown_char as a static variable to avoid
  redundancy. In the future this might be overridden by users.
2024-04-09 12:53:12 +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
ManoloFLTK
fe6ab4ebc2 Fix documentation example of the FL_FUNCTION_CALLBACK_#() macro 2024-04-05 10:57:46 +02:00
Albrecht Schlosser
9d9646fb12 Fix compiler warning, part 2 of #946 2024-04-04 23:40:29 +02:00
Albrecht Schlosser
3ac16f1dc4 Fix compiler warning, part 1 of #946 2024-04-04 22:59:08 +02:00
Albrecht Schlosser
7a879568b3 Improve support for NetBSD (#944)
- fix gcc version check for FL_DEPRECATED macro

- fix #include for select() on NetBSD < 3.0 (#944)

For more info please see GitHub Issue #944
2024-04-02 16:03:00 +02:00
ManoloFLTK
0fa49f0ab4 Use type cairo_region_t* for Fl_Region under Wayland platform 2024-03-20 15:20:31 +01: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
5af2d77b84 Add more public accessor methods to Fl_Grid (#937)
Some of these accessor methods should be private so they can't be used
by user code but - due to compiler issues - they must be public for
HP-UX 11.11 (for details see GitHub Issue #937).
2024-03-18 23:23:49 +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
Greg Ercolano
13526f04ab Make Fl_Terminal selection_text() methods public
As per Albrecht's request on fltk.coredev..
2024-03-12 13:18:54 -07:00
Albrecht Schlosser
c8960dd4e2 Add key name FL_Alt_Gr for AltGr on international keyboards 2024-03-09 13:53:34 +01:00
Albrecht Schlosser
3ac007541e
Add horizontal scrollbar to Terminal widget (#928)
* Checkpoint. Basic functionality seems to be working.

* Code cleanup

* Added horizontal scrollbar to Terminal widget

* Fix hscrollbar_size operation

* Applied erco-terminal-mods_v5_final.patch.txt
Final patch relating to PR 918

* Remove trailing whitespace, update copyright year

---------

Co-authored-by: Jonathan Griffitts <jonathan.griffitts@gmail.com>
Co-authored-by: Greg Ercolano <erco@seriss.com>
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-03-06 21:16:11 -08:00
ManoloFLTK
4db9391525 Update doc about Ctrl/+/-/0/ zoom shortcuts 2024-03-03 08:15:42 +01:00
Greg Ercolano
257e20e929 Added Fl_Terminal::text() and docs 2024-03-02 22:47:45 -08:00
Matthias Melcher
f1c9b198bb Promote fl_strlcpy to <FL/fl_string_functions.h> 2024-03-02 23:49:35 +01:00
ManoloFLTK
b74099c5fd Add OPTION_SIMPLE_ZOOM_SHORTCUT to fine tune zoom-in shortcut 2024-03-02 17:25:10 +01:00
ManoloFLTK
fc46e771cd Improve prioritization of event handlers added at open display time 2024-02-27 16:20:25 +01:00
ManoloFLTK
957becbe28 Fix: fl_height(int, int) decreases the font size after each call (#915) 2024-02-21 09:38:24 +01:00
Matthias Melcher
2f343ad64d
Fix Terminal character position and add word selection (#906)
* Improve horizontal interactive selection
* Using half-character positions to implement selection
  similar to Fl_Input.
* Add word and line selection
* Fix vertical position of text
2024-02-18 13:29:37 +01:00
Greg Ercolano
eb4916344b Clear screen also clears attributes/xterm modes (#911)
Clear was setting characters to a space using the current style,
but if the style left Dim/Bold/Inverse (etc) enabled, that was being
used to affect the clear character, and thus affected clearing screen.

Seems weird tho; what if one wants to do a cleol (\033[K) on a screen
that is all inverted text; is there no way to use inverse mode for
clearing to the end of line? Or to delete a character?
2024-02-17 07:59:42 -08:00
Greg Ercolano
58a1496389 Fixed Fl_Terminal xterm color 39/49 handling, and other mods.
Fixed a bug in the handling of xterm color 39 + 49, which avoids
applying Dim/Bold if default color is the special "see through" color
0xffffff00. A test will be added to test/terminal to excercise this
in a follow up commit.

Renamed CharStyle::?gcolor_uchar() -> CharStyle::?gcolor_xterm()
for a consistent naming convention.

Changed fltk_fg_color() from a static func to a CharStyle method
because it needs to access the defaultcolor for the special cases
for xterm colors 39 and 49.

Made CharStyle::attr_color() private, as per Jonathan Griffitts request
in issue #909.

Improved docs regarding effects of Dim/Bold for xterm and non-xterm color
methods.

Fl_Terminal::text?gcolor_xterm() methods now use CharStyle::?gcolor_xterm()
methods, removing the duplicate code logic.
2024-02-16 13:10:06 -08:00