Commit Graph

4456 Commits

Author SHA1 Message Date
Artur Wieczorek
502ede23ab Don't expose internal wxPropertyGridPageState functions
Functions designed for internal use shouldn't be exposed as public ones
to avoid calling them directly from the user code by mistake.
2022-05-27 19:13:42 +02:00
Vadim Zeitlin
01c8978690 Merge branch 'docs-events' of https://github.com/PBfordev/wxWidgets
Several improvements to the event-related docs.

See #22448.
2022-05-23 22:31:34 +01:00
Vadim Zeitlin
411c150bba Merge branch 'print-preview-layout'
Print preview layout and appearance fixes.

See #22441.
2022-05-23 22:25:16 +01:00
Vadim Zeitlin
9042b529fa Merge branch 'dvc-bitmap-renderer-bundle'
Allow using wxBitmapBundle with wxDataViewBitmapRenderer.

See #22411.
2022-05-23 22:22:53 +01:00
PB
6f135cae70 Fix mistakenly added "events" category
The category was added to wxAuiToolBarStyle instead wxAuiToolBarEvent/
2022-05-23 20:05:02 +02:00
PB
97aae519fa Add "events" category to wxEvent-derived classes docs where missing
If a wxEvent-derived class documentation lacks "events" category,
the class will not appear in the Events class list.

The "events" category is still missing in several event classes
(e.g., palette events or wxRibbonToolBarEvent), but those lack
actual documentation aside from just methods declarations anyway.
2022-05-23 19:06:55 +02:00
Vadim Zeitlin
663fa1c77b Still use wxPreviewFrame size if it was explicitly specified
Even though it's better to not specify the preview frame size at all,
the size should still be used if it was explicitly specified, but this
didn't happen any more after the addition of the call to Fit().

Fix this now by only doing the equivalent of Fit() if no size was
explicitly given.

Also add advice about not setting the size explicitly to the
documentation.
2022-05-23 15:07:06 +01:00
Artur Wieczorek
547afc66c4 Pass large object by a const reference 2022-05-21 22:03:08 +02:00
Robin Dunn
e6f2325f63 Add some missing wxBitmap --> wxBitmapBundle changes 2022-05-16 15:33:41 -07:00
Vadim Zeitlin
2ba9007d0e Add wxCHECK_CXX_STD() and use it to test for C++17 and C++20
Unlike direct tests of __cplusplus, using this macro also works with
(recent enough, i.e. MSVS 2015.3 or later) MSVC versions, even if
/Zc:__cplusplus is not used.

This simplifies some checks and makes some other ones (notably the check
for C++20 used before wxALLOW_COMBINING_ENUMS macro definition) work
with MSVC versions with C++20 support as intended.
2022-05-11 16:57:18 +01:00
Vadim Zeitlin
140b88af4a Improve wxDataViewRenderer variant type documentation
Explain what it is in the ctor documentation and link to the new
IsCompatibleVariantType() in GetVariantType() docs.
2022-05-11 17:23:56 +02:00
Vadim Zeitlin
a7eee933c6 Merge branch 'tsan-warnings'
Fix a harmless warning from thread sanitizer and make wxAtomicInc() more
useful.

See #22417.
2022-05-11 02:37:26 +02:00
Vadim Zeitlin
bb52a5c5b5 Merge branch 'imaglist-mask'
Make handling of masks in wxImageList simpler and more useful.

See #22400.
2022-05-11 02:35:59 +02:00
Vadim Zeitlin
c036bdf3e5 Recommend using std::atomic instead of our functions
The standard class is much more flexible and type-safe.
2022-05-11 00:18:02 +02:00
Vadim Zeitlin
cf66ce5f94 Return the new value from wxAtomicInc() too
This is easy to do and can be useful when using an atomic initialization
counter.

