Commit Graph

3309 Commits

Author SHA1 Message Date
Vadim Zeitlin
5ddeeee825 Merge branch 'gtk-datapick-events'
Make generic wxDatePickerCtrl more consistent with the native MSW.

See https://github.com/wxWidgets/wxWidgets/pull/868
2018-08-02 01:13:07 +02:00
Vadim Zeitlin
c83f3b3942 Clarify wxDateTime::GetTicks() limitation even more
Explain that this function exists only for interoperability purposes and
that GetValue() should be preferred for anything else.

Closes #18182.
2018-08-01 12:02:51 +02:00
Blake-Eryx
49e20a961d Fix misspellings in comments and documentation
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/870
2018-07-31 13:20:17 +02:00
Vadim Zeitlin
e3a728d637 Assert on invalid date in wxCalendarCtrl::SetDate() in all ports
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.
2018-07-30 21:46:50 +02:00
Vadim Zeitlin
71cef5f3be Stop using wxBU_AUTODRAW in wxWidgets code
This style bit is obsolete and doesn't do anything, so remove confusing
references to it.
2018-07-21 14:42:06 +02:00
Vadim Zeitlin
03a13591b9 Add wxDataViewToggleRenderer::ShowAsRadio()
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
2018-07-11 23:48:14 +02:00
Vadim Zeitlin
a1e780f1b4 Remove mention of wxEVENTS_COMPATIBILITY_2_8 from the docs
This macro doesn't exist any more since almost 10 years (see commit
890d70ebea).
2018-07-10 12:42:51 +02:00
Vadim Zeitlin
5e5f878db0 Improve wxWindow::FindWindowByName() documentation
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().
2018-07-03 18:54:19 +02:00
Artur Wieczorek
9acb2fe3a0 Fix AddArcToPoint when no current point is set on wxGraphicsPath
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.
2018-07-02 22:31:24 +02:00
Vadim Zeitlin
a824ee092d Change the return type of wxListCtrl::SetItem() overload to bool
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.
2018-06-28 00:39:31 +02:00
Artur Wieczorek
60669e9b50 Harmonize wxGraphicsPathData::AddArcToPoint() behaviour across all ports
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.
2018-06-27 22:46:45 +02:00
Vadim Zeitlin
689b9b78a3 Document that SetStatusText() updates the display immediately
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.
2018-06-27 19:37:23 +02:00
Olly Betts
e753dc6072 Improve wxTreeCtrl::SetItemState() docs
Make it clear that the state parameter can be an index into the state
image list, not just one of the special values listed.

Closes #18152.
2018-06-24 00:00:50 +02:00
Vadim Zeitlin
c0be6a38c4 Merge branch 'gtk-entry-hittest'
Implement wxTextCtrl::HitTest() for single line controls in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/826
2018-06-21 16:08:16 +02:00
Vadim Zeitlin
9cc2dbc9f1 Merge branches 'svgdc-clip' and 'fix-dc-clipper-restore'
Various clipping-related fixes.

See https://github.com/wxWidgets/wxWidgets/pull/835

See https://github.com/wxWidgets/wxWidgets/pull/836
2018-06-21 16:07:59 +02:00
pavel-t
710474c634 Allow configuring showing printing dialog in wxHtmlEasyPrinting
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
2018-06-21 16:03:38 +02:00
Vadim Zeitlin
350867939a Add bool return value for wxDC::GetClippingBox()
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.
2018-06-18 14:39:11 +02:00
Vadim Zeitlin
0d176db96d Merge branch 'array-less-macros'
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.
2018-06-10 22:56:03 +02:00
Vadim Zeitlin
96d9616201 Merge branch 'html-print-cleanup'
Simplify wxHTML pagination code and make it easier to reuse from
applications.

See https://github.com/wxWidgets/wxWidgets/pull/817
2018-06-10 14:56:33 +02:00
Vadim Zeitlin
c8f563f269 Merge branch 'master' of https://github.com/mmmaisel/wxWidgets
Make wxRibbonButtonBar buttons more customizable.

See https://github.com/wxWidgets/wxWidgets/pull/762
2018-06-04 23:03:24 +02:00
Vadim Zeitlin
0cda7c2f13 Mention that dynamic array classes are obsolete more clearly
Update the documentation of the classes themselves and the containers
overview.
2018-06-03 17:12:12 +02:00
Vadim Zeitlin
690b95646b Implement wxTextCtrl::HitTest() for single line controls in wxGTK
Use Pango API to find the character at the given position.

