Commit Graph
7101 Commits
Author SHA1 Message Date
Alex Shvartzkop e7462d82bf Fix touch gestures test navigation in event sample.
Panning while scaled didn't pan by the correct amount.
Combination of gesture events didn't work correctly.
2024-06-21 14:25:21 +03:00
DietmarSchwertberger a2d33fc31e Allow retrieval of target row/col for EVT_GRID_ROW/COL_MOVE
Add wxGridEvent::GetNew{Row,Col}().

See #24392.

Closes #24619.
2024-06-18 23:19:02 +02:00
Vadim Zeitlin f8043a62f3 Merge branch 'SamplesCleanup' of https://github.com/Blake-Madden/wxWidgets
Minor samples cleanup.

See #24617.
2024-06-16 00:13:16 +02:00
Vadim Zeitlin 9690779f90 Fix crash on webview sample startup when using CEF backend
Unfortunately the workaround in dce09c9b2a (Avoid crash on startup in
webvew sample under Wayland, 2024-04-22) broke the sample when using CEF
as we can't capture the local lambda by reference.

Fix this simply by making a copy of it instead -- this is not the most
efficient way to do it, but it doesn't really matter here and it's the
simplest one.
2024-06-15 20:37:41 +02:00
Blake-Madden e0daf9ed02 Fix comment that mentions uncommenting something that is not commented
Reworded it a bit also.
2024-06-15 13:20:39 -04:00
Blake-Madden 3bde9346b1 Remove wxT() macros 2024-06-15 13:18:43 -04:00
Blake-Madden 857938ef54 Don't expose "HTML" in richedit sample to localization
Doesn't seem like something you would want translated (IMO)
2024-06-15 13:17:43 -04:00
Blake-Madden d2c867bfde Use "MS Shell Dlg" as the dialog font in MFC Sample (Microsoft recommendation) 2024-06-15 13:16:27 -04:00
Hartwig Wiesmann 5ab765f03d Fix use of wxStaticBox in wrapsizer sample
Windows inside static box should have the static box as their parent.

Closes #24576.
2024-06-10 01:31:05 +02:00
Alex Shvartzkop 10ebc1f30c Fix build error with C++20.
An explicit conversion is required now.
2024-06-01 16:37:01 +03:00
Hartwig Wiesmann 9f12e8ab56 Really fix creating controls on startup in widgets sample
The changes in 66076afb6f (Fix creating controls on startup in the
widgets sample under Mac, 2024-05-15) used IsClientAreaChild()
incorrectly, it should be called on the parent object and not negated.

See #24528, #24529.

Closes #24568.

Closes #24569.
2024-05-28 18:46:33 +02:00
Vadim Zeitlin e5b4d11b75 Fix missing quote in typetest sample output
Close the quote opened in the output for MIME database lookup.
2024-05-28 18:13:44 +02:00
Vadim Zeitlin e3cb686719 Remove unnecessary wxSetCursor() calls from widgets sample
They were probably added to test that wxSetCursor() works but they
really have nothing to do with wxBitmapComboBox and just confused things
here.
2024-05-28 17:15:35 +02:00
Vadim Zeitlin 66076afb6f Fix creating controls on startup in the widgets sample under Mac
This got broken by a8b4753d1d (Reconnect events to the widget after
recreating it in the sample, 2024-02-18) because checking whether the
children list is empty doesn't work correctly in wxOSX (and wxUniv)
because scrollbars may be present in this list even if there are no
other children yet.

Fix this by checking if we have any "real" children explicitly.

Closes #24528.

Closes #24529.
2024-05-15 03:19:39 +02:00
Blake-Madden a771ac62fb Fix misleading comment in "thread" sample
Fixes a comment that is a bit confusing/misleading,

Closes #24525.
2024-05-13 18:22:17 +02:00
Vadim Zeitlin 2d3461bc01 Simplify docview sample by removing wxTextDocument class
The purpose of this class was unclear as only TextEditDocument, deriving
from it, was actually used, so it seems like we can just rename it to
TextEditDocument and use a single class instead of using two without
losing anything.
2024-05-05 22:06:08 +02:00
Vadim Zeitlin 12c5b40be4 Merge branch 'improve-config-sample'
Some minor improvements to the config sample.
2024-04-28 17:22:53 +02:00
Vadim Zeitlin dce09c9b2a Avoid crash on startup in webvew sample under Wayland
The workaround for wxWebViewChromium added in f5e2af9a28 (Make
wxWebViewChromium work with wxGTK3 and X11, 2023-09-02) broke
wxWebViewWebKit under Wayland as calling wxYield() inside
wxEVT_WEBVIEW_CREATED handler results in