The only platform where not returning the new value might be more
efficient than returning it is Solaris which is not really relevant any
more and on all the other platforms the functions we were already using
provided this value already (or almost, in case of using gcc builtins,
when we just have to use a different one).
2022-05-11 00:16:47 +02:00
Vadim Zeitlin
1b82a9fe04 Use wxBitmapBundle as default type in wxDataViewBitmapRenderer
The default type doesn't really matter after the previous commits, as
the renderer accepts both wxBitmap and wxBitmapBundle (and also wxIcon)
in any case anyhow, but it seems better to use the preferred type as the
default one.

Also make the documentation more useful, although an example is still
lacking.
2022-05-09 14:36:41 +02:00
Vadim Zeitlin
23e815bcf6 Allow relaxing the check for variant type in wxDataViewRenderer
Instead of checking for the exact variant type match, call the new
IsCompatibleVariantType() virtual function, which still does the same
check by default, but can be overridden to allow other types as well if
they're accepted by the renderer.

This will be soon used to allow accepting both wxBitmap (which must
still be accepted for compatibility) and wxBitmapBundle (which is the
simplest way to support high DPI) in wxDataViewBitmapRenderer at once.
2022-05-08 18:39:15 +01:00
Vadim Zeitlin
dc90e92110 Add wxBitmapBundle::Clear()
This is just a convenient helper for resetting the bundle contents which
seems more readable than assigning an empty bundle to it.
2022-05-08 15:54:51 +01:00
Vadim Zeitlin
937fa42d10 Document that wxGetTimeZone() doesn't account for DST
This is intentional and won't be changed, although we could, perhaps,
add a wxGetDST() function or similar to make it easier to take DST into
account as well.

Closes #22399.
2022-05-08 16:18:29 +02:00
Vadim Zeitlin
0e544960b0 Fix example of creating wxUILocale in its documentation
There are several ways to do it, and it's not clear which one of them
should be illustrated here, but it should definitely be one that works.

Closes #22389.
2022-05-07 16:34:45 +02:00
Vadim Zeitlin
6feeed9fe9 Handle transparency to the best of our ability in wxImageList
Don't take the value of "mask" parameter of wxImageList constructor too
prescriptively, it predates support for alpha in wxWidgets by many years
and was never meant to actually suppress using it.

Instead, do the best thing we can in all cases, i.e. use alpha if it's
specified and supported and use mask otherwise. But only create the mask
from light grey colour if we have nothing else if "mask" is true in
wxImageList constructor, as this is a potentially destructive action
that must not be performed if the user has explicitly decided to set
this parameter to false.

Incidentally fix handling of alpha with comctl32.dll v5 (which is used
in the absence of any manifest) by converting it to a mask in this case:
this is not ideal, but better than just using black background as it
happened before, and restores pre-3.1.5 behaviour.

Also simplify the generic version which just has to create the default
mask if necessary and doesn't have to do anything at all in all the
other cases.

Note that these changes required relaxing some of the existing unit
tests as wxMSW implementation now can add alpha channel to the bitmaps
that didn't have it -- but this is a more useful behaviour, and so it
makes more sense to adapt the tests to it rather than doing a less
useful thing just to conform to the tests.

This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-spac options.

Closes #22349.
2022-05-06 02:12:54 +01:00
PB
68dee47694 Explain how to best use wxFrame as input form
Add information about the recommended way of using wxFrame
as a form, i.e., to not create the input controls as its
direct children but use wxPanel for this instead.

Closes #22395.
2022-05-05 17:32:43 +02:00
DietmarSchwertberger
ec737396d8 Unify wxGrid code for processing row and column mouse events
Reuse the same code for handling mouse events for both rows and columns
instead of duplicating almost (but not quite) the same code for both of
them.

As part of resolving the inconsistencies between the two versions, add
wxEVT_GRID_ROW_AUTO_SIZE corresponding to the existing event with the
same name for the columns.

