Commit Graph

66851 Commits

Author SHA1 Message Date
Artur Wieczorek
de5f8c69e5 Fix build with wxUSE_LIBTIFF==0 2019-09-19 00:39:59 +02:00
Artur Wieczorek
7f65e654ee Add tests of drawing wxBitmap 2019-09-19 00:38:30 +02:00
Artur Wieczorek
5aac5ae562 Migrate wxBitmap tests to Catch 2019-09-19 00:37:48 +02:00
Artur Wieczorek
919a4ec702 Fix drawing wxBitmap with mask
Under wxGTK+2, when wxBitmap has a wxMask but this mask shouldn't be used
in the actual drawing (useMask parameter in wxDC::DrawBitmap() is set to
false), we need to get bitmap data from the buffer with raw (original,
non-masked) data and not from the buffer containing data with mask applied.

Close #18498.
2019-09-18 23:58:48 +02:00
Artur Wieczorek
f7247086c2 Fix storing wxBitmap data in GdkPixbuf
Under wxGTK+2 bitmap data with mask and without it (raw) should be stored
in the separate GdkPixbuf buffers - just like it's done in wxGTK+3. These
two buffers are necessary because only GdkPixbuf with raw bitmap data
(original, non-masked) should be copied when wxBitmapRefData instance is
cloned e.g. in SetMask(). GdkPixbuf with masked data is not copied and is
created on first use in wxBitmap::GetPixbuf().

Closes #18508.
See #18498.
2019-09-18 23:34:35 +02:00
Vadim Zeitlin
a65c0c29ac Fix row/column confusion in UpdateCurrentCellOnRedim()
This function, just added in dda6aa6bdc,
inverted row and column arguments of SetCurrentCell(), resulting in
assert failures when the grid size changed.

See https://github.com/wxWidgets/wxWidgets/pull/1546
2019-09-18 18:07:31 +02:00
Vadim Zeitlin
fcd734387a Fix best size computation for multiline wxTextCtrl in wxGTK
The initial value was not taken into account before because the best
size computed before it was set, i.e. for the empty control, was always
used, as it was never invalidated.

Do invalidate it now if the control is created with non-empty value, in
order to adjust its best, and initial, size appropriately to its
contents.

Closes #18507.

Closes https://github.com/wxWidgets/wxWidgets/pull/1560
2019-09-18 14:35:12 +02:00
Vadim Zeitlin
bb1c3c4ebb Merge branch 'osx-dvc'
Some wxOSX wxDataViewCtrl fixes OSX.

See https://github.com/wxWidgets/wxWidgets/pull/1556
2019-09-18 14:34:10 +02:00
Vadim Zeitlin
daa64f2ee4 Merge branch 'dvc-inconsist-fixes'
Fix several inconsistencies in wxDVC between wxGTK and the other
implementations.

See https://github.com/wxWidgets/wxWidgets/pull/1547
2019-09-18 14:33:34 +02:00
Vadim Zeitlin
da1944a5cc Merge branch 'grid-autosize-native-header'
Fix auto-sizing column labels when using native header in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/1559
2019-09-18 14:32:02 +02:00
Vadim Zeitlin
ff285aa5b6 Add docs/msw/binaries.md to the list of files to update
This file contains the version of the library.
2019-09-18 02:19:13 +02:00
Vadim Zeitlin
8ed487923d Fix QT version in a comment for wxPORT_QT
No real changes.
2019-09-18 02:19:13 +02:00
Vadim Zeitlin
f45a53308e Merge branch 'doc-fix' of https://github.com/PBfordev/wxWidgets
Minor corrections to the various documentation files.

See https://github.com/wxWidgets/wxWidgets/pull/1557
2019-09-18 02:08:04 +02:00
Vadim Zeitlin
7a0f57ea29 Fix assert in the generic file dialog in the dialogs sample
Cast the dialog pointer to wxFileDialogBase to avoid failures when using
wxGenericFileDialog, which inherits from wxFileDialogBase, but not from
wxFileDialog itself.

Closes #18506.
2019-09-18 02:05:07 +02:00
Ilya Sinitsyn
3c72396a36 Fix auto-sizing column labels when using native header in wxGrid
Use wxHeaderCtrl-specific GetColumnTitleWidth() function to account for
the native header control margins, otherwise the computed width could be
insufficient for short columns, resulting in their ellipsization.
2019-09-18 01:27:39 +02:00
Ilya Sinitsyn
0766283b2e Add wxHeaderCtrl::GetColumnTitleWidth() overload taking index
This makes it possible to get the appropriate column width from outside
the class, as GetColumn() itself is currently protected and so the
existing overload couldn't easily used.
2019-09-18 01:21:36 +02:00
Ilya Sinitsyn
d8c3c53f05 Make wxRendererMSW::GetHeaderButtonMargin() more accurate
Follow Wine in using 3*SM_CXEDGE as margins on each side.