Closes #18144.
2018-06-03 17:05:11 +02:00
Vadim Zeitlin
bf9712978a Document wxHtmlDCRenderer::FindNextPageBreak()
This is a useful (even if mostly trivial) function, so document it and
mention it in Render() documentation too.
2018-05-25 01:32:31 +02:00
Vadim Zeitlin
b9b6ccb804 Remove "known_pagebreaks" from wxHtmlCell::AdjustPagebreak()
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.
2018-05-24 18:12:40 +02:00
Vadim Zeitlin
63add2cd19 Don't call AdjustPagebreak() in a loop, this seems useless
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.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
e01892c669 Split and simplify wxHtmlDCRenderer::Render()
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.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
f53923dd31 Left-align wxSpinCtrl contents by default
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.
2018-05-12 19:14:00 +02:00
Vadim Zeitlin
390c45d1d9 Merge branch 'tlw-geom'
Improve saving/restoring TLW geometry under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/795
2018-05-02 15:27:04 +02:00
Scott Talbert
83af2a428e Fix return type of wxNumberEntryDialog::GetValue() in documentation
Closes https://github.com/wxWidgets/wxWidgets/pull/796
2018-05-01 15:02:00 +02:00
Vadim Zeitlin
d97c055514 Introduce platform-dependent wxTLWGeometry class
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.
2018-04-29 19:51:10 +02:00
Scott Talbert
20a98406f0 Add missing documentation for wxNumberEntryDialog
Also explain when this dialog should be used instead of using the
usually more convenient wxGetNumberFromUser() function.

See https://github.com/wxWidgets/wxWidgets/pull/790
2018-04-25 18:26:27 +02:00
Frédéric Bron
6226e3b0d3 Emphasize the need for Realize() in wxToolBar documentation
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
2018-04-18 15:48:05 +02:00
Jan Niklas Hasse
496da2e550 Remove trailing whitespace from several files
No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/787
2018-04-18 15:45:42 +02:00
PB
748c0150c2 Clarify wxSL_SELRANGE description
The user cannot select a range, the selection range can be changed only programatically.
2018-04-07 21:51:08 +02:00
Vadim Zeitlin
deee5c19eb Document how to build wxWidgets with liblzma support
Explain what needs to be done under MSW in order to use LZMA compression
classes.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
251569496b Document wxGetLibLZMAVersionInfo() function
Add initially forgotten documentation.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
50b102ffd2 Add wxLZMAOutputStream for compressing data using LZMA
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.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
af7e2901fe Add wxLZMAInputStream for decompressing data in XZ format
No compression support yet.
2018-04-06 15:39:55 +02:00
Max Maisel
7612d1f6fa wxRibbon: Added @since tags to new function documentation 2018-03-26 16:50:32 +02:00
Max Maisel
2cbcf939df wxRibbonButtonBarButton: Implemented manual button size class control
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.
2018-03-17 18:38:02 +01:00
Max Maisel
7aed0e547b wxRibbonButtonBarButton: Implemented mutable lables and minimum label width
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.
2018-03-15 16:27:30 +01:00
Max Maisel
5d6ba5d335 wxRibbonButtonBarButton: Added SetButtonIcon()
Added new function SetButtonIcon() which modifies
button bitmaps of existing ribbon button bar buttons.
2018-03-14 16:46:49 +01:00
Vadim Zeitlin
fe7cb6f159 Merge branch 'gcc7-conv-warn'
See https://github.com/wxWidgets/wxWidgets/pull/754
2018-03-06 20:02:22 +01:00
Vadim Zeitlin
e777f2a253 Document that wxEVT_TREE_ITEM_MENU item is always valid
Mention that wxEVT_CONTEXT_MENU can be used to show popup menus that
should be shown even when clicking outside of the client area.
2018-03-06 19:51:31 +01:00
Vadim Zeitlin
9774d92e91 Change wxSize::Scale() to take double, not float
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.
2018-03-06 16:01:45 +01:00
Xaviou
813fdca24c Fix Wrong method name in wxAddRemoveCtrl documentation
Use the correct CanRemove() instead of the non-existent CanRename().

Closes https://github.com/wxWidgets/wxWidgets/pull/747
2018-02-26 13:19:04 +01:00
Vadim Zeitlin
26c18da2e4 Fix unreadable example in wxDataViewValueAdjuster documentation
@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.
2018-02-18 22:47:46 +01:00
Vadim Zeitlin
23c2d67c08 Improve wxDataViewListCtrl::AppendItem() and related methods docs
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
2018-02-17 13:29:57 +01:00
Vadim Zeitlin
958d0081a5 Close documentation comment accidentally left open
Fix an accidental removal of the closing comment marker in
a3673be155.

See https://github.com/wxWidgets/wxWidgets/pull/730
2018-02-17 13:17:54 +01:00
Hugo Elias
28bf0e8687 Add wxIMAGE_OPTION_GIF_TRANSPARENCY for GIF image loading
Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).

Closes #18014.
2018-02-16 16:28:33 +01:00