Closes #22380.
2022-05-05 17:23:45 +02:00
Vadim Zeitlin
eb5ad7255c Merge branch 'shared-client-data'
Allow sharing client data in wxGrid-related classes.

See #22369.
2022-05-01 02:55:36 +02:00
Vadim Zeitlin
9a36e26d4a Merge remote-tracking branch 'MaartenBent/wxdc-dpi'
Make wxDC and wxGraphicsContext DPI aware, i.e. add {From,To}DIP() to
them too and make the values returned from Get{DPI,PPI}() consistent
with wxWindow.

Also improve CMake build: add support for finding Cairo when not using
GTK, fix a warning when creating the inplace-config, and mark some
variables as advanced.

See #22346.
2022-05-01 02:53:12 +02:00
Frode Roxrud Gill
f646e8b11c Allow cloning client data stored in wxGrid attributes etc
Add wxSharedClientDataContainer class storing ref-counted client data
and use it instead of plain wxClientDataContainer in wxGridCellAttr,
wxGridCellEditor and wxGridCellRenderer classes.

This allows to keep the same client data associated with many grid cells
without having to make many copies of it.
2022-04-28 00:28:58 +02:00
Vadim Zeitlin
05014523bc Merge branch 'document_missing_webview_event' of https://github.com/swt2c/wxWidgets
More documentation fixes: inconsistent or missing declarations.

See #22366.
2022-04-27 19:45:16 +02:00
Scott Talbert
1a531def4b Fix wxTextCtrl::OSXEnableNewLineReplacement documentation 2022-04-26 22:31:54 -04:00
Scott Talbert
db8eb640eb Document missing wxWebView events 2022-04-26 20:12:24 -04:00
Maarten Bent
6072d3aeee Add documentation for wxDC and wxGraphicsContext FromDIP and ToDIP
Remove documentation of removed function GetDPIScaleFactor.
2022-04-26 21:35:05 +02:00
Lauri Nurmi
e3bf759615 Add wxTRANSLATE_IN_CONTEXT() macro for marking strings for translation
Similarly to wxTRANSLATE(), this macro does not do much itself.
2022-04-24 11:30:31 +03:00
Uwe Runtemund
28f62b2e59 Add support for creating wxBitmapBundle from wxIconBundle
This is useful for converting existing code using wxIconBundle for
similar purposes to switch to using wxBitmapBundle instead.

Closes #22347.
2022-04-23 17:31:46 +02:00
Vadim Zeitlin
ac60d78d8d Merge branch 'toolbar-bitmap-size'
Make wxToolBar::SetToolBitmapSize() take size in logical pixels.

See #22338.
2022-04-21 21:24:46 +02:00
PB
8c9c6f5088 Fix examples in wxBitmapBundle documentation
Add the missing label parameter to AddTool() calls.

Closes #22345.
2022-04-21 21:21:51 +02:00
Scott Talbert
be106d3fed Document missing wxEVT_FULLSCREEN 2022-04-20 22:54:06 -04:00
Vadim Zeitlin
eb6506e677 Make wxToolBar::SetToolBitmapSize() take size in logical pixels
Previously it interpreted its argument as being in DIPs, which was
perhaps more convenient, but inconsistent with most of the other
functions and broke the general rule that FromDIP() should be used with
all hard-coded sizes.

Update the sample to use FromDIP() when calling it now, improve the
documentation and fix a bug in AdjustToolBitmapSize() which resulted in
not increasing the bitmap size when moving toolbar sample using "large"
toolbar size from a standard DPI display to a high DPI one: the old code
considered that the new size was the same as the old one and returned
before comparing it with m_requestedBitmapSize, which resulted in the
bitmaps not changing size at all instead of doubling their size as they
were expected to.
2022-04-19 23:36:02 +01:00
Scott Talbert
6fa4e1b912 Fix wxWebViewFactory::GetVersionInfo documentation 2022-04-18 23:25:13 -04:00
Scott Talbert
cfbf667513 Fix wxMenuItem::AddExtraAccel documentation 2022-04-18 22:36:55 -04:00
Uwe Runtemund
94f698cc15 Add functions for getting current ribbon tool rectangle
wxRibbonButtonBar::GetItemRect() and wxRibbonToolBar::GetActiveTool()
are helpful for positioning other windows (e.g. popup ones) that should
be aligned to tools and buttons in the ribbon bar.

