Commit Graph

66982 Commits

Author SHA1 Message Date
Matthew Griffin
0c7f261c4a Fix position for wxContextMenuEvent generated from keyboard
The position was wrong for the keyboard-triggered menu events in
wxWindows containing multiple sub-windows, such as wxListCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/1352
2019-09-22 01:34:09 +02:00
Matthew Griffin
71ad73fdbe Fix wrong position in wxMouseEvent generated by sub-window
Use screen coordinates, as the window coordinates in QMouseEvent may be
relative to a different window.

Closes https://github.com/wxWidgets/wxWidgets/pull/1351
2019-09-22 01:29:52 +02:00
Vadim Zeitlin
cfbe47560e Merge branch 'qt_list_ctrl_hit_test_offset' of https://github.com/GeoTeric/wxWidgets into qt-listctrl
Fix wxListCtrl::HitTest() which was off roughly by 1 due to not taking
into account the header height.

Closes https://github.com/wxWidgets/wxWidgets/pull/1350
2019-09-22 01:20:42 +02:00
Vadim Zeitlin
35de675830 Extract waiting for the first paint event in a reusable function
No real changes, this is just a refactoring to allow reusing the same
loop waiting until we can get the real window geometry in other tests.

This commit is best viewed with --color-moved.
2019-09-22 00:56:23 +02:00
Vadim Zeitlin
da8cecbfe5 Add a unit test checking that Move() doesn't change frame size
This used to be broken in wxQt until it was fixed by the previous
commit.

See https://github.com/swig/swig/pull/1613
2019-09-22 00:50:32 +02:00
Jay Nabonne
be22e8fa95 Fix DoMoveWindow() to take into account the frame extent
Using "move" is correct for positioning, as it takes into account the
frame extent. Unfortunately, there is no corresponding API to set the
frame size. So we need to compute the effective client size and use
"resize". We can't use "setGeometry" for this purpose, since a widget's
"geometry" excludes the frame size. We would need to adjust the position
to go from frame to client coordinates. It's more straightforward to
simply have Qt do it with "move".

Closes https://github.com/wxWidgets/wxWidgets/pull/1349
2019-09-22 00:50:32 +02:00
Vadim Zeitlin
baca938ce3 Rewrite SetSizeTestCase to not use CppUnit macros neither
Do the same thing as in the previous commit to another test.

No real changes.
2019-09-22 00:50:32 +02:00
Vadim Zeitlin
3a4538a18c Rewrite client size unit test without using CppUnit macros
No real changes, just simplify the test.
2019-09-22 00:50:23 +02:00
Jay Nabonne
d66aa35254 Fix handling captured mouse events in a window with scrollbars
Handle some mouse events explicitly when a wxQtScrollArea is set as
"mouse captured".

The issue arises in that the QScrollArea has two methods: event() and
viewportEvent(). Normally a "QAbstractScrollAreaFilter" is set up by Qt
which routes any events to the viewportEvent() method. And the normal
event() method throws mouse events away (for reasons I'm not aware of -
but it is what it is). If a wx window with a scroll area (e.g.
wxRichTextCtrl) sets capture, the wxQtScrollArea (QScroll-derived) gets
set as the direct "mouse grabber", and all events then bypass the filter
and are sent directly to the "event" method, which throws them away. The
typical result is that the window setting capture no longer gets mouse
events, it keeps capture since it's looking for a mouse up that never
comes, and the app more or less locks up since all mouse events are
being effectively discarded.

This change catches any event that comes in via the event() method and,
when the mouse is captured by the widget, forwards it on to the
viewportEvent method instead, performing what the filter would do via
the normal event routing.

It doesn't forward on "mouse press" events because the initial event
that causes the capture ends up being fed back again, resulting in a
"captured twice" error. The underlying reason I can see for this "being
fed back again" is that, for some inexplicable reason, the
wxRichTextCtrl "skips" the event even though it has actually processed
it and taken capture. That means this solution isn't 100%, but it does
fix the 99%+ cases where the capture is only gotten to redirect mouse
moves and button ups.

Perhaps an alternative solution might be to stop grabbing the mouse in
wxQtScrollArea, but this would require more changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1346
2019-09-20 02:59:13 +02:00
Paul Cornett
6b606a3e27 Fix wxBitmap pixbuf representation after changing mask with GTK3
As with GTK2, masked pixbuf needs to be purged when mask changes
2019-09-19 08:34:43 -07:00
Paul Cornett
6d44e9a1c6 Fix changing mask on bitmap with alpha on GTK2
See #18508
2019-09-18 22:45:47 -07:00
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
Liam Treacy
5a228ceb91 Show docking hint under wxQt too in wxAUI
See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Liam Treacy
4bfb3a5f01 Implement wxFrame::DoSetClientSize()
Resize the central widget to fit the new size.

See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
b8d5c85ecb Make Reparent() work for wxFrame in wxQt
Use the correct parent window, i.e. the one of the central widget and
not of the frame itself.
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
616fc76173 Don't use default window style hints in wxFrame
Building on windowFlags() meant that we inherited a bunch of default
flags that were not affected by Qt::CustomizeWindowHint because we
explicitly specified them when calling setWindowFlags().

Instead of doing this, start with nothing and just add the styles that
we need.

This notably ensures that the frames created without wxCLOSE_BOX style
actually don't have any close button.

Closes https://github.com/wxWidgets/wxWidgets/pull/1335
2019-09-15 01:35:16 +02:00
Vadim Zeitlin
9a182d0982 Move assert for calling SetItemCount() without wxLC_VIRTUAL
This makes it more clear that the base class method is not supposed to
be called.
2019-09-15 00:56:36 +02:00
Vadim Zeitlin
409748be72 Consistently use InitListEvent() to initialize wxListEvents
This notably fixes missing item index and data for the CHECKED events,
and simplifies the code in the other places.
2019-09-15 00:42:41 +02:00
Vadim Zeitlin
d579b5760f Factor out InitListEvent() helper function
No real changes, this is just a refactoring in preparation for future
changes.
2019-09-15 00:42:19 +02:00