Commit Graph

66225 Commits

Author SHA1 Message Date
Vadim Zeitlin
fa16db08c1 Remove the extra height hack from wxToolBar::DoGetBestSize()
There doesn't seem to be any good reason to add 3px to the vertical
component of the toolbar best size and it's not clear how can the
original problem be reproduced.

This basically reverts c118d8b06e.
2019-02-28 23:24:40 +01:00
Vadim Zeitlin
1661f277d5 Only use packing in horizontal direction for toolbar controls
Tool packing seems to be relevant only in the major toolbar direction,
i.e. horizontally when the controls are shown, and adding it in vertical
direction too made the toolbar too tall.
2019-02-28 23:23:15 +01:00
VZ
6374aef924 Use explicit constructor for better type restriction
Co-Authored-By: catalinr <catalinr@users.noreply.github.com>
2019-02-27 22:11:50 +02:00
Cătălin Răceanu
934698d8ac Change Qt smart pointers with wx ones to fix compilation 2019-02-27 22:06:47 +02:00
Cătălin Răceanu
088d698c08 Don't give focus to a frame when clicking outside a focused child
Closes https://github.com/wxWidgets/wxWidgets/pull/1238
2019-02-27 17:17:06 +01:00
Cătălin Răceanu
66f6559a58 Replace accessor with an older version 2019-02-27 17:46:02 +02:00
Cătălin Răceanu
1578240b6e Change a couple of data types and simplify code a bit 2019-02-27 17:42:01 +02:00
Cătălin Răceanu
113822d024 Change member variable type 2019-02-27 16:58:35 +02:00
Vadim Zeitlin
0b973fb357 Use critical alert style for wxICON_ERROR too in wxOSX
After the changes of 6b8b3ee379 we could
use NSCriticalAlertStyle for message boxes with wxICON_WARNING, if they
also has Yes/No or Cancel button, but never for wxICON_ERROR, for which
just NSWarningAlertStyle was used, which seems counterintuitive, so
change the code to use NSCriticalAlertStyle for either wxICON_WARNING or
wxICON_ERROR message boxes asking the user about something.

Closes https://github.com/wxWidgets/wxWidgets/pull/1242
2019-02-27 01:42:53 +01:00
Cătălin Răceanu
c00187eaeb Do not leak menus and menu items 2019-02-27 02:07:06 +02:00
Cătălin Răceanu
82523b3d3b Do not initialize base class variable and do not leak old allocation 2019-02-27 01:39:14 +02:00
Cătălin Răceanu
315a9460c0 Remove memory leaks by using smart pointers or explicit delete 2019-02-27 01:12:03 +02:00
Cătălin Răceanu
dc4854f916 Do not reallocate base class member, which also led to a leak 2019-02-26 23:36:14 +02:00
Cătălin Răceanu
e6e6b1ea38 Do not initialize member variables of base classes 2019-02-26 23:32:38 +02:00
Cătălin Răceanu
d34017f656 Initialize member variable 2019-02-26 23:31:54 +02:00
Cătălin Răceanu
b91d2a93ee Set sizer to the main frame and avoid leaking it 2019-02-26 23:21:13 +02:00
Cătălin Răceanu
595a9945b5 Do not leak the list of panes 2019-02-26 23:13:12 +02:00
Paul Cornett
0fc5413974 Call static functions directly 2019-02-25 23:53:51 -08:00
Paul Cornett
393d2c61a7 Fix -Wreorder warning 2019-02-25 23:52:53 -08:00
Paul Cornett
fb1a46b933 Remove test of always-true condition 2019-02-25 23:48:28 -08:00
Paul Cornett
1e753f97ba Remove initializations which are the default value 2019-02-25 10:49:04 -08:00
Paul Cornett
7c3ce912e0 Use ctor-initializer rather than assignment for non-POD class members 2019-02-25 10:23:35 -08:00
Paul Cornett
8df0cfba2a Use pre-increment on iterators 2019-02-25 09:20:44 -08:00
Paul Cornett
b5028f267d Remove unused variables, unused assignments 2019-02-25 09:12:43 -08:00
Maarten Bent
ceee8d554a Fix invalid iterator access in wxTaskBarButton
Iterators are invalid after they are deleted. Store the value before
deleting.

Reuse code of RemoveThumbBarButton.

Closes https://github.com/wxWidgets/wxWidgets/pull/1240
2019-02-25 15:12:45 +01:00
Paul Cornett
5c5f4eb32e Fix format specifier type mismatch 2019-02-25 00:50:19 -08:00
Paul Cornett
60fb8f93cb Check for self-assignment in operator= 2019-02-25 00:48:41 -08:00
Paul Cornett
90ecc401c0 Remove duplicate condition
wxICON_ERROR == wxICON_HAND
2019-02-25 00:44:02 -08:00
Paul Cornett
cd045cc490 Add missing break statements 2019-02-25 00:41:50 -08:00
Paul Cornett
5e3c39043d Fix wxQT monolithic build on Linux
- Remove duplicate wxConsoleAppTraits::CreateEventLoop()
  It's already defined for Unix as well as Windows

- Remove wxEventLoop AddSourceForFD() "override"
  the base version is static and therefore clearly not meant to be overridden
2019-02-25 00:35:27 -08:00
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