Commit graph

6854 commits

Author SHA1 Message Date
Ivan Sorokin
8a01942f1a Add WXK_NUMPAD_CENTER to refer to numpad "5" in portable code
This key produces events with different key codes in wxMSW (WXK_CLEAR)
and the other ports (WXK_NUMPAD_BEGIN), so add a new constant to allow
to refer to it under the same name everywhere.

Also generate a key event for it in wxOSX where it previously wasn't
generated at all.

Closes #23478.

Closes #23491.
2023-05-06 21:57:47 +01:00
Vadim Zeitlin
cd65c312d3 Merge branch 'use-std-in-samples'
Use standard containers in samples.

See #23490.
2023-04-28 15:32:34 +02:00
Vadim Zeitlin
9257d36af6 Stop using legacy wxSTD macro in the library code
Just use "std::" directly instead.

No real changes.
2023-04-28 15:26:46 +02:00
Vadim Zeitlin
8f4c9f41a4 Use std::map<> instead of wxHashMap in webview sample
No real changes, just use the standard class.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
ac854d3718 Use std::vector<> instead of wxArray in widgets sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
58168736a0 Use std::vector<> instead of wxArray in regtest sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
20e521348b Use std::vector<> instead of wxArray in exec sample
No real changes, just use the standard containers instead of macro-based
arrays.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
d161905856 Remove unnecessary includes of wx/dynarray.h from the samples
No changes at all, just prune the unnecessary header.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
b9787c6754 Use std::vector<> instead of wxArray in thread sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
ae13d70ddc Merge branch 'use-std-hash'
Use std::unordered_foo instead of wx hash maps.

See #23462.
2023-04-18 14:38:12 +02:00
mcorino
3849111100 Fix wxRibbonToolBar::GetToolByPos() and DeleteToolByPos()
These functions didn't correctly account for the indices beyond the
first group.

Fix this and add tests for these functions to the sample.

See #23458.

Closes #23457.
2023-04-18 14:37:04 +02:00
Vadim Zeitlin
f5920de681 Use standard containers in dataview sample
Update the sample to use std::vector<> and std::unordered_map<> for
storing the model data, this should be much more useful for the people
trying to write their own model.

Also use std::unique_ptr<> to avoid manual memory management.
2023-04-18 00:54:12 +02:00
Vadim Zeitlin
9935a29c7f Stop using "NULL" in the minimal sample
This should have been part of 4f4c5fcfdf (Use nullptr instead of NULL in
the code and documentation, 2022-10-16).
2023-04-17 18:36:33 +02:00
Vadim Zeitlin
83773cec9a Merge branch 'SampleIDs' of https://github.com/Blake-Madden/wxWidgets
Use wxID_HIGHEST instead of hard-coded numbers in samples.

See #23456.
2023-04-17 17:03:49 +02:00
Vadim Zeitlin
7824391f64 Merge branch 'use-std-containers'
Remove avoidable uses of legacy container classes by replacing them with
the standard containers.

See #23440.
2023-04-17 17:02:27 +02:00
Blake-Madden
62bb66fc3a
Update toolbar.cpp 2023-04-17 06:36:10 -04:00
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