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.
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.
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.
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.
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.
Add forgotten destructor.
This should have been even more part of hastily pushed 0f26d71bb7 (Merge
branch 'msw-stattext-markup', 2024-12-12), see #25000.
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.
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.
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.
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.
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.
Using wxAuiPaneInfo for serialization was confusing as it has some
fields that must be serialized, some fields that can be serialized but
don't have to be, and some fields which should never be serialized.
Add wxAuiPaneLayoutInfo which contains just the subset of the fields
that always must be serialized to make things more clear.
Update the sample to avoid serializing fields which can never be changed
directly by the user.
No real changes, just return the button directly from this function
instead of using an output parameter for it.
Still preserve the old signature for compatibility, as it doesn't cost
much and it's not clear whether this function was supposed to be public
or not: lack of documentation is not a good indicator here, as none of
the functions in this class are documented, so err on the side of
caution.
This combines calls to DoShowHide() and Refresh() (which can't be called
by DoShowHide() itself because it has no window to call it on), which
were almost invariably called together, so this simplifies the calling
code and also makes the function intention, and the fact that it needs
to be called after changing the active page, more clear.
When we already have the page index, it's just strange to call
RemovePage() which loops over all the pages to find it again -- so don't
do it and call the new function directly instead.
Use DeletePage() and RemovePage() inherited from the base class and just
override and implement DoRemovePage() instead of providing a dummy stub
for the latter.
This omits the code implementing special handling of wxAuiMDIChildFrame
but it's not really clear why did it have to be there, it looks like it
can be deleted as any other child window.
This object shouldn't be destroyed as long as there are any
wxWebRequests using it still alive, as destroying them after the session
would result in a crash, so replace a (possibly dangling) reference to
wxWebSessionImpl in wxWebRequestImpl with a shared pointer, which keeps
it alive for as long as necessary.
See #24969.
Previously it did the same thing as SetValue() in wxMSW but didn't do
anything in wxGTK (and probably other ports), which made it easy to
write code that only worked under Windows but mysteriously didn't show
any text under Linux.
Change it to not do anything anywhere and add an assert to help
detecting wrong uses of this function.
Also add a unit test checking this behaviour.
See #24982.
This makes more sense, as they're supposed to be character types, not
integer ones, and fixes the build with libc++ 19 which doesn't provide
std::char_traits specializations for types other than char, wchar_t and
charNN_t, so that std::basic_string<wxUint32> can't be compiled with it
any more without specializing std::char_traits on our own which we'd
rather avoid.
See #24959.
Closes#24958.
Use "WX" prefix for it, just as for all the other constants in the same
enum instead of the lower-case "wx" (which is still preserved for
compatibility).
See #24965.
Closes#24964.
Remember the value of ID tags attributes in the cell and find them later
when we're looking for them.
To make it easier to initialize the ID of the cells, add wxHtmlCell ctor
taking wxHtmlTag which gets the ID directly from it, and add wxHtmlTag
arguments to derived cell classes ctors too. In some cases, however, we
still need to use the new CopyId() function to set the ID of an already
existing cell.
Closes#17728.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
By default, wrap the options descriptions to make output prettier.
It is also possible to disable this by explicitly passing
wxCMD_LINE_WRAP_NONE to Parse() and related functions or always wrap at
80 columns, for example.
This could be enhanced, e.g. break lines at characters other than
spaces, support Unicode better etc, but for now add just a very simple
function that should be suitable for wrapping help message in
wxCmdLineParser, where it will be used next.