Closes #22329.
2022-04-19 00:46:58 +02:00
Vadim Zeitlin
692073ea7d Merge branch 'fix_lc_removesortindicator_doc' of https://github.com/swt2c/wxWidgets
Fix a couple of wrong signatures in the documentation.

See #22326.
2022-04-19 00:40:40 +02:00
Vadim Zeitlin
bf3b653492 Merge branch 'auibook-help'
Fix infinite recursion when processing wxEVT_HELP for wxAuiNotebook
pages.

See #22323.

Closes #22309.
2022-04-19 00:38:39 +02:00
Vadim Zeitlin
4d163de84e Merge branch 'dc-content-scale-factor'
Add GetDPIScaleFactor() to wxDC and wxGraphicsContext to allow scaling
the coordinates and sizes depending on the DPI.

See #22314.
2022-04-19 00:28:09 +02:00
Vadim Zeitlin
e3bf5d6845 Document wxDC::GetContentScaleFactor() too
This function existed since a long time but somehow was never
documented.

Also minor improvements to the just added documentation of
wxDC::GetDPIScaleFactor().
2022-04-19 00:27:23 +02:00
Artur Wieczorek
b06b950574 Document changes in wxImageFileProperty
Remove references to the non-public member variables
from documentation.
2022-04-18 22:17:31 +02:00
Scott Talbert
19d3e2d902 Fix wxIcon::GetLogicalSize documentation 2022-04-17 23:41:46 -04:00
Scott Talbert
7a98e93bb4 Fix wxListCtrl::RemoveSortIndicator documentation 2022-04-17 22:27:29 -04:00
utelle
8ab635b451 Improve wxLocale backwards compatibility and enhance wxUILocale
Restore the old behaviour of wxLocale, which is supposed to use the
default locale and not the preferred language, which may not be the same
(see #22281).

Also apply the following fixes and improvements to wxUILocale:

- Add new GetSystemLocale() method.
- Change the MSW implementation to use the default locale instead of the
  preferred UI language for Windows versions below Windows 10.
- Change the Unix implementation to respect LANGUAGE environment
  variable and use it for determining the preferred UI languages.
- Use wxUILocale in wxTranslations to determine the preferred UI
  languages.
- Use wxUILocale during initialization of internat sample.

Closes #22281.

Closes #22318.
2022-04-17 18:04:21 +02:00
Vadim Zeitlin
fac4822ab3 Make wxAuiNotebook::FindPage() work correctly
Make this function virtual in the base class so that it could be
overridden to do the right thing in wxAuiNotebook, instead of just
always returning NULL as before and add a unit test checking that it
works.

Explain that wxBookCtrlBase::m_pages may not be used in the derived
classes, but that in this case they must override all the methods using
it.

Finally, "soft-deprecate" wxAuiNotebook::GetPageIndex(), which is
identical to FindPage() now.

This fixes infinite recursion when handling wxEVT_HELP in wxAuiNotebook
in wxUniv too, see #22309.

Closes #15932.
2022-04-16 23:01:57 +01:00
Vadim Zeitlin
8afbf79d02 Take const pointer in wxAuiTabContainer::GetIdxFromWindow()
Allow passing const pointers to this function, as it doesn't need to
modify them at all.
2022-04-16 22:52:30 +01:00
PB
92deb92e29 Use doubled backslashes in examples in wxFileName documentation
Fix syntax of C strings in the examples.

Closes #22311.
2022-04-16 15:34:08 +02:00