Commit Graph

1240 Commits

Author SHA1 Message Date
Albrecht Schlosser
727bd94560 Add commandline conversion for Windows (no-op on other platforms)
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8

This new function closes the gap that previously only Visual Studio
applications converted their commandlines to UTF-8.

Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
2023-11-29 16:29:54 +01:00
Albrecht Schlosser
a0e4a3fd5d Minor fixes and window size_range in new test/tile.cxx
Also add comments to clarify what "old" and "new" code is,respectively.
2023-11-29 14:42:06 +01:00
Albrecht Schlosser
57371365d8 Fix compiler warning, dependencies, and trailing whitespace
The benign warning was:
  ‘Fl_Browser_::hscrollbar’ will be initialized after [-Wreorder]
  ‘int Fl_Browser_::linespacing_’ ...
2023-11-27 15:33:53 +01:00
Matthias Melcher
34ed30fe1a Adds linespacing() to Fl_Browser_ and all derived widgets 2023-11-25 18:20:08 +01:00
Matthias Melcher
0beab855a0 Stabilizes Fl_Tile size_range mode.
- improved documentation
- new tile resize strategy
- robust against zero sized children
2023-11-23 17:19:20 +01:00
Matthias Melcher
81e26b9089 Adding size range settings to Fl_Tile, initial commit.
- some documentation missing
- Fl_Tile::resize() not satisfying yet
- minimums work, maximums currently ignored
- 0 size children may make program hang
2023-11-22 14:45:13 +01:00
Greg Ercolano
c568056244 Added output_translate(): controls lf -> crlf translation 2023-11-21 11:24:27 -08:00
Albrecht Schlosser
8b352987f6 Fix compiler warning
"extended initializer lists only available with ‘-std=c++11’ ..."
2023-11-19 19:46:36 +01:00
Albrecht Schlosser
9eaf40dd13 Small improvements of test/grid_dialog.cxx 2023-11-18 19:38:18 +01:00
Albrecht Schlosser
f19f94d284 Add Fl_Grid based dialog demo program - part 2
Add forgotten source file.
2023-11-18 18:43:54 +01:00
Albrecht Schlosser
efe3ea7115 Add Fl_Grid based dialog demo program
This is a new test program for Fl_Grid based layout and a proof of
concept for a future dialog class based on Fl_Grid.
2023-11-18 18:37:55 +01:00
Albrecht Schlosser
367d302b5f Apply two patches provided by user 'Andre' via mail
1. add missing FL_EXPORT to class Fl_Terminal
2. add missing test/wizard demo to test/Makefile
2023-11-17 19:27:00 +01:00
Greg Ercolano
38fc08c15f Added clear(), some methods protected->public
New public methods:

    void clear(void);
    void clear(Fl_Color val);

old protected methods made public:

    void clear_screen(bool scroll_to_hist=true);      // ESC [ 2 J
    void clear_screen_home(bool scroll_to_hist=true); // ESC [ H ESC [ 2 J
    void cursor_home(void);                           // ESC [ 0 H

test/terminal modified to test these, and added separate tests
for both the API and ANSI code ways to do these ops.
2023-11-16 15:45:29 -08:00
Matthias Melcher
ed7c2f1464 Fixes test/terminal box type 2023-11-15 16:46:10 +01:00
Matthias Melcher
d5a9be6b5e Uses the correct Fl_Terminal type in terminal.fl as well 2023-11-15 15:59:34 +01:00
Matthias Melcher
fc03d304e7 FLUID: fixing test/valuator.fl and test/tree.fl
Using Fl_Terminal widget instead of subclassing from Fl_Group
2023-11-15 15:48:22 +01:00
Greg Ercolano
605328e045 Added textcolor() and color(), doc fixes.
textcolor() needed for consistency, color() behavior documented.

Both added to the test/terminal app.

