Commit graph

6928 commits

Author SHA1 Message Date
Vadim Zeitlin
b294a6b2bc Merge branch 'config-xdg'
Make it easier to use wxFileConfig in XDG-compliant way.

See #24180.
2024-01-07 16:13:15 +01:00
Vadim Zeitlin
cfdfd14c59 Improve frame size in the listctrl sample
Make it bigger on high DPI displays and smaller on normal ones.
2024-01-07 00:35:39 +01:00
Artur Wieczorek
e2dcdb275b Use wxString() rather than wxEmptyString in propgrid sample 2024-01-06 22:43:01 +01:00
Artur Wieczorek
efa2870cb4 Rename wxPGKeyboardActions type to wxPGKeyboardAction
For regular enumeration singular name is more appropriate.
2024-01-06 22:42:55 +01:00
Artur Wieczorek
3cb3d62212 Use enum class to represent NumericType
This is for better type safety.
2024-01-06 22:42:49 +01:00
Artur Wieczorek
ca3acd7a03 Use enum class to implement wxPGPropValFormatFlags as bitmask
This is for better type safety of the flags.
2024-01-06 22:42:38 +01:00
Artur Wieczorek
031435bd39 Use dedicated function to obtain decimal separator in propgrid sample 2024-01-06 22:42:30 +01:00
Vadim Zeitlin
486865b446 Add wxFileConfig::MigrateLocalFile()
This can be useful for the existing applications switching to using
XDG-compliant config files location as they can just call this function
on startup to keep using the existing file.
2024-01-04 03:23:37 +01:00
Vadim Zeitlin
acf113f3f9 Update copyright years to 2024
Just run misc/scripts/inc_year and commit the results.

See #18690.
2023-12-31 18:56:06 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Vadim Zeitlin
7a306c4a42 Merge branch 'qt-fixes' of https://github.com/AliKet/wxWidgets
Many wxQt improvements and simplifications.

See #24135.
2023-12-27 02:57:14 +01:00
ali kettab
de2762bc02 Fix compilation error in auidemo sample under wxQt
Also fix ID_NotebookNoCloseButton menu item ui update which causes
OnUpdateUI() handler to run forever under wxQt.
2023-12-26 12:45:52 +01:00
Vadim Zeitlin
27585bf2c3 Hardcode minimal widget sample notebook size
Not doing this resulted in the window being tiny by default, so it's
better than nothing, even if it's clearly still not ideal.

See #24154.
2023-12-22 17:40:00 +01:00
ali kettab
7c592ba361 Make WidgetsPage pages scrollable in the widgets sample
Because some pages in the sample contain too much content to fit entirely
in the visible area of the page. Under wxQt port, this is true regardless
of the state of the window (whether it is maximized or not) some content
remains hidden and inaccessible.

Closes #24154.
2023-12-22 12:29:45 +01:00
Blake-Madden
a059061eb7 Replace wxDECLARE_NO_COPY_CLASS with deleted functions in samples
Use standard C++11 way of making classes non-copyable instead of
wx-specific macro.

Closes #24150.
2023-12-22 12:21:54 +01:00
Vadim Zeitlin
bc19ed8387 Scale window size and splitter position by DPI in the sample
Make the window less tiny in high DPI under Windows and adjust the
initial splitter and drawing coordinates too.
2023-12-11 00:46:54 +01:00
Vadim Zeitlin
f667f765eb Initialize member variables in declaration in splitter sample
No real changes, just make things a bit simpler and safer.
2023-12-10 01:31:14 +01:00
ali kettab
5c46947c57 Fix wxStatusBar with field controls under wxQt
Postpone the creation of the QStatusBar fields until the first call to
SetStatusText(). This is to account for any field control added by the
user and also to avoid having to call UpdateFields() multiple times.

wxSTB_ELLIPSIZE_XXX and wxSTB_SHOW_TIPS supports are also implemented now.

The statbar sample is also updated: The OnSize() handler is removed because
it doesn't do much. that is: it is defined to keep the bitmap centered in the
status bar field it occupies if it is resized. but this is already done by the
wxStaticBitmap control, at least under wxMSW, wxGTK3 and wxQt.
2023-12-07 17:20:00 +01:00
ali kettab
2c9fee3d6f Add wxStatusBar::AddFieldControl() to simplify adding controls
This allows user codes to simply designate where their controls should
appear in the status bar without the need to handle wxEVT_SIZE
themselves.

