Commit graph

7058 commits

Author SHA1 Message Date
Blake-Madden
d75cb381b7
Update xti.cpp 2023-04-17 06:35:30 -04:00
Vadim Zeitlin
d65eed50fa Replace some occurrences of wxUSE_STL with wxUSE_STD_CONTAINERS
The latter option will remain, while the former one won't be used at all
any longer soon, so prefer using the latter whenever possible.
2023-04-15 15:14:41 +01:00
Vadim Zeitlin
b76ebc61d9 Stop using wxList in OpenGL penguin sample
Use std::vector instead, there is no need for linked lists here.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
d4f592c2a4 Stop using object array for wxGridCellCoordsArray
This type is part of the public API, so it can't be just replaced by a
std::vector<>, but it can at least be replaced by wxBaseArray<> which
inherits from std::vector<>.

Also accept just a vector, unimaginatively called wxGridCellCoordsVector
in the code, on input, as this is backwards-compatible with passing in a
wxGridCellCoordsArray.

Finally, simplify the code a bit by using range-for loop.

No real changes.
2023-04-12 18:09:47 +01:00
PB
02cba46643 Fix memory leak in the art provider sample
The list client data must be destroyed not only when closing the
resource browser dialog (see 754f75c1cd (Fix memory leaks in artprov
sample, 2022-01-28) but also whenever the art client is changed.

Closes #23417.

Closes #23418.
2023-04-04 15:29:37 +02:00
Vadim Zeitlin
13ebaee247 Stop using enum for integer constants in image sample
This always wasn't the best and started to result in CI failures now as
recent versions of gcc (e.g. 11.3 in Ubuntu 2.2.04) started giving
-Wdeprecated-enum-float-conversion when using REAL_SIZE in the
expressions.
2023-03-30 21:18:02 +02:00
Vadim Zeitlin
e187667e6b Merge branch 'msw-print-dialog-pages'
Add support for printing "selection" and "current page" in wxMSW and
printing code cleanup.

See #23338, #23372.
2023-03-29 12:20:38 +02:00
Stefan Ziegler
d75956d3e6 Add support for printing only the current page
Add wxPrintDialogData::EnableCurrentPage() and implement support for it
under MSW, where it enables selecting the "Current page" radio button in
the pages selection area of the native dialog.

Update the sample to show the new function.
2023-03-29 01:15:06 +02:00
Tobias Taschner
e15a1ac18e
Add wxWebViewWindowFeatures and event
This replaces the previously implemented wxWebViewWindowInfo.

It explicitly breaks the previous API to enable WebKitGTK
integration and to make the usage in application code less error prone.

A new event wxEVT_WEBVIEW_NEWWINDOW_FEATURES is added to allow
access to the window features and the child web view.
2023-03-24 15:10:21 +01:00
Blake Madden
11358d7dcc Don't expose internal strings to translation in samples
Remove _() around string which it doesn't make sense to translate in the
sockets sample.

This doesn't actually change anything as this sample doesn't use
translations in any case, but still show a good example.

Closes #23362.
2023-03-22 18:26:05 +01:00
Vadim Zeitlin
8d71d304b9 Use accelerators for main menu items in the printing sample
Allow using Ctrl-P to bring up the "Print" dialog instead of having to
select it from the menu every time. And also add an accelerator for the
"Page Setup" menu command.

And specify both the new accelerators and the existing one for "Print
preview" command using the menu items labels instead of calling
SetAcceleratorTable() explicitly, as there doesn't seem to be any reason
to do it.

Finally, slightly improve the help messages for these menu items.
2023-03-22 17:24:30 +01:00
Vadim Zeitlin
f80efc9992 Show message about cancelling printing less intrusively
Getting a message box after cancelling printing was really annoying
while testing the printing dialog, so replace it with a status message.
2023-03-22 17:23:25 +01:00
Stefan Ziegler
e93570f681 Implement support for printing only selected pages in wxMSW
While the user could select to print only the selection in the dialog,
there was no way for the program to specify which pages were selected,
making this choice impossible to handle.

Add new IsPageSelected() function which is now used to query which pages
are selected and should actually be printed.

Update the printing sample to show how this function is used.
2023-03-22 15:37:07 +01:00
Tobias Taschner
01ee3942f8
Add wxWebView child window handling
Add new class wxWebViewWindowInfo:
This new class returned by wxWebViewEvent::GetTargetWindowInfo() allows
to get information about the window that is about to be opened and to
set the window that will be used to display the content.
2023-03-09 14:30:19 +01:00
Tobias Taschner
45d5de6a26
Add wxEVT_WEBVIEW_WINDOW_CLOSE_REQUESTED
This event is usually triggered by javascript calling window.close()
2023-03-09 14:29:25 +01:00
Vadim Zeitlin
8f22eb5157 Merge branch 'calendar-locale'
Improve date validation in wxDatePickerCtrlGeneric and a couple of minor
fixes in the related code.

See #23312.
2023-03-09 00:10:43 +01:00
Vadim Zeitlin
abb9859b89 Replace wxScopedPtr with std::unique_ptr in the samples too
No real changes, just use the standard class instead of the wx one.
2023-03-06 23:37:53 +01:00
Vadim Zeitlin
347d7fcccb Use std::unique_ptr<> instead of wxDECLARE_SCOPED_PTR
Replace macro-based scoped pointers with the standard class.

Also mention that using these macros and wxScopedPtr itself is
deprecated (but there are too many occurrences of the latter in the code
to change all of them now).

Note that wxMsgCatalog ctor and dtor had to be moved out of line to
allow using unique_ptr<> to an incomplete class as member. On the bright
side, we can just use unique_ptr<> instead of wxPluralFormsNodePtr which
was a local reimplementation of wxScopedPtr.

No real changes.
2023-03-06 18:36:37 +00:00
Vadim Zeitlin
00b2d27224 Switch to using wxUILocale in the calendar sample
No real changes, just follow our own recommendation to use
wxUILocale::UseDefault() instead of wxLocale with wxLANGUAGE_DEFAULT.
2023-03-04 16:47:08 +01:00
Vadim Zeitlin
020aff8a7f Don't use "Copyright" word in wxAboutDialog under MSW
MSW platform convention is to show just "© whatever" instead of
"Copyright © whatever" in the "About" dialogs, so make it simpler to
conform to it but still keeping using the word under the other
platforms, where it usually is included, by removing the "Copyright"
word under MSW only in wx code.
2023-02-24 00:42:13 +00:00
Vadim Zeitlin
f932046a5c Merge branch 'msw-overlay'
Add native wxOverlay implementation using layered windows to wxMSW.

See #23261.
2023-02-20 18:28:21 +01:00
Vadim Zeitlin
41be6dbdbe Merge branch 'opengl-default-attrs'
Stop requesting multi-sampling in wxGLCanvas by default.

See #23260.
2023-02-20 18:26:52 +01:00
Vadim Zeitlin
3ed5e42441 Merge branch 'scintilla-5.0' of https://github.com/MaartenBent/wxWidgets
Update Scintilla to 5.0.

See #23117.
2023-02-20 18:25:35 +01:00
Vadim Zeitlin
ec4ff44479 Don't show wrongly rounded value of π in the internat sample
We formatted the value with lesser precision than was used for
displaying it, resulting in unexpected display. Fix this by reducing the
number of digits used in the source (because they're lost anyhow when
formatting using the default precision) and the precision used when
displaying the number.

Closes #23192.
2023-02-20 18:24:48 +01:00
Artur Wieczorek
f1273ce152 Use class enums to implement bitmask types
To improve type safety of flags.
2023-02-19 22:36:21 +01:00
Maarten Bent
b0385e498c
Rebake after bakefile changes 2023-02-14 22:52:26 +01:00
Maarten Bent
c8c254db1a
Update bakefile with Scintilla and Lexilla changes 2023-02-14 22:43:18 +01:00
Maarten Bent
2a18a04dee
Regenerate wxSTC files after Scintilla update
Add both the Scintilla and Lexilla iface to the script.
Remove unused LinkLexers code.

Allow to get the Lexilla version, and show it in the stc sample.
2023-02-14 22:43:18 +01:00
Vadim Zeitlin
487018f42e Handle mouse capture loss gracefully in the drawing sample
Reset the selection and avoid the assert which happened when the capture
was lost unexpectedly (e.g. due to switching to another window using
some key combination without releasing the mouse).
2023-02-14 17:56:47 +00:00
Vadim Zeitlin
be1807f29b Use wxGLAttributes instead of int[] in cube OpenGL sample
This is slightly more readable.

Also test for stereo support before trying to create a window using it.
2023-02-14 16:05:51 +00:00
Tobias Taschner
be10ce0713 Add wxWebViewEvent::IsTargetMainFrame()
Allows to determine if a navigation is happening in the main frame
or an embedded iframe when handling wxEVT_WEBVIEW_NAVIGATING.

Additionally implement previously missing wxEVT_WEBVIEW_NAVIGATING
events for frames with the Edge backend.

See #23238.
2023-02-08 17:42:06 +01:00
Vadim Zeitlin
aea6d248dc Update French translations of the internat sample 2023-02-07 13:52:19 +01:00
Vadim Zeitlin
576e3d5903 Update instructions for generating internat sample catalogs
Add more translation macros to xgettext invocations.
2023-02-07 13:51:42 +01:00
Vadim Zeitlin
3e571ef253 Merge branch 'gtk-treectrl-text-size'
Improve size and handling of in-place editor in wxGenericTreeCtrl.

See #23001.
2023-02-06 19:47:42 +01:00
Artur Wieczorek
ad6bb3a10a Adjust propgrid sample to look better on HiDPI display 2023-02-05 19:05:44 +01:00
Vadim Zeitlin
0a1b0fbe01 Merge branch 'msw-about'
Improve generic and MSW "About" dialog appearance.

See #23196.
2023-02-03 15:11:48 +01:00
Vadim Zeitlin
a8d8022529 Allow using F2 for renaming items in the treectrl sample
This makes it simpler to test this functionality and it's also the
standard key for doing this, at least under MSW.
2023-02-02 17:13:09 +01:00
Vadim Zeitlin
17827947ec Don't show "developer" in the simple "About" dialog
This doesn't look well in the native Mac or MSW versions, so leave it
out to make the dialog nicer by default.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
9fbc7abea1 Update copyright year in the dialogs sample "About"
This is not critical, so might not be worth updating it every year, but
using 2006 there is still a bit too vintage.
2023-01-30 21:11:42 +01:00
Artur Wieczorek
ec25a5c83c Execute automated tests for wxPropertyGrid
Move existing manually executed tests in propgrid sample to the test
suite executed automatically.
2023-01-30 17:28:17 +01:00
Maarten Bent
601f8c840c
Update joystick sample
Draw on a wxPanel, there is no need for a wxScrolledWindow.
Remove unused constructor arguments.
Use wxID_EXIT instead of JOYTEST_QUIT.
Show in the statusbar which buttons are pressed.

Remove wxClientDC and draw in the paint handler instead.
Use different colours for the first 4 buttons.
Fix size and drawing coordinates when using high DPI.
2023-01-24 23:20:27 +01:00
Artur Wieczorek
266dc567fb Get rid of declaration of unused class in propgrid sample 2023-01-22 20:22:28 +01:00
Jens Göpfert
842ca1e8b8 Improve ScrollTo() when using wxDV_VARIABLE_LINE_HEIGHT
Calculate the last visible item based on item position instead of the
first visible row when using variable line heights.

Also extend the sample for testing EnsureVisible with item and column.

Closes #23102.

Closes #23128.
2023-01-19 21:02:13 +00:00
Vadim Zeitlin
b1bdb95ee8 Use sizers in the notebook sample for better DPI change handling
Even simple static texts need to be put inside sizers to allow them to
update their size when the DPI changes, as they remain too small for the
new (higher) DPI otherwise when the sample window is moved from a
standard to high DPI monitor.

See #23088.
2023-01-13 19:45:01 +01:00
Vadim Zeitlin
804a82df8c Merge branch 'improve-manifest-docs'
Improve manifest docs.

See #23123.
2023-01-13 16:02:26 +00:00
Vadim Zeitlin
4e116ced45 Merge branch 'stc-dark-mode'
Improve support for dark mode in wxSTC.

See #23097.

Closes #19107.
2023-01-13 16:00:16 +00:00
Vadim Zeitlin
e7297592cb Move manifest explanation in the main wxMSW install docs
This is important enough to be described directly there, especially now
when a manifest is required.
2023-01-09 23:22:17 +00:00
Vadim Zeitlin
3d2754d04a Remove code not doing anything from propgrid sample
This code, added back in 1c4293cb91 (added wxPropertyGrid from Jaakko
Salli (#9934), 2008-09-12), resulted in warnings about an unused
variable from clang and was generally confusing, so just remove this
code entirely as it's not clear what was actually the intention here.
2023-01-06 00:58:05 +01:00
Vadim Zeitlin
0c97244747 Merge branch 'drop-mem-debug'
Drop memory debugging/tracing support.

See #23115.
2023-01-06 00:56:01 +01:00
PB
42c2cb9936 Improve comments in samples/sample.rc
Provide more information about application manifest, High DPI support,
and contents of wx/msw/wx.rc file.

Use the correct file extension for docs/msw/winxp.md.

Closes #23116.
2023-01-06 00:54:00 +01:00