Elaborated on the special background "see through" color value + behavior,
tested with color() in test/terminal app.
2023-11-14 12:23:23 -08:00
Albrecht Schlosser
155909ec30 Fix compiler warning (suggest-override) 2023-11-14 19:02:08 +01:00
Albrecht Schlosser
4b315d190c Fix dependencies and whitespace issues 2023-11-14 18:14:48 +01:00
erco77
6842a43a31
Fl_Terminal widget (#800)
Pull Fl_Terminal widget from Greg's fork
2023-11-14 07:01:52 -08:00
ManoloFLTK
0ae927a00e Add Fl_Window::maximize() and Fl_Window::un_maximize() 2023-11-05 19:42:55 +01:00
Albrecht Schlosser
d9798d2840 CMake: Refactor building OpenGL and "shared" demo programs
Define GLDEMO_LIBS and GLDEMO_SHARED: these definitions can be used
  to build OpenGL demo programs that can also be built w/o OpenGL

Examples: fullscreen, handle_events, unittests
2023-11-03 15:40:58 +01:00
Albrecht Schlosser
566f3634f9 Fix compiler warning when fullscreen demo is built w/o OpenGL
Warning: -Wsuggest-override
2023-11-03 15:34:23 +01:00
Albrecht Schlosser
1209e9dcd7 Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
  selected functions and methods

Experimental, may be removed before release:

- use either Fl_Int_Vector or std::vector in Fl_Table depending
  on CMake OPTION_USE_STD or configure --enable-use_std

Move all fl_filename* functions that use Fl_String to fluid

Main changes in fluid:
 - add fluid_filename.h and .cxx
 - include "fluid_filename.h" rather than <FL/filename.H>

Update fl_input(), fl_password() and test/ask

- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
  std::string if enabled (FLTK_USE_STD)
2023-10-22 19:35:17 +02:00
Matthias Melcher
bbf0ea664d Removes dependency on Fl_Preferences::get/set(.., Fl_String, ...) 2023-10-21 18:41:57 +02:00
Albrecht Schlosser
757b5c1227 Fix ctrl/+/- in cube demo
- Fl_Grid: force layout() on resize() - needed for GL subwindows

- test/cube.cxx:
  - use end() in constructor of class cube_box
  - ensure not to change the current group when adding a button
2023-10-20 11:28:08 +02:00
Albrecht Schlosser
38871c5b31 Add Fl_Grid widget and test and demo programs
- FL/Fl_Grid.H: header file
- src/Fl_Grid.cxx: implementation

- examples/grid-simple.cxx: simple example program
- test/cube.cxx:            use Fl_Grid for layout
- test/grid_alignment.cxx:  test cell alignment and other functions
- test/grid_buttons.cxx:    demo program as discussed in fltk.general
- test/grid_login.cxx:      like test/flex_login.cxx but with Fl_Grid
- test/flex_login.cxx:      modified to match test/grid_login.cxx
2023-10-16 22:18:24 +02:00
Albrecht Schlosser
7e71cea54a Update .gitignore files
Add missing executables
2023-10-16 21:10:27 +02:00
Albrecht Schlosser
6ba7b49baf Improve subclassing cababilities of Fl_Tile (STR 2791)
- remove static variables and functions
- make move_intersection() virtual
- add (protected) cursor access methods

These changes were inspired by STR 2791 where the user proposing an
enhancement was not able to subclass Fl_Tile properly. This commit
fixes the mentioned issues and enables subclassing without copying
internal code.
2023-10-16 13:33:40 +02:00
Albrecht Schlosser
01038e832a Fix trailing whitespace and dependencies 2023-10-13 19:08:30 +02:00
Matthias Melcher
0af27f6fda test/menubar: use popup menu default boxtype 2023-10-13 12:11:16 +02:00
Albrecht Schlosser
1fd6f0dd3a Fix STR 3458: "GLUT compatibility mode segfaults"
... "when there's no current window".

Silently ignore GLUT function calls that need a current window if the
current window is NULL, return 0 from functions that return an 'int'.

Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers().
This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise.

Note: the chosen implementation to ignore GLUT calls silently appears
to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error
messages and exit. The latter could be implemented as well but would
be much more work.
2023-10-07 17:14:11 +02:00
Matthias Melcher
f3eae58c52 Draw parent window backdrop on Fl_Tabs (#718) 2023-09-29 14:12:39 +02:00
Matthias Melcher
71b8e77935
FLUID: adds greatly enhanced Shell Commands (#774)
The user can add an arbitrary number of highly configurable 
shell commands through the setting panel. The commands can
be saved as user preferences, inside the .fl file, or exported
to an external file. Shell scripts can be limited to individual 
platforms, can have shortcut keys, etc. .

* documentation will follow
* support to call `fltk-config` will follow
2023-09-26 16:01:03 +02:00
Matthias Melcher
0a2f05a2fe FLUID: Fixes regression #777
Wrote wrong path in #inlude statement under certain
conditions. Also removed 'snap' tag if not needed.
2023-09-26 00:29:26 +02:00
Albrecht Schlosser
226a4ea784 Fix potential invalid stack variable access in test code
This code was (and is still) commented out but it *would* trigger
a "stack buffer overflow" error *if* uncommented.

The new code demonstrates how a binary object (Fl_Preferences 'bed')
can be dumped to a preferences file in binary format (if activated).
2023-09-22 14:03:34 +02:00
Albrecht Schlosser
43ff6f0c32 Update dependencies 2023-09-22 14:03:34 +02:00
Albrecht Schlosser
ede381c005 Fix Visual Studio shared library build
Todo: fluid-shared can't (yet) be built agains the shared fltk lib
  because of some linker errors. Needs investigation.

Note: fluid-shared is basically a test program to demonstrate linking
  against the shared FLTK libs but doesn't work yet using VS (MSVC).
  This is no problem for the functionality.
2023-09-12 23:18:46 +02:00
Albrecht Schlosser
e44a988c4a Fix unittest object file list in test/Makefile (#683) 2023-09-08 15:30:06 +02:00
Matthias Melcher
6bb5a81cee Adds some convenience methods.
fl_filename_absolute can no generate a path using arbitrary source paths.
Fl_Menu_ adds find_item_with_user_data and find_item_with_argument
Fl_String adds find(string, start)
2023-09-05 14:45:57 +02:00
Matthias Melcher
5e8adebac2 Adds compact buttons feature to create keypads.
See test/buttons for an example.
2023-09-03 00:09:40 +02:00
Matthias Melcher
92ac709b7e Adds safe versions of fl_filename_*, returning Fl_String 2023-08-26 16:48:28 +02:00
ManoloFLTK
754340e101 macOS audio is usable with XQuartz 2023-08-16 11:18:19 +02:00
ManoloFLTK
4aae2d1224 Allow build of sudoku app with macOS + XQuartz 2023-08-16 10:27:41 +02:00
Matthias Melcher
e8b378302c Undoing previous changes 2023-08-15 22:59:07 +02:00
Matthias Melcher
3b093e895b Lot's of changes, must rethink UI. 2023-08-15 17:09:51 +02:00
Matthias Melcher
af22676abf Missing includes 2023-08-15 17:09:51 +02:00
Matthias Melcher
0de186e614 Sudoku into smaller pieces. 2023-08-15 17:09:51 +02:00
Matthias Melcher
a1b55385e3 Random testing and fixing. 2023-08-15 17:09:51 +02:00
Matthias Melcher
d27188198a Removed unused code 2023-08-15 17:09:51 +02:00