Commit Graph
77453 Commits
Author SHA1 Message Date
Vadim Zeitlin aa94d0b21e Get rid of CppUnit boilerplate in wxMessageQueue unit test
No real changes, just remove the completely unnecessary test case class.

This commit is best viewed ignoring whitespace-only changes.
2024-12-26 14:40:45 +01:00
Vadim Zeitlin c213730d17 Stop using wxArray in wxMessageQueue unit test
Use std::vector<> instead.
2024-12-26 14:33:48 +01:00
Vadim Zeitlin 181f7a1d55 Fix return type of wxAuiDeserializer::LoadPanes() in the docs
This should have been done in 0abce57a36 (Use new wxAuiPaneLayoutInfo
for serialization, 2024-12-03).

Closes #25018.
2024-12-23 15:30:20 +01:00
Blake-Madden 73abc4b392 Fix malformed accelerator keys in translations
Some of the translations had "%" instead of "&".

Closes #25015.
2024-12-23 01:24:49 +01:00
Vadim Zeitlin 3cce10714e Merge branch 'webrequest-revert-add-header'
Revert changes allowing adding multiple headers with the same name to
wxWebSession as this is strongly discouraged by the HTTP standard.

See #25014.
2024-12-20 14:50:34 +01:00
Vadim Zeitlin de3b760fc6 Revert "Add support for multiple headers with same name to wxWebRequest"
This reverts commit 8395e5733d because
HTTP standard says that senders MUST NOT generate multiple lines with
the same header, with the only exception of Set-Cookie, so we shouldn't
provide a way to do it.

That commit also introduced a nasty regression with the programs calling
AddCommonHeader("User-Agent") not working at all any more after it
because WinHTTP refuses to send a request with multiple copies of this
header.

Also partially reverts 1000d67c13 which
was done later but is logically part of the same commit that is being
reverted.

See #24881.
2024-12-20 02:23:24 +01:00
Vadim Zeitlin 5d3e79d34b Merge branch 'gettextFixes' of https://github.com/Blake-Madden/wxWidgets
Fix errors in numbers (and one paper size) in translations.

See #25013.
2024-12-20 02:08:57 +01:00
Blake-Madden 113acd2673 Fix multiline raw string syntax in gen_iface.py
Add `r` prefix in front of each segment of raw string; otherwise, these
segments aren't seen as raw strings.

Closes #25012.
2024-12-20 02:05:54 +01:00
Blake-Madden 620ad0b391 Use UTF-8, not current encoding, for saving in wxStyledTextCtrl
This was already done when reading files and we should also produce
files in UTF-8 on output.

The only significant part of the change is the removal of wxConvCurrent
argument to Write(), removing wxConvAuto() doesn't do anything as it's
the default anyhow.

Closes #25008.
2024-12-20 02:01:03 +01:00
Vadim Zeitlin 0319e8ceb9 Revert "Add headers test"
This reverts commit 0fce060a02 which won't
work any more after upcoming reverting of the commit adding AddHeader().
2024-12-20 00:04:20 +01:00
Blake-Madden d1088f783a Fix paper letter in translation 2024-12-18 14:51:24 -05:00
Blake-Madden 575f1e28a4 Fix numbers in translations
Mostly just paper sizes and code pages
2024-12-18 13:03:50 -05:00
Vadim Zeitlin 348f9060ce Merge branch 'css-col-db'
Change values of standard colours to follow CSS standard.

See #25002.
2024-12-16 01:59:02 +01:00
Vadim Zeitlin a694c63563 Fix restoring previously maximized pane when loading wxAUI layout
Setting m_hasMaximized=true, as the existing code in LoadPerspective()
did, is not enough to make the pane really maximized, and doing this
resulted in broken layout when restoring a layout with a maximized pane.

Fix this by calling MaximizePane() instead.

Note that this function only works if passed a reference to one of the
panes managed by wxAuiManager and not its copy, so we must use GetPane()
to get the proper pane to use.

See #25004.

