Commit Graph

66045 Commits

Author SHA1 Message Date
Cătălin Răceanu
c6354696d4 Do not leak the sort proxy model 2019-02-25 00:00:39 +02:00
Cătălin Răceanu
cb74819562 Don't leak QApplication and command line arguments 2019-02-24 23:45:46 +02:00
Vadim Zeitlin
385ebf2f4a Don't call UpdateSize() unnecessarily at the end of Realize()
SetRows(), called just above in most case, already calls UpdateSize(),
so there is no need to do it again.
2019-02-24 22:37:15 +01:00
Vadim Zeitlin
dc0586aad6 Remove a now unnecessary hack for vertical toolbars
Don't recompute their total fixed size and update them once again in
Realize() as the button heights seem to be just fine even without doing
this.
2019-02-24 22:37:15 +01:00
Vadim Zeitlin
23dee36ec3 Add accelerators for toolbar positioning menu items in the sample
This makes it much more convenient to quickly test different toolbar
orientations.
2019-02-24 22:33:33 +01:00
Vadim Zeitlin
62b4974bf0 Indentation fix in the toolbar sample
No real changes.
2019-02-24 22:33:33 +01:00
Vadim Zeitlin
1a79610361 Rewrite wxToolBar resizing logic in wxMSW
wxToolBar handled its size in a very unique way as it waited to be
resized and then set its size correctly from its own WM_SIZE handler.
This was very confusing and, worse, broke a very natural assumption that
after calling SetSize(size) on a window this window does have the
specified size -- which wasn't necessarily the case for wxToolBar,
resulting in problems such as the one in #18294.

