Commit graph

4728 commits

Author SHA1 Message Date
Blake-Madden
691c9e4352 Fix comment about wxWebResponse::IsOk()'s return type
wxWebResponse::IsOk() returns a boolean, not a pointer.

Closes #23460.
2023-04-18 14:39:19 +02: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
utelle
a20aa4de75 Improve generated process for the language database files
Fix some issues and streamline regeneration process:

- A few glitches (like duplicate language symbols, wrong Windows
  language ids etc) were fixed.
- Scripts were added to allow to regenerate the list of supported
  locales from the list of known Windows locales.
- Version info when language symbols became available was added to the
  documentation of the language symbol enum.
- Synonyms are no longer hard-coded in the script genlang.py.

See #23453.

Closes #23437.
2023-04-18 14:27:28 +02:00
Vadim Zeitlin
8a8fee442f Make wxEnvVariableHashMap just a std::unordered_map<>
Use the standard container directly instead of using a wx synonym for
it, this is more clear.

Use the same hack here as in e13dbd4278 (Use std::unordered_map<> in
wxMsgCatalog and related classes, 2023-04-12) to allow the existing code
including this header keep using the functions from wx/wxcrt.h without
including it explicitly.
2023-04-18 00:44:12 +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
Vadim Zeitlin
889845fbc4 Add support for wxNO_IMPLICIT_WXSTRING_CONV_TO_PTR to wxString
This symbol is similar to the existing wxNO_IMPLICIT_WXSTRING_ENCODING
and can be defined when building the application (as opposed to when
building the library) to disable implicit wxString conversions to
pointer types, i.e. char*, wchat_t* and void*.

This makes the just added wxUSE_CHAR_CONV_IN_WXSTRING library build
option unnecessary, so remove it.
2023-04-16 01:16:56 +02:00
Vadim Zeitlin
5119d35d3b Document that wxString::Clone() is obsolete
It's useless now that we never use ref-counted implementation any
longer.
2023-04-16 00:43:05 +02:00
Vadim Zeitlin
330303e078 Update wxString overview and documentation
Avoid overlap between the two pages.

Remove obsolete information.

Document wxNO_IMPLICIT_WXSTRING_ENCODING.

Don't mention wxUSE_STL any longer.
2023-04-15 20:34:24 +02:00
Vadim Zeitlin
4c8bf1e9e7 Don't mention wxString::GetWriteBuf() in the documentation
This function doesn't exist any longer since 5e2da5a106 (Get rid of v2.8
code, 2022-08-01).

Remove documentation of this function and its UngetWriteBuf()
counterpart and don't refer to them in wxStringBuffer[Length]
documentation.
2023-04-15 15:08:37 +01:00
Vadim Zeitlin
fb17a5ac38 Merge branch 'use-std-cont-1'
Set wxUSE_STD_CONTAINERS=1 by default.

See #23439.
2023-04-15 15:46:08 +02:00
Vadim Zeitlin
5e7b08f9ea Correct wxDC::GetContentScaleFactor() documentation
Document that it returns the same value as GetDPIScaleFactor() wxWindow
method and _not_ the wxWindow method with the same name.

This is very confusing, but there doesn't seem to be anything to be done
about it by now.

See #23441.
2023-04-13 15:07:32 +02:00
Vadim Zeitlin
4a294caacd Stop using macro-based wxList in wxArtProvider code
Use std::list<> instead.

Also use std::unique_ptr<> instead of managing memory manually. As this
makes wxArtProvidersList non-copyable, don't export it from the DLL any
longer, as DLL-exported classes apparently must have a copy ctor, or at
least MSVS (all versions up to 2022) try to generate it even if it's
explicitly deleted in the class declaration and fail, due to the base
class being non-copyable. And because there was never any reason to
export neither this class nor wxArtProviderCache from the DLL, stop
exporting the latter one too.

Note that this implies that the only way to delete a wxArtProvider
registered in the global provider list is by removing it from it,
instead of deleting it directly, which was apparently allowed before,
even though it shouldn't have ever been actually done -- but make this
even more clear in the documentation now.
2023-04-12 18:15:44 +01:00
Vadim Zeitlin
edfa69faf0 Stop using object array for wxRibbonPageTabInfoArray
Replace it with a simple wxBaseArray of wxRibbonPageTabInfo.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
78ae3f0b16 Stop using object array for wxDynamicLibraryDetailsArray
Use a simple wxBaseArray of wxDynamicLibraryDetails objects.

