Commit Graph

221 Commits

Author SHA1 Message Date
Matthias Melcher 71088b7fe2 FLUID mark project change when changing window visibility 2023-07-11 14:27:58 +02:00
Matthias Melcher 982d104adb FLUID: Initialisation orner in menus: #722 2023-04-26 20:24:33 +02:00
Albrecht Schlosser 652b69842b Fix tiny memory leak in fluid (setting scheme)
Also initialize 'scheme_name' to make static code analyzer happy.
2023-04-14 19:52:33 +02:00
Matthias Melcher f37347dd6e
Fix and consolidate settings dialogs (#346, #703) 2023-03-19 20:04:01 +01:00
Matthias Melcher 5c482f9d9b
Fix and update alignment #346 (#701)
* interactive layout alignment rewritten
* interface for new alignment rules
* new alignment dialog box
* user defined layout rules added
* layout rules can be stored in projects, settings, and external files
* Valgrind verification
2023-03-18 17:33:27 +01:00
Matthias Melcher 9f87af8ad9
Fl_String refactoring and extension (#683)
- add true unittest and Fl_String testing
- interface and printout are similar to gtest
  without requiring external linkage.
  just run `unittest --core`.
- new Fl_String API
- extended API to fl_input_str and fl_password_str
- co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2023-02-23 15:42:05 +01:00
Matthias Melcher 179771acd2
Fixing FLUID file corruption from issue #653 (#662)
Removing all globals in file writer (#653 )
Fix some static analyser complaints
Valgrind: handle width==0 in GfxDrivers on Wayland and X11
Don't use `Fl_Input_::static_value`, it accesses previous
buffer that may be deleted
Project file write encapsulated, removing globals
Encapsulating project file reader, removing states in glbals
Project i/o increased source code readability
2023-01-26 15:23:43 +01:00
Matthias Melcher 1fc269b0d4
Move global FLTK options into new app fltk-admin (#560) 2023-01-21 17:14:41 +01:00
Albrecht Schlosser bafd3fd3d7 Add Fl_Scheme_Choice widget and use it in test programs
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.

Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.

Todo:
 - add features to add new schemes during runtime (partially done)
 - update status when the scheme is changed by Fl::scheme("...")
2023-01-12 19:21:09 +01:00
Matthias Melcher a63ad76603
FLUID refactor and macOS warnings removed (#623)
P renamed to g_project
class Project renamed to class Fluid_Project
fixes macOS type cast warnings
2023-01-01 20:05:42 +01:00
Matthias Melcher d98c663893
Fix compilation on old gcc (#606)
* Fixing char* use in FLUID
* Fixing const cast
2022-12-22 00:18:01 +01:00
Matthias Melcher fa41211cca
FLUID event handling and UI changes (#575)
* Full support o when()
* Making undo suspend nesting
* Finally correct undo handling for Label: input
* Documentation.
* Adding more undo checkpoints for the Widget Panel
* Quick selection of default user_data types
* Pulldown menu for system colors
* Make sure that partially typed text fields are propagated before saving
2022-12-10 13:11:49 +01:00
Matthias Melcher 8f9728d511 Fix -o and -h command line arg handling 2022-11-29 00:05:00 +01:00
Matthias Melcher 6e5c472cf9
Handle Fluid project settings better (#556)
Fix allocation bug in Fl_String
2022-11-26 01:35:50 +01:00
Albrecht Schlosser b1ba37c5ba Add "Oxy" scheme (STR 2675, STR 3477)
This commit is similar to the patch given in STR 3477, oxy_v5.diff:
https://www.fltk.org/strfiles/3477/oxy_v5.diff

... with modifications, and updated to current FLTK code.
2022-11-25 00:00:48 +01:00
Matthias Melcher 817a97bb65 Fluid: Fix variable naming and a memory leak 2022-11-23 15:18:01 +01:00
Matthias Melcher be6e5fad72 Fluid: Fix commandline parameter error message 2022-11-23 10:59:43 +01:00
Matthias Melcher 3ecae0459c
Improve Fluid argument handling and relative paths. (#545)
Fix typos, fix merge conflict.
2022-11-15 17:48:06 +01:00
Matthias Melcher 56cba05672
Fluid Fl_Widget::image() path fixes. (#536)
* Adding strings and design file to source view panel

* Fluid: Fixed source dir recursion, fixed relative image reading path.

* Renaming source_dir to designfile_dir in some functions.
2022-11-09 23:12:55 +01:00
Matthias Melcher 09eff7243a
Fixing and upgrading Fl_Preferences (#374)
* Added filename function to Fl_Preferences

Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.

* ERROR is a macro on Windows, don't use it

* Added Fl_Preferences::dirty().

User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.

* Fl_Preferences::get binary data returns # of bytes read.

* Verified group deletion code

* Fl_Preferences ignores locale.

This will make .prefs files interchangeable
between different computers.

* Updating the Preferences Mode to ignore locale.

* Fixes in docs.
2022-01-19 16:08:29 +01:00
Albrecht Schlosser 92e9181a0a Rename FL/fl_string.h to FL/fl_string_functions.h
This is part 1 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
Matthias Melcher 29531873ea STR 3289: Fluid i18n, gettext, catguts improvements
Removed some unneeded code.
2021-12-19 02:03:05 +01:00
Matthias Melcher 3626e82057 GitHub #326: browser scrolling should be much improved
Code now convinces browser to rebuild when the tree changes by UI.
When widgets are move, the current widget should always be visible.
It's the responsibility of the UI callback to update the browser.
2021-12-17 18:38:26 +01:00
Matthias Melcher 160832ce04 STR 3442: copy/paste now inserts widget as expected.
Fluid would add pasted widgets as the last child of the
current group, even if they were cut at the beginning
of the group. This patch adds a 'startegy' to adding
widgets to allow merging closer to the 'current' widget.

Also added d'n'd for the widget bin and some other
UI improvements.

STR 3442: some preparation, variable renaming

STR 3442: unifying functions to add widgets.

Adding widgets interactively is merged into one function,
making undo/redo work as expected and removing
unexpected differences between adding by menu or bin.

STR 3442: adding drag'n'drop for windows from bin.

Just drag the window symbol out of the tree and drop it anywhere
on the desktop.

Visual representation of dragged Window.

STR 3442: insert individual nodes after 'current'

STR 3442: adding new widget at expected positions.

The widget bin can finally do drag'n'drop.
Widgets appear in the tree close to the last selection.
Duplicating now ads right below.
Cut and paste inserts after last selection.

Fluid: replaced #define with strict enum type.
2021-12-13 18:17:07 +01:00
Matthias Melcher 5655f79d63 STR 3426: indicating in the title bar if the design is newer than the code file.
In this first version, we assume that the code file is newer whenever it is written,
until the current design is modified in any way. So instead of a status bar at the bottom
of the main window, the title bar will now show the status of the design and the code at
the same place.
2021-12-10 01:22:24 +01:00
Matthias Melcher 4f2febd801 Fluid STR 3460.D: Shell commands are now saved in the .fl file (user option)
The shell properties toolbox is completely redesigned:

This dialog box offers a field for a command line and three check buttons
 to generate and save various files before the command is run.

 If the fourth checkbox, "use settings in .fl design files" is checked,
 all shell settings will be store in the current .fl file, and they will
 be read and restored when the .fl is loaded again.

 Fluid will save different shell settings for different operating system as
 it is common that a different OS requires a different shell command.

 Fluid comes with default shell settings. Pressing the "save as default" button
 will store the current setting in the Fluid app settings and are used for new
 designs, or if the "use settings..." box is not checked.

 Fluid app settings are saved per user and per machine.
2021-12-09 02:48:40 +01:00
Matthias Melcher 1be158a840 STR 3460.b: fixed scrollbar update in widget_browser
Also fixed a bug where a Manu item was accessed by index, which
already was out of sync.
2021-12-08 20:52:51 +01:00
Matthias Melcher 16dae3ea06 Fluid: restructuring and commenting.
tl;dr : making Fluid maintainable, no changes in code execution and logic.

This is a pretty extensive restructuring of the Fluid source tree.
It was neccessary because source and header files were getting
much too big to handle. Many source files had no header, and many
headers declared functions that were in diffrent source files.

Reorganized much of the include statements.
Added comments to some of the files.
Added Doxygen configuration file for standalone Fluid docs.

Tested everything by rebuilding Fluid .fl designs with the resorted
version of Fluid.
2021-12-08 15:52:15 +01:00
Matthias Melcher a646c3f012 Fluid: fixing missing return. 2021-12-05 23:46:11 +01:00
Matthias Melcher ff869e7419 Fluid STR 3460: Shell Cmd would saye code to wrong path. 2021-12-05 23:30:41 +01:00
Matthias Melcher 204ac3dfdf Fluid: adapting menu to pixmap changes. 2021-12-05 00:18:41 +01:00
Matthias Melcher 21a75a18f8 Fluid support for high res graphics
Changing all pixmaps to Hi DPI
Fixed wrong tooltip
Fixed misleading "invisible" indicator
2021-12-04 23:28:07 +01:00
Albrecht Schlosser 6d1f5608ba Support all image depths (1-4) in fl_write_png() 2021-11-11 20:58:09 +01:00
Albrecht Schlosser 500e470d39 Refactor fluid: make fl_write_png() public
The new function fl_write_png() was moved to its own file and is now
publicly available ("exported") so other programs can use it.

This function was used in fluid to write a window screenshot (.png)
together with a template (.fl) to preferences storage.
2021-11-09 20:36:23 +01:00
Albrecht Schlosser b6a69db9a6 Rename 'fileno()' method to 'get_fileno()' for MinGW
See fltk.coredev thread "fltk-1.4 fluid build broken on 32-bit mingw"
https://groups.google.com/g/fltkcoredev/c/W9LWbsNuGZg/m/MW1BVAkeAgAJ

This regression was introduced in commit c8c1f51db7 in an
attempt to fix a Visual Studio (MSVC) warning but broke "old" MinGW
builds that define 'fileno' as a macro.
2021-09-28 12:40:43 +02:00
Albrecht Schlosser c8c1f51db7 Fix MSVC "fileno" warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser 1a8b94162d Fix Windows (VS) compiler warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser c9bee9ba80 Fix fluid output for international languages
The fluid version and other values in .fl files are written as float
values which means that locale settings apply since we enabled the
locale with "setlocale()".

Update the "rebuild" target in fluid and src folders to update
the fluid (.fl) files and related {.cxx|.h} files.
2020-09-16 12:15:54 +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
Greg Ercolano 2141c63628 Implement + deploy fl_strdup() 2020-08-01 14:19:40 -07: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 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
Greg Ercolano 0dc16dd8c9 Added fluid command line '-d' debug flag 2020-06-19 08:59:48 -07:00
Albrecht Schlosser f930e834c5 Fix documentation URL's 2020-04-08 00:53:16 +02:00
Albrecht Schlosser 8a7d4c9f61 Remove CodeWarrior "support"
Metrowerks CodeWarrior was an ancient macOS compiler (discontinued
since 2005) that defined the macro __MWERKS__. Code using this macro
and several comments have been removed.
2020-03-11 14:38:02 +01:00
Matthias Melcher d6294ac2fc Reorganized Fluid Template feature (STR #3336). 2019-02-01 23:16:49 +01:00
Matthias Melcher b71601fe7c STR 3460: shell window remembers position
The Fluid window to display the execute shell command result
is now reopened where it was previously closed.
2019-01-14 00:09:31 +01:00
Matthias Melcher b10524fce2 Avoiding crash when accessing free'd memory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13064 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-09 19:53:05 +00:00
Albrecht Schlosser 52ae3582a2 Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".

To do: README.Windows.txt (and maybe other documentation as well)
needs updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 14:39:42 +00:00
Albrecht Schlosser 42d8aba117 Replace FL/x.H with FL/platform.H - step 2 (STR #3435).
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.

This commit completes the replacement of FL/x.H with FL/platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 21:17:17 +00:00