1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-08-05 00:40:25 +00:00
Commit graph

970 commits

Author SHA1 Message Date
Matt Kilgore
a85f10e35c
Merge branch 'main' into paint-fill-fix 2022-11-08 21:55:53 -05:00
Matthew Kilgore
ac8aac39b7 Use signed type for xdelta and ydelta arrays
I accidentally declared these as uint32_t even though I store -1 in
them. It was working anyway due to the implicit conversion that happens
when adding it to an int32_t, but it should be fixed regardless.
2022-11-08 01:32:05 -05:00
Matthew Kilgore
4f5af8888e Fix PAINT when border color is not supplied
The border color parameter to PAINT is optional, but sub_paint was not
handling that case. What it should do in that situation is keep painting
until it finds pixels that are not the same color as the original
starting pixel was. Instead it would simply assume border color was
valid and paint until it finds color zero (the default parameter value
when it's not provided).

This was originally reported in QB64Official/qb64#2, and Walt
(@TheJoyfulProgrammer) fixed it in QB64Official/qb64#38. Functionally
this is the same change, however I'm checking `passed & 4` to see
whether a border color was provided rather than `bordercol == NULL`.
The later has problems if the provided bordercolor is zero, which is
allowed since zero is a valid color. The `passed` argument indicates
which of the function arguments were actually provided in the QB64
source that called PAINT.

Additionally, along with the `while (true)` loop that Walt changed I
went ahead and removed the duplication of the sections for each
direction. We now just use a couple of arrays to determine which
direction we're checking and loop over all 4.
2022-11-08 00:59:12 -05:00
Matthew Kilgore
90b3bd2662 Address build warnings on tinyfiledialogs.c
A function was made unnecessary but wasn't removed, triggering a
warning. Additionally gcc likes parenthesis around `=` assignments used
for conditions.
2022-11-08 00:49:13 -05:00
Matthew Kilgore
5b238467a9 Use hidden input if defaultText is blank
Fairly simple, this sets the ES_PASSWORD flag when the default text is
blank.

Additionally I fixed the dialog callback to correctly call EndDialog()
rather than DestroyWindow().
2022-11-08 00:49:13 -05:00
Matthew Kilgore
7bf68383d5 Fix warnings, remove unused code in tinyfiledialogs.c 2022-11-08 00:49:13 -05:00
Matthew Kilgore
ee9f8e4404 Remove quote checks on Windows
These are the last of the quote checks, these don't require any
associated changes as the underlying Win32 functions already allow
quotes. They were simply added to keep parity with the functionality on
other platforms, that that has since been fixed.
2022-11-08 00:49:13 -05:00
Matthew Kilgore
ec0ec10652 Add missing static to char array in tinyfd_openFileDialog
Fairly simple, lBuff is used to return the resulting filename and has to
be static so that it's still valid when the function exits.
2022-11-08 00:49:13 -05:00
Matthew Kilgore
0115029e5e Implement InputBox using DialogBoxIndirect
This removes the VBS based InputBox for Windows and replaces it with a
version that uses DialogBoxIndirect to create the dialog. While it is a
bit more complicated in some respects, it removes any concerns about the
contents of the strings as they're no longer being inserted into the
generated script.

It also has the advantage that it doesn't spawn another process (which
then shows up in the task bar in some situations).

With this changes quote characters are allowed in all of the parameters.
2022-11-08 00:49:13 -05:00
Matthew Kilgore
f73a1da97d Fix osascript escaping on Mac OS
Escaping the osascript commands requires two layers of escaping: One for the
script itself, and one for the sh arguments.

For the script itself, we simply have to escape the " character with \". When
then take the result of that and escape it sutably for sh arguments in single
quotes. We already have a function for that so we simply call that to do the
job.
2022-11-07 02:43:29 -05:00
Matthew Kilgore
b20aade638 Swap NotifyPopup to use Shell_NotifyIcon
Fairly straight forward, the Powershell code was fundimentally just
calling Shell_NotifyIcon under the covers which we can easily do
ourself. The notification has to be tied to a window, so I simply create
a hidden one to use.

A nice improvement here is that instead of having to use the Powershell
icon we can make use of the EXE icon if one was provided. If one is not
provided then we use the default 'application' icon.
2022-11-06 01:08:36 -04:00
Matthew Kilgore
c945214cb8 Fix quoting of arguments to dialog functions on Linux
tinyfiledialogs had lots of issue surounding the quoting of the
arguments to the dialog functions. The arguments are effectively placed
verbadim into shell commands, and without any proper treatment they
would get accidentally evaluated by the shell, which is a big problem.
Additionally, any arguments containing quotes would just not work since
they would screw up the underlying shell command.