Closes #24990.
2024-12-16 01:56:17 +01:00
Vadim Zeitlin df9403500f Merge branch 'aui-book-layout'
Add support for serializing wxAuiNotebook layout.

See #24998.
2024-12-16 01:56:06 +01:00
Vadim Zeitlin fe7df68383 Add support for saving and restoring wxAuiNotebook layout
This includes multiple tab controls and pages order and uses new
wxAuiSerializer and wxAuiDeserializer notebook-specific functions.
These functions are pure virtual, which may be inconvenient if the
program doesn't use wxAuiNotebook at all or doesn't allow splitting or
reordering their pages, as it forces to still define them in this case,
but this is arguably not too burdensome and making them pure virtual
helps to attract attention to the fact that they need to be implemented
for saving notebook layouts.

Update the sample to show how to support notebook layout serialization
in the simplest possible way, by creating a separate top-level XML tag
for the notebooks. It could be tidier to put information about them
inside the corresponding pane tags, but doing it like this is simpler
and more clear, which is important for the sample code.

Closes #24950.
2024-12-16 01:54:27 +01:00
Vadim Zeitlin 55be0ed986 Stop using GDK functions for parsing colours names
This shouldn't be necessary now as they use the same CSS colour names
that we use too by default and like this switching to "Traditional"
colour names also changes wxGTK behaviour to use wxMSW colour values.
2024-12-16 01:26:36 +01:00
Vadim Zeitlin 027b8a2600 Optimize wxColourDatabase initialization by not creating colours
We don't need to create ~200 colours of which we're probably only going
to use only a few on program startup, so don't do it and really create
them only when they're really needed.
2024-12-14 02:06:40 +01:00
Vadim Zeitlin 7a7610713d Add simple wxColourDatabase unit test
Notably check that the recently added UseScheme() works.
2024-12-14 01:22:54 +01:00
Vadim Zeitlin 1c06d46a9f Use CSS colour values in wxColourDatabase by default
Allow reverting to using the traditional values for the conflicting
colours by calling UseScheme(Traditional) if really needed.

This is another attempt for changing wxColourDatabase to use more
standard colour values, after the previous attempt in bb131fdbc5
(updated colour definitions to the new official X version (patch
771272), 2003-07-17) which was reverted almost immediately after in
5e2ab1ea5d (reverted the last change (colour values changes), it cerated
too many problems, 2003-07-19), see #6031. Unlike the previous ones, it
provides an escape hatch in the form of UseScheme() and also leaves
traditional wx colour names not clashing with CSS ones still available.

Also update the "drawing" sample to allow showing both colour schemes,
and extend its view port to fit all the colour names vertically.

See #23518.
2024-12-13 23:51:34 +01:00
Vadim Zeitlin 946dd04c43 Show standard colours in alphabetical order in "drawing" sample
This is nicer than showing them in the apparently random order in which
they appear in the hash table.
2024-12-13 23:13:16 +01:00
Vadim Zeitlin 7a56a3eb3b Don't use wxColourDatabase for stock pen/brush initialization
This makes things simpler, removing an interdependence between
wxStockGDI and wxColourDatabase, and isolates the grey and medium grey
pens and brushes from the upcoming change to the value of the latter
colour in wxColourDatabase.

Note that we intentionally don't add wxGREY and wxMEDIUM_GREY macros,
unlike for the existing stock colours, as they are not really necessary
and it doesn't seem worth to add them just for consistency, especially
because it's easy to imagine some existing code already defining them,
especially the former one.

No real changes yet.
2024-12-13 23:07:52 +01:00
Vadim Zeitlin dce3dd244e Simplify handling of GREY/GRAY in wxColourDatabase
Just add the GRAY variants to the database directly instead of checking
for both GREY and GRAY when looking the colours up.

Note that we don't automatically add the version using GREY if a colour
with GRAY in it is added explicitly via AddColour() as this is not
something that had ever been documented and doesn't seem to make much
sense: application programmer using "GRAY" when adding a colour is
unlikely to use "GREY" when retrieving it later.
2024-12-13 22:56:04 +01:00
Vadim Zeitlin 8c8da5b2c8 Use ASCII string for standard colour database colour names
Don't bother with wxT() when we can be sure that these names only
contain ASCII.