The reason for doing it in such weird way is that the native toolbar
control is weird itself and uses a specific message (TB_AUTOSIZE) to
update its size and, moreover, doesn't always do it correctly (notably
for the vertical toolbars). It seems that we can make it work more or
less as wanted if we use TB_SETBUTTONSIZE _after_ TB_AUTOSIZE (why does
it need to be done in this order remains a complete mystery) and if we
correct the width of vertical toolbars in UpdateSize() (which is not
called from WM_SIZE handler but only from Realize() and other methods
modifying the toolbar, so it's not a problem for it to change the size).

The only known problem with this commit known at this time is that
stretchable separators in vertical don't work any longer, it seems that
the size passed to TB_SETBUTTONSIZE is just ignored in this case.
However stretchable toolbar separators are pretty rare nowadays and even
more so in vertical toolbars, so, arguably, this is not a big loss.

Also tweak the layout of the labels for the embedded controls to make
them more similar for the labels used for the normal tools and, notably,
allocate enough space if the label is longer than the control itself.

Closes #18294.
2019-02-24 22:32:22 +01:00
Vadim Zeitlin
7c8ba45705 Reuse helper MSWGetFittingtSizeForControl() in a couple of places
Refactor the code to reuse the same function for determining the size
needed by an embedded control in the toolbar, including its label.
2019-02-24 18:19:49 +01:00
Vadim Zeitlin
c7e8aac70f Explicitly skip expanding stretchable separators in MSW toolbars
When computing the fixed size of MSW toolbars, don't take stretchable
separators into account as this doesn't make sense and so, even if this
doesn't matter currently because the separators still have their
initial, fixed size when total fixed size is computed, but would start
mattering if UpdateStretchableSpacersSize() is ever called before this
is done and it also just makes more sense to skip them here.
2019-02-24 04:03:25 +01:00
Vadim Zeitlin
44d732b8a5 Use TB_SETBUTTONINFO when updating stretchable toolbar separators
This is simpler than TB_DELETEBUTTON followed by TB_INSERTBUTTON and
avoids weird side effects of using the old messages which affect the
toolbar size.

There should be no changes in behaviour with this change.
2019-02-24 03:38:52 +01:00
Vadim Zeitlin
82857cfa9d Add small helper function to wxMSW wxToolBar code
Encapsulate the logic for deciding whether we should show the labels for
the embedded controls or not in a small helper function, to make it
simpler to change it in the future if needed and also to have a single
place to explain why do we do what we do now.

No real changes.
2019-02-24 02:04:55 +01:00
Vadim Zeitlin
4a02b73a6a Use a symbolic constant instead of hardcoded 3
No real changes, just give a name to the constant used for the number of
pixels to leave between an embedded control and its label.
2019-02-23 19:03:51 +01:00
Vadim Zeitlin
44eb96b993 Get rid of unnecessary temporary variable in wxMSW wxToolBar
No real changes, just remove a variable only used once.
2019-02-23 18:38:52 +01:00
Cătălin Răceanu
0659006dc6 Implement wxListBox::SetFirstItem() for wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1236
2019-02-23 15:42:26 +01:00
Vadim Zeitlin
6b73d002d7 Merge branch 'gc-print-font-scale'
Fix size of text drawing using wxGraphicsContext when printing in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1214
2019-02-23 15:40:30 +01:00
Paul Cornett
40c81a6a4a Fix minimum height of backtrace window in wxGTK assert dialog
For GTK3 < 3.10, see #18347
2019-02-23 06:29:54 -08:00
Artur Wieczorek
775b98652f Fix setting minimum height of backtrace window in GtkAssertDialog
Minimum height needs to be set for the entire backtrace window
not for its child tree view.

Closes #18347.
2019-02-23 14:50:29 +01:00
Ryan Norton
b7f3a2b30f Make parsing wxURI paths more conforming to RFC 3986
Don't recognize the "path" following the port number without a slash as
a path, this is invalid according to the RFC.

Also require two leading slashes for URIs without the authority part.
2019-02-23 14:36:36 +01:00
Vadim Zeitlin
466a2d000f Use CHECK() in wxURI unit test case
This allows the subsequent tests to still run even if one of the tests
fails, which is more useful in this test than CPPUNIT_ASSERT_EQUAL(),
which maps to REQUIRE() and so stops the test execution as soon as any
check fails, because the tests are independent.
2019-02-23 14:11:58 +01:00
Cătălin Răceanu
0e3784c46e Implement support for value range in wxQt wxSpinButton
Closes https://github.com/wxWidgets/wxWidgets/pull/1237
2019-02-22 19:49:06 +01:00
Vadim Zeitlin
e9813688ad Merge branch 'spinbutton-up-down-events' of https://github.com/catalinr/wxWidgets
Fix wxSpinButton events in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1232
2019-02-22 00:03:04 +01:00
Cătălin Răceanu
1af2b7f05a Correct condition check for vetoed events 2019-02-21 19:48:45 +02:00
Vadim Zeitlin
85666cd22f Demonstrate vetoing wxEVT_SPIN_XXX events in widgets sample
Show that these events can be vetoed, which prevents the control value
from changing, and also that veto doesn't apply if the event handler
skips the event.

See https://github.com/wxWidgets/wxWidgets/pull/1232
2019-02-21 15:10:27 +01:00
Cătălin Răceanu
7588ed0cf4 Fix small styling issues in previous 2 commits 2019-02-21 08:19:02 +02:00
Cătălin Răceanu
d9c8932188 Ensure a valid page is initially selected in the widgets sample
Select first page if an invalid one was restored which may happen if the
build of the library has changed (e.g. some previously disabled
wxUSE_XXX became enabled etc).

Closes https://github.com/wxWidgets/wxWidgets/pull/1235
2019-02-21 04:49:12 +01:00
Graham Dawes
d08913edaf Default to wxTB_TOP if no toolbar position is given in wxQt
Qt requires a toolbar area to be specified or the toolbar is not added
to the window, so ensure that is no toolbar flag is given to the wxFrame
then wxTB_TOP is used.

Closes https://github.com/wxWidgets/wxWidgets/pull/1234
2019-02-21 04:47:01 +01:00
Graham Dawes
1e875c8ddc Set the event object and ID in events generated by wxQt
Add missing SetEventObject() calls and ID parameters in the ctor calls
for several events generated by wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1230
2019-02-21 04:35:51 +01:00
Vadim Zeitlin
38d7ba21e2 Merge branch 'tglbtn' of https://github.com/catalinr/wxWidgets
Reimplement wxToggleButton correctly for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1228
2019-02-21 04:33:56 +01:00
PB
f8090263de Fix recently introduced mojibake in text sample
During the samples-wide removal of obsolete wxT macros in
f58ea62596, the macros were
accidentally removed also from the place where they were required
(string literal casted to void* and then retrieved as wxChar*). This led
to names for m_tab and m_enter controls displayed wrong when logging
text events.

Fix this by restoring wxS() in this particular place.

See https://github.com/wxWidgets/wxWidgets/pull/945

Closes https://github.com/wxWidgets/wxWidgets/pull/1226
2019-02-21 04:26:46 +01:00
Cătălin Răceanu
0a1846eb9a Use correct event type for wxEVT_SPIN 2019-02-20 16:06:05 +02:00
Cătălin Răceanu
d4b29b3bcc Add support for wxEVT_SPIN_[UP|DOWN] events 2019-02-20 15:39:03 +02:00
Paul Cornett
1229ceb440 Remove unnecessary copy ctor/operator= definitions 2019-02-17 23:09:49 -08:00
Paul Cornett
e08a1d38e1 Use const reference parameter 2019-02-17 22:58:42 -08:00
Paul Cornett
34a3f0512d Remove redundant condtional/unreachable code 2019-02-17 22:55:56 -08:00
Paul Cornett
ff5d764b63 Simplify conditional expression
!A || (A && B) --> !A || B
2019-02-17 22:49:58 -08:00
Paul Cornett
7c75f46098 wxOVERRIDE 2019-02-17 22:42:26 -08:00
Paul Cornett
3b8404ce48 Avoid potential buffer overrun
Need to allow for terminating nul
2019-02-17 22:32:40 -08:00
Paul Cornett
36f742e2e7 Avoid pointless bitwise operation on a bool 2019-02-17 22:28:44 -08:00
Paul Cornett
66f88e401e Avoid potential memory leaks 2019-02-17 22:26:36 -08:00
Paul Cornett
123b96e214 Avoid potential 31-bit shift of signed 32-bit value 2019-02-17 22:22:08 -08:00
Paul Cornett
0cb9231720 Avoid shifting negative value 2019-02-17 22:20:50 -08:00
Paul Cornett
71972a5265 Use pre-increment operator with iterators 2019-02-17 18:48:40 -08:00
Paul Cornett
360342659b Remove unimplemented wxListBase ctor declaration 2019-02-17 18:26:17 -08:00
Paul Cornett
ad59df7355 Remove unuseable wxListBase ctor
It calls Append(void*), which calls the pure virtual CreateNode(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:19:16 -08:00
Paul Cornett
c41ff4e694 Remove unuseable wxPGArrayEditorDialog ctor
It calls Create(), which calls the pure virtual ArrayGetCount(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:00:26 -08:00
Paul Cornett
9ea2ac92ef Fix wxCriticalSectionLocker usage
A temporary object will not hold the lock
2019-02-17 17:24:36 -08:00
Pavel Kalugin
be12bc6a8a Fix selection in generic wxDataViewCtrl after adding an item
Notify m_selection about the new item in all cases, not just when using
a virtual list model.

This was broken back in 36a5983f64 and
only fixed for virtual list controls, but not all the other ones, in
9f5af0a494.
2019-02-15 14:39:13 +01:00
Cătălin Răceanu
be9c18cbd6 Reuse Qt implementation of normal button for toggle buttons 2019-02-13 01:23:20 +02:00
Cătălin Răceanu
7be9c8c670 Remove functions that are identical with the ones in base classes 2019-02-13 01:15:19 +02:00
Cătălin Răceanu
50edbf24cc Change the base class of wxBitmapToggleButton 2019-02-13 01:09:16 +02:00