Also document this container.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
16842b2b2f Stop using object array for wxArrayVideoModes
This can be just a simple wxBaseArray.

Also document this container, as it is returned from the public
wxDisplay::GetModes().
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
bceace12b5 Use wxBaseArray instead of object arrays for wxAuiNotebook arrays
These classes can also be potentially used in the user code, as they are
used for the protected members of wxAuiTabContainer, so don't replace
them with just std::vector, but do, at least, use wxBaseArray template
for them instead of the macro-based object arrays.

Note that this required the check for the button presence in m_buttons
in wxAuiTabContainer::TabHitTest() as wxBaseArray::Index() relies on
object comparison, whereas the original version relied on object address
comparison, so keep it like this, even though we probably could compare
the buttons IDs instead (and, possibly, not compare anything at all but
just return the result of the button we found from ButtonHitTest()
directly).

Also document these container classes.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
bc23b1f4f0 Use wxBaseArray instead of object array for wxAuiToolBarItemArray
This class is part of the public API, as it is used by the public
wxAuiToolBar functions, so we can't make it just a vector, but we can
still make it a wxBaseArray instead of using the old macro-based object
array for it.

Also document it.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
338751756f Use std::vector<wxImage> instead of wxImageArray
Preserve the old dynamic array name but just define it as a thin class
deriving from std::vector and accept just vector in SaveAnimation().
2023-04-12 18:09:47 +01:00
Vadim Zeitlin
bc3acf429e Fix formatting in wxDisplay::GetPPI() documentation
Avoid putting wxSize(0,0) on two lines.
2023-04-12 17:02:07 +02:00
Vadim Zeitlin
89e4f51f62 Update documentation after setting wxUSE_STD_CONTAINERS=1
Explain that the legacy container classes now inherit from the standard
classes by default and also how to update the existing code to compile
when using standard library-based implementations.
2023-04-10 20:39:50 +01:00
Vadim Zeitlin
3335be1362 Document WX_DECLARE_LIST and WX_DEFINE_LIST macros
Even though they're deprecated, they should still be documented, just as
similar WX_DECLARE_OBJARRAY and WX_DEFINE_OBJARRAY are.
2023-04-10 20:31:47 +01:00
Vadim Zeitlin
61f2fb078b Merge branch 'remove-wxT-from-docs'
Remove most occurrences of wxT() from the docs.

See #23436.
2023-04-10 16:22:42 +02:00
Vadim Zeitlin
15936efed9 Merge branch 'use-stl-tweaks'
Minor changes related to wxUSE_STL.

See #23435.
2023-04-10 16:21:36 +02:00
Vadim Zeitlin
58a7b7b31b Merge branch 'arrstr-from-vector'
Improve interoperability between wxArrayString and std::vector.

See #23434, #23036.
2023-04-10 16:20:16 +02:00
Vadim Zeitlin
60dacae204 Make it more clear that wxT_2() is obsolete
Say it explicitly and remove example of its use which shouldn't needed
any longer.
2023-04-10 14:25:27 +02:00
Vadim Zeitlin
41d0313f52 Update wxT() documentation after ASCII build removal
Explain that this macro always expands into a wide-string now.
2023-04-10 14:25:02 +02:00
PB
d378444010 Remove most occurrences of wxT() from the docs
wxT() macro rarely needed now, so do not use it in the docs
unless it is required.
2023-04-09 20:35:49 +02:00
Vadim Zeitlin
bf3d6374d6 Recommend against using wxList in the new code
Make it clear that it's yet another legacy class.
2023-04-09 02:33:22 +02:00
Vadim Zeitlin
e9527ee5a2 Define wxArchiveIterator in all builds, not just STL one
Doing this doesn't introduce any backwards compatibility problems, so do
it always, and not only when wxUSE_STL==1.
2023-04-09 02:33:22 +02:00
Vadim Zeitlin
e832ebbacc Add wxArrayString::AsVector() too
This provides the conversion in the other direction, which is needed
less often but it's still arguably better to have it than not to.
2023-04-08 22:45:11 +01:00
Vadim Zeitlin
23981273df Document that wxArrayString is a legacy class
Explain that it's only needed in order to pass a bunch of strings to the
existing function and also mention that it doesn't even need to be
created explicitly in most cases.
2023-04-08 22:29:12 +01:00
Vadim Zeitlin
cee7611c6a Add wxArrayString ctor from std::vector
Allow constructing wxArrayString from vectors of any compatible type,
including wxString itself as well as std::string or std::wstring.
2023-04-08 20:22:48 +02:00
Vadim Zeitlin
d0e892ac09 Merge branch 'toolbar-docs'
Improve wxToolBar documentation.