No real changes.
2024-12-13 22:28:14 +01:00
Vadim Zeitlin 86122ff479 Delete wxTheColourDatabase in wxDeleteStockLists() too
No real changes, just remove special handling of wxTheColourDatabase
which was allocated, together with the other global lists, in
wxInitializeStockLists() but deleted in wxAppBase::CleanUp() from where
wxDeleteStockLists() was called instead of in that function itself.

Remove this discrepancy.
2024-12-13 22:05:16 +01:00
Vadim Zeitlin 7a26088b55 Avoid markup text memory leak in wxStaticText
Add forgotten destructor.

This should have been even more part of hastily pushed 0f26d71bb7 (Merge
branch 'msw-stattext-markup', 2024-12-12), see #25000.
2024-12-13 00:15:37 +01:00
Vadim Zeitlin d6d61fcc68 Refresh wxStaticText after setting its markup label
This ensures that it is redrawn even when wxST_NO_AUTORESIZE is used.

This should have been part of 0f26d71bb7 (Merge branch
'msw-stattext-markup', 2024-12-12), see #25000.
2024-12-13 00:14:47 +01:00
Vadim Zeitlin 0f26d71bb7 Merge branch 'msw-stattext-markup'
Implement support for markup in wxMSW wxStaticText.

See #25000.
2024-12-12 23:04:24 +01:00
Vadim Zeitlin 9aedc796b2 Implement support for markup in wxMSW wxStaticText
Use generic-like implementation, i.e. simply draw the label ourselves in
this case.
2024-12-12 20:38:05 +01:00
Vadim Zeitlin 79a45dd8d7 Avoid refreshing wxGenericStaticText if its markup didn't change
For consistency with SetLabel(), and because this is generally more
useful, don't do anything in SetLabelMarkup() if the markup didn't
change.
2024-12-12 20:38:05 +01:00
Vadim Zeitlin 6df975fdb2 Allow to check if wxMarkupText has changed when setting it
This can/will be used for avoidiing to do anything if the markup hasn't
really changed.
2024-12-12 20:38:05 +01:00
Vadim Zeitlin 1ab3bacfc1 Remove redundant wxMarkupText::SetMarkup()
This does the same thing as the function inherited from the base class,
so just remove it.
2024-12-12 20:38:05 +01:00
Lauri Nurmi 87c1aae252 Fix double negatives used with 'neither'
Replace most 'neither' words introduced after 2b0ee48ef7
(Fix double negatives used with 'neither', 2023-11-25)
with 'either'.

All changes are to comments only.

Closes #24999.
2024-12-11 17:57:46 +01:00
Vadim Zeitlin 93016c95e0 Add wxAuiNotebook::UnsplitAll()
This function can be useful on its own, but will also used by the
upcoming notebook layout deserialization code.
2024-12-09 21:33:15 +01:00
Vadim Zeitlin 98e19b462c Add private wxAuiNotebook::GetMainTabCtrl() helper
Allow getting the main, i.e. central, tab container easily.
2024-12-09 21:33:14 +01:00
Vadim Zeitlin db8e0dee87 Add trivial wxAuiNotebookPage::RemoveAll() helper
This is more clear and efficient than deleting all pages one by one.
2024-12-09 21:33:14 +01:00
Vadim Zeitlin b997e3432e Extract wxAuiDockLayoutInfo, add functions for copying just it
This new struct will be used by wxAuiNotebook too in upcoming commits,
so extract it from wxAuiPaneLayoutInfo and extract the code used for
copying the layout information between it and wxAuiPaneInfo to the new
functions to allow reusing them from wxAuiNotebook code.
2024-12-09 21:33:14 +01:00
Vadim Zeitlin 33ead6fb6a Stop passing window to insert separately to wxAuiTabContainer
It's already part of wxAuiNotebookPage also passed to its AddPage() and
InsertPage() functions and there is no need to pass it as a separate
parameter.