This also has the advantage of working better in high DPI, as we don't
hardcode the value in pixels any longer.
2019-09-18 01:15:22 +02:00
PB
60dbb7d5bd Correct the tool path in docs/contributing/how-to-release.md
Correct the name and path of the batch file used to build
official MSVS binaries.
2019-09-17 19:53:06 +02:00
PB
87c1f2302f Fix typo in docs/msw/install.md 2019-09-17 19:45:53 +02:00
PB
698c0c09ae Update docs/contributing/binary-compatibility.md
Attempt to update the document, some parts of it are still
quite outdated (references to Sun/Solaris, ancient GCC and
wxWidgets version...).
2019-09-17 19:07:22 +02:00
Vadim Zeitlin
b9338b6130 Call wxDataViewCustomRenderer::ActivateCell() in Mac version too
Do this for consistency with the other ports.

Closes #17746.
2019-09-17 00:09:00 +02:00
Ilya Sinitsyn
e26d90028b Allow disabling hiding columns when using wxHeaderCtrl in wxGrid
Add wxGrid::DisableHidingColumns() method which can be used to prevent
wxHeaderCtrl from allowing the user to hide columns interactively, which
is something it allows to do by default, unlike the "built-in" wxGrid
header.

Also add EnableHidingColumns() and CanHideColumns() for consistency with
the other similar methods.

Closes https://github.com/wxWidgets/wxWidgets/pull/1554
2019-09-16 23:32:59 +02:00
Ilya Sinitsyn
4302c6b8ba Fix showing the popup menu in wxHeaderCtrl under Mac
wxOSX asserts if a menu item with id of 0 is created, so use 1-based IDs
to avoid this.

Using an explicit constant for the base instead of using 0 implicitly
also arguably makes the code more clear.

Closes https://github.com/wxWidgets/wxWidgets/pull/1555
2019-09-16 23:19:15 +02:00
Artur Wieczorek
0818e334fd Fix making a copy of wxBitmap
Because wxBitmap can have both alpha channel and mask, so the presence of the mask shouldn't prevent alpha channel from being enabled (if necessary).
2019-09-16 20:32:28 +02:00
Artur Wieczorek
992b594c15 Fix creating CGImage from bitmap data
Alpha channel values of created CGImage should be
a superposition of the actual alpha channel values
and bitmap mask (if exists).

See #18498.
2019-09-16 20:31:35 +02:00
Artur Wieczorek
64a08c0c9a Fix converting wxBitmap with alpha channel and mask to wxIcon
For bitmap with both alpha channel and mask we have to apply mask on our own because 32 bpp icons don't work properly with mask bitmaps. To do so we will create a temporary bitmap with copy of RGB data and with alpha channel being a superposition of the original alpha values and the mask.

See #18498.
2019-09-16 18:37:52 +02:00
Artur Wieczorek
2d15218c9d Fix drawing wxBitmap with both alpha channel and mask
For 32 bpp wxBitmap with both alpha channel and mask we have to apply mask on our own while drawing the bitmap because MaskBlt() API doesn't work properly with 32 bpp RGBA bitmaps. To do so we need to create a temporary bitmap with copy of original RGB data and with alpha channel being a superposition of the original alpha values and the mask.

See #18498.
2019-09-16 18:37:52 +02:00
Vadim Zeitlin
3a9869b4c4 Fix crash when deleting item being edited in wxOSX wxDataViewCtrl
Avoid touching the model while updating the control due to the items
being deleted from it, as doing this can easily result in dereferencing
pointers to the already deleted objects and crashing.

This is rather ugly, but the original code seems to have been written
with this approach in mind (see preexisting comments in ItemDeleted())
and, to be fair, there doesn't seem any other solution with the existing
API, as it allows (or maybe even requires?) deleting the items _before_
notifying the control about their removal and so not giving it any
opportunity to stop editing the item while it's still alive.

Closes #18337.
2019-09-16 18:04:44 +02:00
Vadim Zeitlin
c0df6ec475 Merge two wxDataViewWidgetImpl::Remove() overloads into one
Having 2 different overloads might have been useful for Carbon
implementation, but as they do exactly the same thing in the Cocoa
version, leave only one of them -- and don't pass it the item, or items,
being deleted as they're not used anyhow.

No real changes.
2019-09-16 17:48:00 +02:00
Jouk
b2cdcb6824 Include all objects in library on OpenVMS-AXP 2019-09-16 08:23:29 +02:00
Vadim Zeitlin
8a27b2e6bf Fix Backspace in wxTextCtrl with custom autocompleter in wxMSW
Pressing Backspace in controls with custom autocompleter previously
didn't do anything at all, as it didn't work correctly after backspacing
over the just inserted autocompletion, but this was clearly wrong, as it
didn't update the list of available completions even after erasing some
non-autocompleted characters.

Fix this by handling Backspace as any other key and just avoiding
refreshing the control contents needlessly if the completion prefix
didn't change.

Closes #18503.
2019-09-15 23:07:42 +02:00
Vadim Zeitlin
0146c47a7f Generate wxEVT_TEXT_ENTER for Enter key on Numpad too in wxMSW
Handle WXK_NUMPAD_ENTER in the same way as we already handle WXK_RETURN.