Error flushing display: Resource temporarily unavailable

error from GTK and immediate application exit.

This is almost certainly a GTK bug and should be fixed there, see
https://gitlab.gnome.org/GNOME/gtk/-/issues/124, but for now make the
workaround even uglier to avoid it.
2024-04-22 17:47:02 +02:00
PB 7c125d304d Fix recently introduced crash on spin page of widgets sample
Attempting to change the style or alignment of the spin controls in the
widgets sample made the sample crash. This was caused by a8b4753
(Reconnect events to the widget after recreating it in the sample,
2024-02-19) which resulted in using windows that were previously
destroyed.

Fix this by calling NotifyWidgetRecreation() for each spin control only
after they were all recreated.

Closes #24487.
2024-04-18 21:14:20 +02:00
Vadim Zeitlin 640cd84a32 Merge branch 'propgrid-tweaks'
Various wxPropertyGrid tweaks.

See #24466.
2024-04-13 23:56:06 +02:00
Vadim Zeitlin cbf564a718 Merge branch 'gtk-file-button'
Stop inheriting wxFileButton from wxButton in wxGTK.

See #24462.
2024-04-13 23:55:40 +02:00
Vadim Zeitlin 216b58f45b Remove accidental virtual width setting from propgrid sample XRC
Setting virtual width to 0 doesn't make any sense, so just don't do it.
2024-04-12 03:04:03 +02:00
Vadim Zeitlin cd981a297b Add wxApp::SetAppearance() to explicitly set dark or light mode
Allow the application to override the default system mode and,
incidentally, also to provide a more portable way of enabling dark mode
under MSW.

Show how to use the new function in the drawing sample.

Closes #19185.

Closes #23867.
2024-04-12 02:40:54 +02:00
Vadim Zeitlin 424502b895 Don't rely on wx/button.h being included from wx/*picker.h
Include this header explicitly in the sample instead of relying on its
indirect inclusion from wx/filepicker.h or wx/dirpicker.h respectively.

No changes yet, but this will become important once wx/gtk/filepicker.h
doesn't include wx/button.h any longer.
2024-04-08 22:32:17 +02:00
Vadim Zeitlin 1d910f3323 Switch to direct wxConfig creation in the sample
The claimed advantages of cresting it on demand don't really apply to
the sample, so don't do it like this, but create the object directly to
make it easier to customize the creation flags.

Still make it possible to test the on-demand creation by predefining
WX_CONFIG_CREATE_ON_DEMAND environment variable, this is simpler than
telling people to uncomment some lines in the sample code.
2024-03-31 23:53:35 +02:00
Vadim Zeitlin 97bf6e5bf9 Remove unnecessary OnExit() override from config sample
There is no need to delete wxConfig manually, it is done by wxWidgets
automatically.
2024-03-31 20:06:16 +02:00
Vadim Zeitlin 4fe947b2ba Fix defining WX_WEBVIEW_BACKEND as "cef" for the webview sample
The direction of comparison was accidentally reversed.
2024-03-31 19:43:36 +02:00
Vadim Zeitlin ca385ab44e Merge branch 'notif-dismiss-reason' of https://github.com/lanurmi/wxWidgets
Expose reason for notification dismissal through SetInt().

See #24340.
2024-03-23 14:03:46 +01:00
Vadim Zeitlin b9052bd06e Merge branch 'clipboard-fixes'
Fix copying/pasting text to/from clipboard in wxGTK under Wayland.

See #24423.
2024-03-22 19:16:59 +01:00
Vadim Zeitlin a08600cfaf Merge branch 'locale-script-fixes'
Improve handling of the "script" part of the locale, notably fixing
zh-Hans-CN locale support under macOS.

See #24399.
2024-03-22 19:10:11 +01:00
Vadim Zeitlin 401e1d16ff Allow selecting between primary and clipboard in text sample
Add a menu item to switch between using the clipboard and primary
selections.

This finally makes UsePrimarySelection() call in the sample useful,
after 25 years when it didn't do anything, since it was added back in
7e2c43b855 (...Added for primary selection to sample/text., 1999-06-10)
2024-03-21 18:20:47 +01:00
Vadim Zeitlin d0cc8911fd Fix comment and call to UsePrimarySelection() in text sample
The call actually did nothing, but the comment implied that it did, as
if the default argument to UsePrimarySelection() were "true" -- which is
not, and never has been, the case.

Reduce confusion by clarifying what's going on here and passing an
explicit argument.
2024-03-21 18:20:47 +01:00
Vadim Zeitlin 847c750b69 Refactor clipboard selection in text sample
Factor out the call to UsePrimarySelection() and accompanying comment in
its own function.