This changes these functions in a backwards-incompatible way, and even
though they were never really supposed to be public, provide
backwards-compatible overloads for them just in case somebody used them.

No real changes, just simplify the code.
2024-12-09 21:33:14 +01:00
Vadim Zeitlin bfa27c2bb0 Merge branch 'aui-book-order' into master
Stop changing logical page order in wxAuiNotebook when pages are reordered.

See #24996.
2024-12-09 21:32:42 +01:00
Vadim Zeitlin ba5670145b Merge branch 'aui-split' into master
Some minor enhancements to wxAuiNotebook::Split().

See #24995.
2024-12-09 21:31:15 +01:00
Vadim Zeitlin ea42194f18 Document incompatible change to wxAuiNotebook page indices
Advise to use GetPagePosition() if the physical/visual position and not
the logical index is really needed.
2024-12-09 17:31:48 +01:00
Vadim Zeitlin f41bea84db Add wxAuiNotebook::GetPagePosition()
This can be useful to find the actual page position on screen, inside
its containing tab control, as opposed to its logical index.

Use the new function to show pages in their visual order in the AUI
sample.
2024-12-09 17:31:34 +01:00
Vadim Zeitlin 399868cbb7 Never change the logical page order in wxAuiNotebook
Always keep the pages in wxAuiNotebook::m_tabs in the order in which
they were added or inserted and only change their order in the tab
controls when they are interactively reordered by user.

Refactor page insertion code so that the new InsertPageAt() helper
function can be called from the code handling dragging tab to another
wxAuiNotebook too, instead of reproducing what it does there.

Also test InsertPage() in the sample.

This effectively reverts ab67e8874d (Fix wrong tab order in
wxAuiNotebook after dragging., 2012-12-23), see #10848.
2024-12-09 17:27:22 +01:00
Vadim Zeitlin b10298df0e Document that wxAuiNotebook always adds page to active tab control
It is not necessarily obvious that the pages are always added to it and
not being inserted into the position determined by the insertion index,
but this is the case now, so document this behaviour.
2024-12-09 17:27:22 +01:00
Vadim Zeitlin 0494112fec Show wxAuiNotebook::Split() in AUI sample
Test splitting the notebook into several tab controls.
2024-12-09 17:25:08 +01:00
Vadim Zeitlin 52ecc0c5da Simplify computing the new tab control size in Split()
Don't handle the case of having 1 or 2 pages specially, there doesn't
seem to be any good reason to do it, especially because splitting the
notebook programmatically by dragging the pages around doesn't do it.
2024-12-09 17:25:08 +01:00
Vadim Zeitlin d6cc23c12f Don't make wxAuiNotebook::Split() virtual
It doesn't make much sense to override it in user code.
2024-12-09 17:25:08 +01:00
Vadim Zeitlin 65118b7ea1 Merge branch 'aui-layout-no-docks'
Stop serializing docks separately in wxAUI.

See #24235, #24992.
2024-12-09 17:24:28 +01:00
Vadim Zeitlin 040e9f34a2 Merge branch 'aui-book-pages' into master
Minor wxAuiNotebook simplification and optimizations.

See #24993.
2024-12-09 17:24:14 +01:00
Vadim Zeitlin 3fc7d67215 Don't serialize docks information in wxAUI
We can simplify things by serializing the dock size, which is the only
information about them which is not recomputed by wxAUI itself when
redoing layout, as part of the panes layout data.

This is a bit inelegant because the same size is stored for all panes
that are part of the same dock, but it makes writing serializers and
deserializers significantly simpler, as they now only have to deal with
one kind of objects, and so seems to be worth it, especially because
with the previous approach we stored even more redundant data, with the
dock direction, layer and row duplicated between the dock itself and all
the panes contained in it.

This change will also make it much simpler to serialize the layout of
nested AUI managers, such as the one used by wxAuiNotebook, later.
2024-12-09 17:21:29 +01:00