They can still handle the event if the default positioning does not meet
their needs, but the new API is simpler and can be implemented for wxQt.

Closes #24092.
2023-12-05 00:39:04 +01:00
Vadim Zeitlin
6f501fd022 Merge branch 'qt-overlay' of https://github.com/AliKet/wxWidgets
Add native wxOverlay implementation under wxQt.

See #24080.
2023-12-03 15:00:34 +01:00
Tim Eliseo
fce4941404 Add wxHAS_PREMULTIPLIED_ALPHA to abstract if wxBitmap pixels are premultiplied.
All previous relevant platform-specific tests have been changed to use this
symbol. Also, samples/image now premultiplies conditionally, correcting a
visual anomaly on wxGTK.
2023-11-26 13:23:52 -08:00
ali kettab
308f16d97b Fix caret sample under wxQt
wxQt has the same issue as wxOSX fixed here 21e02d5 (render characters
on OSX one by one as fractional widths leads to errors otherwise)
2023-11-23 22:49:15 +01:00
Paul Cornett
222883d98f Avoid Clang -Wcomma warnings
For the few cases that are not trivially avoidable,
use a cast to void to silence the warning.
2023-11-23 09:17:21 -08:00
Vadim Zeitlin
7a73044fd2 Merge branch 'tree-search'
Don't find hidden items when using incremental tree search.

See #24041.
2023-11-17 01:08:19 +01:00
Vadim Zeitlin
163d310369 Use wxTimer::StartOnce() instead of wxTIMER_ONE_SHOT
This is more readable and shorter, so encourage using this form.

No real changes.
2023-11-07 19:01:38 +01:00
Vadim Zeitlin
f9a22962e0 Add wxTreeCtrl::GetStateImageCount() and HasStateImages()
Add these functions for consistency with SetStateImages() and to avoid
using GetStateImageList() in the treectrl sample, which can now use
GetStateImageCount() instead.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
a5449a94a1 Add high DPI versions of state icons to the treectrl sample
This allows to check that the high DPI are really used in high DPI,
instead of scaled up versions of the smaller icons.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
308e902102 Add wxTreeCtrl::SetStateImages()
Unlike the existing SetStateImageList() function, the new one allows to
provide the high-resolution versions of the state images too.

Update the treectrl sample to use the new API.

Closes #23993.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
bc4a99d3c4 Fix initial size of treectrl sample window in high DPI
Adjust it to the DPI as it was way too small at 200% scaling.

Also stop passing parameters to MyFrame ctor, it's only used once so we
can just as well hardcode them in it to simplify things a little.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
188dc81d6e Extract custom wxBitmapBundleImpl in treectrl sample
No changes yet, just prepare for using this class in another function.

This commit is best viewed with Git --color-moved option.
2023-11-03 00:53:39 +01:00
Vadim Zeitlin
366d06847b Remove confusing boolean parameter from treectrl sample
Don't use CreateStateImageList(true) to delete the image list.

No real changes, just make the code more understandable.
2023-11-03 00:53:39 +01:00
PB
220031c0da Fix buttons missing in widgets sample after recent changes
The Clear log and Exit buttons were not shown after the changes
in a69fabe (Fix using wxStaticBoxSizer in samples, 2023-10-22).

Fix this by creating them with the proper parent.

Closes #24005.

Closes #24007.
2023-10-29 02:47:46 +02:00
PB
a69fabecb1 Fix using wxStaticBoxSizer in samples
If a control is contained in a wxStaticBoxSizer or its child sizer,
wxStaticBoxSizer::GetStaticBox() should be used as the control's parent.

However, widgets and dialogs samples did not do that, which resulted in
flooding the message log in widgets sample with warnings about this; in
dialogs sample the warnings were shown in the debug output.

Fix this by always using the static box as the control's parent when the
control is contained (directly or indirectly) in a wxStaticBoxSizer.

Closes #23967.
2023-10-22 01:27:55 +02:00
Vadim Zeitlin
e43f913313 Remove all blank "Modified by:" lines from top comment blocks
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.