Closes #18504.
2019-09-15 14:31:42 +02:00
Vadim Zeitlin
dfc6cdc063 Emphasize that wxDC::Clear() used brush set by SetBackground()
Ensure that people don't get the impression that using SetBrush() is
supposed to affect Clears().

See #18463.
2019-09-14 23:08:20 +02:00
Paul Kulchenko
9d704706cb Respect AUI toolbar buttons sticky state in native MSW theme
Indicate that the items are sticky by always drawing them in a
hover-like state, as otherwise stickiness wasn't visible at all.

Closes #18496.
2019-09-14 20:20:05 +02:00
Vadim Zeitlin
93815ad2d2 Merge branch 'listctrl-itemrect'
Improve wxListCtrl::GetSubItemRect() and add a unit test for it.

See https://github.com/wxWidgets/wxWidgets/pull/1511
2019-09-14 16:37:57 +02:00
Lauri Nurmi
b42895345a Log a debug message when unloading a dynamic library fails on MSW
Logging (even non-debug logging) in similar situation already happens on
*nix.

Closes https://github.com/wxWidgets/wxWidgets/pull/1545
2019-09-13 14:45:09 +02:00
Jouk
c836ca7312 correction on Fix build after the last commit 2019-09-13 14:38:50 +02:00
Vadim Zeitlin
0ccfd9c0e9 Fix build after the last commit
Remove the extraneous parenthesis in the preprocessor test.
2019-09-13 14:15:39 +02:00
Jouk
9a271ab676 Switching on wxUSE_CAIRO for wxX11 on OpenVMS 2019-09-13 08:03:45 +02:00
Ilya Sinitsyn
dda6aa6bdc Fix assert with setting current cell in wxGrid::Redimension()
Avoid calling wxGrid::SetCurrentCell(0, 0) when the grid has no columns
or rows, as it doesn't have any cells then and doing this logically
fails the precondition assert in GetColPos().

Also refactor all 6 different snippets calling SetCurrentCell() in
Redimension() into a single function to simplify the code and make it
more maintainable.

Add a unit test verifying that this works as intended.

Closes https://github.com/wxWidgets/wxWidgets/pull/1546
2019-09-13 00:47:48 +02:00
Vadim Zeitlin
59e9da28f5 Improve wxDataViewModel::Cleared() documentation
Explain that this method can be useful not only when the model is
cleared.
2019-09-12 23:43:42 +02:00
Vadim Zeitlin
54a8d1d8f3 Don't send events when changing model in wxGTK wxDataViewCtrl
Sending events from e.g. AssociateModel(NULL) made the GTK version
inconsistent with the other ones, neither of which sent any events in
this case, and could result in a lot of grief in the user code if it
didn't expect the event handler to be called at this moment (e.g. during
the destruction).

Make wxGTK compatible with the other ports and safer by always disabling
the selection changed events before calling gtk_tree_view_set_model().

Note that it's still incompatible with the other ports because they also
preserve the selection even after the change of model, but wxGTK loses
it. Ideally this would be fixed too, but for now live with this as the
lesser evil.
2019-09-12 23:36:20 +02:00
Vadim Zeitlin
063b6edf68 Add a check for resetting the associated model to the sample
Verify that resetting the model doesn't result in selection change
events.
2019-09-12 23:20:20 +02:00
Vadim Zeitlin
18594afe76 Remove checks for model stamp validity not needed any longer
The code setting the model stamp to 0 was removed in the last commit, so
also remove the code checking for stamp being 0.
2019-09-12 23:13:11 +02:00
Vadim Zeitlin
5403ec4e08 Make Cleared() behave consistently with the other ports in wxGTK
Instead of actually deleting all the items from the control, just
refresh it by resetting the model, as this is what Cleared() does in
both the generic and native macOS versions of wxDataViewCtrl, so calling
it there resulted in very different results from doing it under wxGTK,
where instead of refreshing the control contents it raelly cleared it.

The name of this method is unfortunately confusing, but it seems better
to change its behaviour in wxGTK, even if this doesn't match the name,
rather than change it in the other ports to make them do the same thing,
as this could break some currently working code.

Also, this change results in a welcome code simplification.
2019-09-12 23:08:10 +02:00
Vadim Zeitlin
0d005bdf02 Add wxEVT_DATAVIEW_SELECTION_CHANGED test handler to the sample
Verify that the sample is not invoked unexpectedly.
2019-09-12 23:00:14 +02:00
Vadim Zeitlin
f99b80612a Add a simple test of wxDataViewIndexListModel to the sample
This is useful to investigate inconsistencies in its behaviour between
the generic and the native GTK versions that can't be easily checked in
the automatic unit tests.
2019-09-12 18:51:36 +02:00
Vadim Zeitlin
eca006da06 Indent "case Page_VarHeight" properly
No real changes, just reindent the code.
2019-09-12 18:31:42 +02:00
Vadim Zeitlin
c715bb750b Use symbolic page numbers in the dataview sample
Make the code a bit more readable.

No real changes.
2019-09-12 18:24:03 +02:00
Robin Dunn
41b444e011
Merge pull request #1455 from wxWidgets/gradient-pen
Add support for gradients in wxGraphicsPen
2019-09-11 20:17:34 -07:00