Commit Graph

67209 Commits

Author SHA1 Message Date
Ilya Sinitsyn
7f91481294 Add XRC handler for wxInfoBar
Update the schema and the sample to show it in action.

Closes https://github.com/wxWidgets/wxWidgets/pull/1564
2019-09-27 12:57:01 +02:00
Vadim Zeitlin
68b36aed6d Only give messages about unsupported accelerators in wxGTK
Doing this under all platforms results in too many false positives,
which can't be avoided currently, e.g. even if an application uses "Tab"
as an accelerator only under MSW, these messages still appear (in debug
builds, but this is more than sufficient for them to be annoying).

For now, restrict the messages to wxGTK only. In the future we could
revert to giving them under all platforms if we provide some way of
disabling them, e.g. qualifying accelerators with "[port]" or "[!port]"
string before them.

This partially reverts 6596f5a98d, see
https://github.com/wxWidgets/wxWidgets/pull/1505

Closes https://github.com/wxWidgets/wxWidgets/pull/1566
2019-09-27 12:47:03 +02:00
Vadim Zeitlin
9a0072b12e Remove wxDECLARE_NO_COPY_CLASS from a local class in wxGrid test
Declaring the copy ctor/assignment operator for a local class without
defining them triggers MSVC warning C4822, so don't do this to avoid
unnecessary noise in the build logs (we could disable the warning or
conditionally do this for non-MSVC compilers, but it doesn't seem to be
worth doing this for a class used inside a single function and very
unlikely to be copied accidentally).
2019-09-26 22:23:36 +02:00
Vadim Zeitlin
6789e69e4b Only call tzset() once and not from each wxGetTimeZone() call
Doing this resulted in noticeable performance problems under MSW,
especially when using non-default locale.

Closes #17094.
2019-09-26 01:30:04 +02:00
Paul Cornett
1753ed4037 Fix typo in wxXmlDocument documentation 2019-09-24 11:49:58 -07:00
Vadim Zeitlin
aeef8295c8 Update bundled Expat to 2.2.8
This notably fixes CVE-2019-15903.

Closes https://github.com/wxWidgets/wxWidgets/pull/1562
2019-09-24 02:31:19 +02:00
Vadim Zeitlin
b0ff3bf3ea Ensure that wxGrid appearance always reflects its enabled state
Override DoEnable() in wxGrid instead of Enable() to ensure that the
grid is shown appropriately for its current state whenever either it or
its parent is disabled.

Note that this also fixes the bug with only the main grid window being
refreshed, but not the row/column headers, which also need to be.
2019-09-24 01:44:55 +02:00
Vadim Zeitlin
ec76367afd Grey out grid headers if its parent is disabled too
It doesn't really matter whether the grid is disabled because it was
explicitly disabled itself or because it's implicitly disabled due to
its parent being disabled, it should still show its disabled status to
the user by rendering its headers in a greyed out state.
2019-09-24 01:32:53 +02:00
Mick Waites
1214676988 Set default page size for wxSlider as in the other ports
Make the page size 1/10 of the total range, as in wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/1524
2019-09-22 03:07:43 +02:00
Jay Nabonne
cd9a8fb695 Do not switch state if drag-and-drop is not allowed in wxTreeCtrl
Avoid setting state to DragSelectingState unless dragging items in
wxTreeCtrl is explicitly allowed, as this this causes bad behaviour
downstream with subsequent selections when the client does anything in
the event handler beyond simply not allowing the event.

Basically, we can't be guaranteed of the mouse state on return from the
event handler, so dropping into drag selection mode is potentially
inappropriate (or just plain bad).

Closes https://github.com/wxWidgets/wxWidgets/pull/1523
2019-09-22 03:03:20 +02:00
Matthew Griffin
337644f702 Cancel any edit in progress when wxTreeCtrl is scrolled
Otherwise the editor could be scrolled out of view, confusing the user.

Closes https://github.com/wxWidgets/wxWidgets/pull/1522
2019-09-22 03:00:36 +02:00
Graham Dawes
8c18ee8c25 Apply font family for wxFont in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1512
2019-09-22 02:53:57 +02:00
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