See #23427.
2023-04-08 16:35:51 +02:00
Vadim Zeitlin
a459580052 Fix remark about labels under Mac in wxToolBar::AddControl()
Use "new" (only used since 292e5e1f17 (OSX renaming round 2, 2008-07-30)
name of the preprocessor constant and mention that it's enabled by
default.
2023-04-08 16:32:03 +02:00
Vadim Zeitlin
435efa8b5a Mark new language constants as being new since wx 3.3.1
Add a convenient @since_wx alias which is more appropriate for
single-line comments than the standard @since, which would expand into
two paragraphs.

See #23426.
2023-04-08 14:50:47 +02:00
utelle
c8d2244c63 Update language database and fix some problems in it
Update the list of known languages/locales to match the list of known
locales in Windows 11, adding support for a number of new locales.

Additionally, the issues mentioned in #23419 are fixed, except the
native descriptions of Northern Luri (Luri translations of the
territories are not known).

Closes #23419.

Closes #23426.
2023-04-08 14:47:48 +02:00
PB
17b25122e2 Update wxToolBar documentation
Remove information relevant only for Pocket PC and also fix a
mistyped word.
2023-04-07 09:51:06 +02:00
Vadim Zeitlin
dee816bb5b Merge branch 'ci-utf8'
Fix UTF-8 build under MSW and improve its coverage in the CI jobs.

See #23313.

Closes #23328.
2023-03-30 19:46:05 +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
Vadim Zeitlin
30ffcfe22e Merge branch 'statbox-empty-label-draw'
Fix custom drawing wxStaticBox with empty label in wxMSW.

See #23343.

Closes #23342.
2023-03-29 11:19:15 +01: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
Vadim Zeitlin
488950f724 Implement wxString::Shrink() in terms of shrink_to_fit()
Now that we use C++11 there is no need to have our own Shrink()
implementation when we can just use the standard function.

Also mention that it's the same as shrink_to_fit() in Shrink()
documentation.

No real changes, just simplify the code and make it more efficient.
2023-03-28 23:05:09 +02:00
Tobias Taschner
8038195952
Unify entries in wxWebViewEvent table 2023-03-24 15:10:42 +01: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
Tobias Taschner
8d0685ee08
Add wxWebViewConfiguration support for webkitgtk2
Allows setting some webview settings which would be unavailable after
creation.
2023-03-24 15:10:20 +01:00
Dan Gudmundsson
23ccdb23c8 Improve and document wxGLCanvas::CreateSurface()
This function must be called to be able to re-create the EGL drawing
surface after the window layout have changed, such as after a reparent
of the canvas or of it's grandparents.

Make it suitable for use in this case by re-creating the surface if
there already was one and document this function to make it part of the
public API.

Closes #23366.
2023-03-22 18:41:27 +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
Vadim Zeitlin
086a912e25 Improve wxMemoryDC scale factor documentation
Make it clear that the scale factor comes from the bitmap selected into
the device context and not from the "compatible" wxDC, as this is how
the code currently behaves (and this behaves arguably does make sense,
but also can't be changed without breaking the existing code in any
case).
2023-03-22 00:29:38 +01:00
Vadim Zeitlin
f82bd9ea67 Merge branch 'webview_configuration' of https://github.com/TcT2k/wxWidgets
Add wxWebViewConfiguration.

See #23349.
2023-03-18 20:55:39 +01:00
Vadim Zeitlin
9ad79ba03a Merge branch 'thread-fixes'
Fix TSAN errors in thread unit tests.

See #23340.
2023-03-18 20:53:10 +01:00