Commit Graph

66994 Commits

Author SHA1 Message Date
Graham Dawes
39cb337008 Generate events when selecting tree items programmatically
In wx API, calling wxTreeCtrl::SelectItem() is supposed to generate an
event.

Also use Qt selection model to support single-selection mode.

Closes https://github.com/wxWidgets/wxWidgets/pull/1453
2019-09-22 02:44:59 +02:00
Graham Dawes
c8eef72417 Fix wxNotebook::CalcSizeFromPage() to account for tabs height
Actually implement this function instead of just returning the size
passed into it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1425
2019-09-22 02:42:21 +02:00
Vadim Zeitlin
1ca012240a Merge branch 'qt_statictext_create' of https://github.com/GeoTeric/wxWidgets into qt-fixes
Call SetLabel() from wxStaticText ctor instead of bypassing its logic by
using QLabel directly.

Closes https://github.com/wxWidgets/wxWidgets/pull/1424
2019-09-22 02:40:31 +02:00
Vadim Zeitlin
54c1359d1f Add precondition checks to Do{Get,Set}ClientSize()
Don't crash if these methods are called before the window is created.
2019-09-22 02:38:59 +02:00
Graham Dawes
cd7594e639 Don't include scrollbars in client area size
Return the size of just the viewport when using QScrollArea.

Closes https://github.com/wxWidgets/wxWidgets/pull/1418
2019-09-22 02:37:11 +02:00
David Roberts
18b87b2ab5 Send wxEVT_CHECKLISTBOX when a checkbox is clicked
Fix sending events from wxCheckListBox in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1403
2019-09-22 02:30:05 +02:00
Graham Dawes
cc1ec9e562 Show tooltip in wxTreeCtrl when item text doesn't fit on screen
This matches the behaviour of the native control in wxMSW and is
generally useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/1397
2019-09-22 02:12:35 +02:00
Matthew Griffin
273448fb80 Fix Qt implementation of wxTreeCtrl::Toggle()
It was mistakenly implemented as toggling selected item, not whether
item is collapsed or expanded.

Closes https://github.com/wxWidgets/wxWidgets/pull/1395
2019-09-22 02:08:48 +02:00
Matthew Griffin
9434a443f5 Ensure that QCloseEvents can be vetoed by wx
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.

And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1371
2019-09-22 02:05:32 +02:00
Jay Nabonne
fcd6ee5324 Disable Qt's automatic "auto default" state for buttons
Let the wx layer handle default-ness, as the auto behaviour has unhappy
consequences that can't be controlled via the wx API. (For example, a
Delete button being considered default simply because it's the first
button in the dialog.)

Closes https://github.com/wxWidgets/wxWidgets/pull/1366
2019-09-22 01:54:56 +02:00
Vadim Zeitlin
3b491c0776 Don't skip event after capturing mouse in wxAUI in all ports
This was previously done only under Mac, but it doesn't seem to make
much sense to skip the mouse event if we handled it by capturing the
mouse and it seems to create problems in wxQt too, so just generalize
the Mac behaviour to all platforms.

See https://github.com/wxWidgets/wxWidgets/pull/1360
2019-09-22 01:45:30 +02:00
Mick Waites
9a64acbb79 Ensure correct previous page is sent for notebook events
Qt notebook page changed events had the wrong "previous page" index in
circumstances where the page has been changed by methods other than
clicking on the tabs, for example using the "Pages->Next page" menu
option in the notebook sample.

Closes https://github.com/wxWidgets/wxWidgets/pull/1359
2019-09-22 01:36:28 +02:00
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