Keep the non-blank lines for historical purposes.
2023-10-22 01:22:48 +02:00
Vadim Zeitlin
6f9f4c6dbe Call wxYield() while showing wxBusyInfo in the dialogs sample
Otherwise it can't be seen at all with wxGTK.
2023-10-03 16:28:55 +02:00
Vadim Zeitlin
95bd6d4cfa Suppress bogus GTK errors from wxNotebook in preferences sample
Call GTKAllowDiagnosticsControl() to let the code in wxNotebook
suppressing them have an effect.
2023-10-01 17:13:01 +02:00
Maarten Bent
abdbe661c4
Update listctrl example to recent wxListCtrl checkbox changes
Don't override CheckItem/IsItemChecked, but handle the checked/unchecked events.
2023-09-30 17:43:40 +02:00
Artur Wieczorek
3b7d81b7f2 Use C++11 standard library to generate pseudo-random numbers 2023-09-22 23:39:53 +02:00
Artur Wieczorek
a3b7839c41 Add wxFlagsProperty demonstration to propgrid sample 2023-09-22 23:39:53 +02:00
Artur Wieczorek
5a87cbdf3d Use enum class to represent wxPGKeyboardActions 2023-09-22 23:39:53 +02:00
PB
8efb1bceda Fix crash due to logging bug in the event sample
The gestures frame created its own log target and deleted
the previous one but did not restore it when being closed.

This left the current log target invalid which led to a crash
when calling any wxLog*() function after gestures frame was closed.

Fix this by restoring the previous log target when gestures frame
is closed.

Closes #23767.

See #23881.
2023-09-21 22:56:49 +02:00
Vadim Zeitlin
ff5c972b7f Set proxy to the environment variable value for all backends
Don't do it just for Edge one, as WebKit-based one supports it too and
the example code is nicer without the extra checks.
2023-09-07 15:33:39 +02:00
Vadim Zeitlin
0fd6cf99a3 Implement wxWebView::SetProxy() for Edge backend
Currently it can only be called before Create() because it has to be
passed via the additional browser arguments and can't be changed later.
2023-09-07 15:33:39 +02:00
Vadim Zeitlin
7c5d30fb32 Add wxWebView::SetProxy() and implement it for WebKit2 backend
Update the sample to allow specifying the proxy in it.
2023-09-07 15:33:39 +02:00
Vadim Zeitlin
00366cbaae Merge branch 'animation-hidpi'
Add support for specifying multiple animations to allow automatically
showing a higher resolution version when using high DPI, just as it was
already possible with the bitmaps.

See #23817.
2023-08-29 01:53:36 +02:00
Darrell Wright
13aa094ea6 Fix crash in "View text" dialog of the webview sample
Set the sizer on the dialog and not the main frame itself.

Closes #23830.
2023-08-28 02:14:00 +02:00
PB
7a3f6b6847 Fix displaying file size in sockets/client sample
When testing downloading with wxURL and header Content-Length
is not available, display "n/a" as the file size instead of
the value of (unsigned long)-1.

Closes #23825.
2023-08-26 23:20:36 +02:00
Vadim Zeitlin
7f5899e139 Improve manifest-related comments in samples resource file
In particular explicitly mention that wxUSE_DPI_AWARE_MANIFEST has no
effect unless wxUSE_RC_MANIFEST is set to 1.

Closes #23816.
2023-08-26 17:20:19 +02:00
Vadim Zeitlin
27e80f81b4 Add high DPI support to generic wxAnimationCtrl
Allow specifying multiple animation versions, for different resolutions,
when setting the animation to use via wxAnimationBundle class which is a
much simpler version of wxBitmapBundle used elsewhere.

This is not implemented for the native GTK version yet.

Update the sample, even though the difference in it is not really
noticeable as the "high DPI" throbber is just a scaled up version of the
existing standard DPI animation produced using gifsicle.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
cc5f5f90b0 Show high resolution bitmaps in wxBusyInfo if available
Instead of always scaling the single bitmap passed to it, allow passing
wxBitmapBundle and select the bitmap most appropriate for the current
resolution from it.

Closes #23813.
2023-08-25 20:32:07 +02:00