This was done in wxMSW and wxQt but not in the native GTK+ nor the
generic version, even though they still asserted when actually trying to
use the invalid parameter later.
Make things more clear and consistent by asserting immediately and also
document the behaviour more clearly.
This allows showing radio buttons in wxDataViewCtrl easily and natively.
Notice that this approach, adding an extra function to the existing
renderer class instead of creating some new wxDataViewRadioRenderer (see
https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen
because it is simpler to implement and, more importantly, because it
will be more natural to generalize if/when we also add a 3-state
check/radio renderer.
Closes https://github.com/wxWidgets/wxWidgets/pull/853
Mention that the "name" is interpreted as the label if no window with
such name is found.
Also document that both this and FindWindowByLabel() functions do
recurse into child TLWs, unlike FindWindow().
Current behavior of AddArcToPoint() when there is no current point is not
documented and moreover it is not the same in native macOS and in generic
implementation. Under macOS nothing is done and "no current point" error
is raised but under other ports (generic implementation) only arc
is drawn (without initial line).
When there is no current point, in similar functions AddCurveToPoint(),
AddQuadCurveToPoint() it is initially set to the some known control point
of the curve but this approach cannot be applied to AddArcToPoint().
The only well defined fallback point seems to be (0, 0) and this option
is implemented here.
See #18086.
For some reason lost in the depths of time (but probably just a typo)
(but probably just a typo) (but probably just a typo) (but probably just
a typo), SetItem() overload taking the column index returned "long" and
not "bool", even though the actual return value was always "true" or
"false" (or even just always "true" in the case of the generic version).
Change it to return "bool" for consistency with the other overload and
because this just makes more sense and shouldn't break any existing code
due to the implicit conversions between bool and long.
Also document the return value meaning.
Closes#18153.
AddArcToPoint() on macOS port is implemented with native API (CGPathAddArcToPoint) so its behaviour should be considered as a reference for generic implementation used in another ports.
Closes#18086.
This is done by explicitly calling Update() in the generic version and
seems to also be done by the native MSW one, even if it's not documented
to do it.
Add wxHtmlEasyPrinting::SetPromptMode() to allow suppressing the
"prompt" shown by wxPrinter::Print() when it's called from this class
code.
Closes https://github.com/wxWidgets/wxWidgets/pull/838
Determining whether there is an actual clipping region or not is not
that simple, as shown by the recent problems in wxDCClipper code, so
return a boolean value indicating this from GetClippingBox() directly,
instead of requiring the caller to find it out on their own.
This simplifies wxDCClipper code, as well as any other code calling
GetClippingBox(), at the price of some extra complexity in wxDCImpl
itself, which seems to be worth it.
Use templates to implement the legacy dynamic array classes as much as
possible instead of doing it in macros.
This makes the code much more maintainable and readable as well as
easier to debug.
It also allows to avoid casts between function pointers of incompatible
types, which triggered many -Wcast-function-type warnings from g++ 8.
This parameter is not actually needed for any reasonable page breaking
algorithm, as it shouldn't care about any previous page breaks except
for the last one, which is already known as "*pagebreak - pageHeight" in
this function.
Removing it will allow to stop using wxArrayInt in the code using this
method and switch to an std::vector<int> instead.
This is not a backwards compatible change, but it seems that there is
very little code actually overriding this function (none could be found
in any open source repositories) and updating it should be as simple as
removing the now unneeded argument.
There doesn't seem to be any reason to call this function more than once
on the same cell as the existing implementations are idempotent and it's
difficult to see why this should ever not be the case.
This function was difficult to understand as it did two quite different
things depending on the value of its "dont_render" argument and using it
also made CountPages() logic more complicated than necessary.
Simplify the code by splitting Render() into FindNextPageBreak(), which
is used by CountPages(), and Render() itself, which doesn't need to deal
with pagination at all as it's either already provided the page start
and end positions or can just assume that everything fits on a single
page (the latter is the case for the headers and footers renderer).
This is a notionally backwards-incompatible change, but no code using
wxHtmlDCRenderer could be found in the wild and the new API is so much
simpler that it seems to be worth switching to it.
The default alignment of the text in wxSpinCtrl was changed to "right"
in 7e4952db83, which added alignment
support (see #10621), but this made it inconsistent with the native
up-down control under MSW and, perhaps more importantly, with spin
controls created from XRC as the default style was never modified there
and did not include wxALIGN_RIGHT.
Resolve this inconsistency by reverting to left-aligning the text by
default.
Previously, TLW geometry was implicitly defined as just its position,
size and the maximized/iconized state by wxPersistentTLW code. This
already wasn't enough for wxGTK which added the decoration sizes to the
geometry being saved/restored, but this had to be done using conditional
compilation, which was not ideal. And it didn't allow using an entirely
different geometry representation as will be done for wxMSW soon.
Change the code to use wxTLWGeometry class defining the geometry, as
used by the current port, explicitly and move wxPersistentTLW logic into
it, as wxPersistentXXX classes are supposed to be very simple, which
wasn't really the case.
Also provide public SaveGeometry() and RestoreToGeometry() methods in
wxTopLevelWindow, which can be useful even to people not using
wxPersistentTLW for whatever reason.
There should be no changes in behaviour so far.
As it is essential for a correct behaviour of wxToolBar, explain in the
main documentation of the class that Realize() must be called to
construct the tools. Note: it is already explained in the constructor's
documentation and in AddTool's documentation.
Closes https://github.com/wxWidgets/wxWidgets/pull/786
As liblzma API is similar to zlib API, this class is also close to
wxZlibOutputStream, except that it uses reusable functions instead of
repeating their code.
Added new functions SetButtonMinSizeClass() and
SetButtonMaxSizeClass() that set a button's minimum
and maximum allowed size class during ribbon layout collapsing.
Size classes are values from wxRibbonButtonBarButtonState enum.
wxRibbonButtonBar::MakeLayouts() and
wxRibbonButtonBar::TryCollapseLayout() are modified to support
this new behaviour.
The modified wxRibbonButtonBar provate layout routines are
aware of wxRIBBON_BUTTONBAR_BUTTON_SMALL which is not implemented
yet in MSW wxRibbonMSWArtProvider::DrawButtonBarButtonForeground.
Added new function SetButtonText() which modifies labels of
existing ribbon button bar buttons.
The new function SetButtonTextMinWidth() is used to specify the
label width in advance so that lables can be changed without
recalculating the layout.
wxRibbonArtProvider is modified to support these operation.
There doesn't seem to be any reason to use float here when double is
used everywhere else.
Moreover, the (implicit) conversion of int to float is not always
lossless, and resulted in -Wconversion warnings from g++ 7, which
disappear when using doubles.
@code tag must be used to make the code readable and using @example
seems to be unnecessary and just results in the creation of an extra
"Examples" page in the documentation containing only this example and an
absolute path (apparently not affected by STRIP_FROM_PATH) to
interface/wx/dataview.h file itself in the generated documentation.
Explain that the vector passed to {Append,Insert,Prepend}Item() must
have the same number of elements as there are columns in the control and
that no more columns can be added after adding any items.
See https://github.com/wxWidgets/wxWidgets/pull/724
Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).
Closes#18014.