This doesn't make much sense yet, but will allow to avoid modifying two
copies of this code and comment in the upcoming commits.

No real changes yet.
2024-03-21 18:20:47 +01:00
Vadim Zeitlin 9a390265bb Remove clipboard sample, wxClipboard is shown in the text sample
The sample could have been useful, in theory, but didn't do anything
more or better than the text sample in practice, so just remove it.
2024-03-21 18:20:47 +01:00
Lauri Nurmi 8b26611c64 Expose reason for notification dismissal through SetInt()
On all platforms, except macOS, the reason why a notification was
dismissed is known. Specifically, it can be useful to distinguish whether
the notification closed because of a timeout, or a click by the user.
2024-03-20 22:45:56 +02:00
Tobias Taschner 33931b7378 UI improvements to WebView sample
- Enlarge the main window to make menu button more easily accessible.
- Show logs in a text control instead of a separate window.

Closes #24417.
2024-03-19 16:48:54 +01:00
Tobias Taschner 7a68e7617c Add wxWebSession::EnablePersistentStorage()
Currently only implemented for the macOS backend.

Also change this backend to not use persistent storage by default
be consistent with the other backends, that don't support persistent
storage at all yet.

Fixes: #23743

Closes #24407.
2024-03-18 14:14:31 +01:00
Vadim Zeitlin bbddaa2983 Use flags instead of multiple booleans in webview sample
No real changes, just avoid having to write "false, nullptr, true" in
the function call and use the much more clear "WebFrame::Private"
instead.
2024-03-16 01:23:13 +01:00
Tobias Taschner 72397e14a2 Add EnablePersistentStorage method to wxWebView 2024-03-15 22:04:32 +01:00
Vadim Zeitlin 0db2014532 Show the list of preferred UI languages in internat sample too
No real changes, just make it simple to check the result of this
function.
2024-03-12 18:05:59 +01:00
Vadim Zeitlin ad182fda13 Merge branch 'lexilla-5.3' of https://github.com/MaartenBent/wxWidgets
Update to Lexilla 5.3.

See #24369.
2024-03-12 14:42:46 +01:00
Vadim Zeitlin c45c1e5462 Use -rpath for utils too and not only samples
And get rid of SAMPLES_RPATH_FLAG and just use DYLIB_RPATH_FLAG, as it's
not at all sample-specific.

This notably allows running wxrc from the build tree without setting
LD_LIBRARY_PATH under Linux.

Closes #24384.
2024-03-09 20:30:52 +01:00
Maarten Bent d2d4cb0e12 Fix outdated references in minimal Xcode project 2024-03-03 19:21:10 +01:00
Martin Corino 8a027b98d1 Fix handling of binary secrets in wxSecretStore with wxGTK
Use correct content type when creating binary secrets to prevent
libsecret from munging them.

Also update the sample to show more functionality.

Closes #24351.

Closes #24352.
2024-02-29 03:21:14 +01:00
Vadim Zeitlin b03ce7711b Merge branch 'gtk-enter-leave-window'
Fixes for wxGTK enter/leave window events.

Closes #11848.

See #24339.
2024-02-29 03:01:38 +01:00
Vadim Zeitlin 9a27e206ce Rebake after adding 32-bit ARM support for MSVC
This should have been done in 99bc43cefe (Introduce minimal MSW ARM
support, 2024-01-15).

See #24222.
2024-02-24 20:50:38 +01:00
Vadim Zeitlin c14c652238 Rebake after wxWebViewChromium merge
No real changes, just rebake all the makefiles after the addition of
wxwin.extraLdflags, which results in an extra space even when these
flags are empty in webview-chromium branch.

This should have been done in f37401dde3 (Merge branch
'webview-chromium', 2024-01-19)
2024-02-24 20:46:51 +01:00
Vadim Zeitlin a8b4753d1d Reconnect events to the widget after recreating it in the sample
This ensures that the expected events are given even after the widget is
recreated due to a change of some controls on its page (and not because
it's recreated by one of the menu commands in the parent frame).

We also don't need to connect to these events from WidgetsFrame any
longer (and, in fact, doing it would be wrong as we'd connect twice),
which simplifies its code.
2024-02-19 00:40:30 +01:00
Vadim Zeitlin 828b7ee844 Move widget event handlers to WidgetsApp in the widgets sample
No real changes, just move the function connecting to the widget events
from WidgetsFrame to WidgetsApp to allow reusing it from outside
WidgetsFrame in the next commit.
2024-02-18 19:01:44 +01:00
Vadim Zeitlin b93422535d Show window enter/leave events in the widgets sample
This allows to easily check if these events are generated correctly for
all the controls shown in this sample.
2024-02-18 17:35:36 +01:00