Commit Graph

205 Commits

Author SHA1 Message Date
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
Albrecht Schlosser a877466a21 Fix illegal memory access after free when closing fluid (STR #3427).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12567 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-18 18:13:06 +00:00
Albrecht Schlosser f3896460d6 Replace chdir() with new wrapper fl_chdir().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12558 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-12 18:00:45 +00:00
Albrecht Schlosser 06ca7993a5 Replace remaining calls to getcwd() with fl_getcwd().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12501 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 13:04:45 +00:00
Albrecht Schlosser 1ff9144801 Replace remaining calls to access() with fl_access().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12499 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 11:47:01 +00:00
Albrecht Schlosser a8b58f6b79 Replace inappropriate usage of __WATCOM__ with _MSC_VER.
Note: this is in parts temporary since some of the functions redefined
for Visual Studio will be replaced with fl_*() functions in later commits.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 10:46:16 +00:00
Albrecht Schlosser 41f92be2f1 Replace remaining calls to unlink() with fl_unlink().
Tested under Linux, MinGW, and Visual Studio 2015.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12496 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 10:18:53 +00:00
Albrecht Schlosser 66b1690aa8 Replace remaining calls to getenv() with fl_getenv().
... except in driver code that uses Fl_System_Driver::getenv().

Todo: Check if all remaining calls of getenv() in driver code are correct
or might use ::getenv() to avoid one calling level for optimization.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12492 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-13 14:58:30 +00:00
Greg Ercolano 43c98c7c90 Bring over combined fix [r12044] from 1.3 current to the porting branch.
Applied patch from STR #3335 to fix simple GUI issues.
 


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12045 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-17 19:20:36 +00:00
Greg Ercolano 8850c5c822 Adds external editor capability to fluid for all platforms.
Solves STR#3213. [CORRECTED]



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11818 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-07-18 21:12:25 +00:00
Manolo Gouy b870641f34 Begin to remove platform-specific code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11705 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-27 17:02:57 +00:00
Albrecht Schlosser 7e04657ce7 Remove obsolete EMX (DOS, OS/2 extender) support.
This commit changes all files except src/Fl_File_Chooser2.cxx.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11590 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-12 17:53:18 +00:00
Albrecht Schlosser aafd8b6031 Fix VisualC++ build (Visual Studio 2015).
IDE generated with CMake, still many warnings, but compiles and runs.

Note: we *must* get rid of all VisualStudio-specific #define's like:

 #define unlink _unlink

This one led to a compilation error (not a warning).

src/Fl_File_Icon.cxx: I had to add _MSC_VER (WIN32) distinction as in
  previous code (FLTK 1.3). Obviously MinGW is more Unixy than MS VC++
  since MinGW compiled and linked the code. Needs a better fix ...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-11 00:46:11 +00:00
Manolo Gouy 915d6c643a Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 14:36:11 +00:00
Manolo Gouy 01e991840c Remove a bunch of useless #include <FL/x.H> directives.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11422 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-25 16:06:00 +00:00
Albrecht Schlosser 5573c35ff1 Fix spelling errors and improve documentation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10759 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-15 20:24:41 +00:00
Albrecht Schlosser c96c4c35b0 Add 'fluid -u' command-line switch to upgrade fluid files in batch mode.
This option opens a fluid ('.fl') file and saves it overwriting the old
file with the current syntax and library version number.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10611 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-09 20:37:45 +00:00