This change fixes all that for Linux. Every argument to the dialog
functions is now surrounded in single quotes, which prevents any
evaluation of the string by the shell. Additionally, because this is
standard the only chracters that need special treatment are the single
quote characters, and proper escaping for them has been added. The
result is that the dialog functions can now accept arguments that hvae
single and double quotes in them (on Linux).
2022-11-05 00:36:48 -04:00
github-actions[bot]
0d45ec4969 Automatic update of ./internal/source 2022-11-04 23:01:37 +00:00
Matthew Kilgore
980d646317 Add back internal MessageBox function
Unfortunately InForm code calls this function directly via
`DECLARE LIBRARY`. For the moment we're adding it back in to keep those
programs functioning, in the future it may be removed.
2022-10-31 00:14:20 -04:00
github-actions[bot]
e2d8fd6fa9 Automatic update of ./internal/source 2022-10-31 00:56:32 +00:00
Samuel Gomes
2f84616168 Fix _OPENFILEDIALOG$ to accept -1 for allowMultipleSelects& 2022-10-30 04:35:46 +05:30
Samuel Gomes
5c9766ce97 Update tinyfiledialogs to v3.8.9 2022-10-29 17:18:50 +05:30
github-actions[bot]
47ee4fb1ab Automatic update of ./internal/source 2022-10-25 04:53:56 +00:00
Samuel Gomes
7e533a2473 Update test license files 2022-10-25 07:28:35 +05:30
Samuel Gomes
d14d688181 Fix IMAGE_GET_BGRA_... macros 2022-10-25 04:47:27 +05:30
Samuel Gomes
a122331d6d Include stdarg.h in gui.h 2022-10-25 04:34:41 +05:30
Samuel Gomes
56c7936fb4 Address issues mentioned in #216 2022-10-25 04:24:01 +05:30
Samuel Gomes
6b60048d9e Simplify gui_tokenize() 2022-10-24 02:59:51 +05:30
Samuel Gomes
fb00990bab Replace strtok with strtok_r 2022-10-24 02:09:55 +05:30
Samuel Gomes
6a74b3f487 Replace libqb alert, MessageBox & MessageBox2 with tiny file dialogs 2022-10-24 01:24:57 +05:30
Samuel Gomes
98e40c173d Fix common dialogs build.mk bug 2022-10-23 22:44:39 +05:30
Samuel Gomes
327d753206 Move qbs_new_txt_len() declaration to libqb.h 2022-10-23 18:23:35 +05:30
Samuel Gomes
93e58baa1d Common dialogs support 2022-10-23 12:57:02 +05:30
github-actions[bot]
feb2b302d4 Automatic update of ./internal/source 2022-10-10 13:36:10 +00:00
github-actions[bot]
e6a68b810c Automatic update of ./internal/source 2022-10-05 17:30:47 +00:00
Samuel Gomes
a2e77d7557 Only change _SNDBAL stereo panning if x is passed. Mimic old OpenAL behavior. 2022-10-05 15:28:04 +05:30
Samuel Gomes
7e63a68407 Simplify sub__sndplaycopy 2022-10-05 06:31:46 +05:30
Samuel Gomes
f49f8bdf06 Implement _SNDPLAYCOPY enhancement #185 2022-10-05 02:33:44 +05:30
github-actions[bot]
bc1567089c Automatic update of ./internal/source 2022-10-02 22:25:45 +00:00
github-actions[bot]
70b4c1aa5d Automatic update of ./internal/source 2022-10-01 19:14:39 +00:00
github-actions[bot]
18f746018b Automatic update of ./internal/source 2022-10-01 17:41:56 +00:00
github-actions[bot]
e93e389e03 Automatic update of ./internal/source 2022-09-30 16:21:22 +00:00
github-actions[bot]
2f509a192c Automatic update of ./internal/source 2022-09-24 17:47:06 +00:00
Samuel Gomes
c0e3f3608c Add O2 to build.mk 2022-09-18 23:46:54 +05:30
Samuel Gomes
fa0ba3e5d8
Merge branch 'main' into main 2022-09-18 14:49:58 +05:30
github-actions[bot]
8f16eb405d Automatic update of ./internal/source 2022-09-17 23:20:02 +00:00
Samuel Gomes
9681aa1d30 Update code to use C++ unordered_map 2022-09-18 00:03:08 +05:30
Matthew Kilgore
aea4a6058e Fix linking audio when using $CONSOLE:ONLY
A quick fix, but providing `DEPENDENCY_CONSOLE_ONLY` when compiling
audio.cpp tells `common.h` to avoid pulling in `freeglut.h`, which fixes
the linking issue.

Fixes: #172
2022-09-17 03:06:24 -04:00
Samuel Gomes
bb8bd56689 Merge branch 'main' of https://github.com/a740g/QB64PE 2022-09-17 08:53:38 +05:30
Samuel Gomes
a100a434e4 Fix #175 2022-09-17 08:53:32 +05:30
github-actions[bot]
4c8dbec69c Automatic update of ./internal/source 2022-09-11 17:00:19 +00:00
Matthew Kilgore
84f1165776 Fix _MOUSEMOVE when window is resized
`sub__mousemove` is trying to use `x_scale`, `y_scale`, `x_offset`, and
`y_offset` to calculate where the mouse should be in the event the
window coordinates are different from the screen coordinates.

Unfortunately, all four of those variables are actually never set in the
program. The real scale values and offsets (in the event of
letterboxing) are stored in `environment_2d__` values. This change
switches `sub__mousemove` to simply use the correct values when
calculating the mouse position.

Because `x_scale` and `y_scale` are not used anywhere else I just
removed them completely. I wanted to remove `x_offset` and `y_offset` as
well but there are a few spots that make use of it. It must be a bug,
since they are never assigned values other than zero, but I'm not sure
if the correct fix for the other locations is to use the
`environment_2d__` value or do nothing, so I'm leaving them for now and
we can address them later.
2022-09-10 15:31:22 -04:00
Samuel Gomes
73f1b37c82
Merge branch 'QB64-Phoenix-Edition:main' into main 2022-09-10 09:51:51 +05:30
github-actions[bot]
39cd2bf3cf Automatic update of ./internal/source 2022-09-10 02:11:00 +00:00
Samuel Gomes
8425f117a7 Fix #169 & #170 2022-09-10 04:08:31 +05:30