Commit Graph

66409 Commits

Author SHA1 Message Date
Maarten Bent
19c66c780d White-space only changes in wxSVGFileDC code 2019-04-10 23:37:34 +02:00
milotype
755906a431 Update Croation translations
Closes https://github.com/wxWidgets/wxWidgets/pull/1284
2019-04-08 14:33:26 +02:00
Paul Cornett
0aa8b5874f Fix setting markup on a wxButton that was initially created with an empty label
See #18378
2019-04-07 15:01:04 -07:00
Vadim Zeitlin
909adbb6bf Use correct separator sizes in MSW wxToolBar best size calculation
Don't assume that all the items (except for the controls) have the same
size in wxToolBar::DoGetBestSize(), this is manifestly not true at least
for the separators and resulted in too much space left over at the end
of the toolbar.
2019-04-07 13:25:25 +02:00
Paul Cornett
955a60a3e1 Avoid possible memory leak 2019-04-05 11:10:03 -07:00
Paul Cornett
9511ab08f1 More use of wxOVERRIDE 2019-04-05 11:08:53 -07:00
Paul Cornett
794c1374b8 Remove unneeded overrides
These just forward to the base class
2019-04-05 10:54:54 -07:00
Paul Cornett
fe1737d399 Reduce the scope of some local variables 2019-04-05 10:44:02 -07:00
Paul Cornett
af1cf0a5f3 Use ctor-initializer rather than assignment for non-POD class members 2019-04-05 10:21:04 -07:00
Paul Cornett
691521e411 Avoid comparing unsigned values with < 0 2019-04-05 10:12:27 -07:00
Paul Cornett
1bba25c7ee Avoid out-of-bounds array index 2019-04-05 10:10:07 -07:00
Paul Cornett
9299f9f1d8 Avoid left shift of 32-bit value by more than 31 2019-04-05 10:02:51 -07:00
Paul Cornett
7cbe23830f Avoid truncation of expression assigned to larger type 2019-04-05 09:55:49 -07:00
Paul Cornett
1a90833839 Avoid 31-bit left shift of 32-bit signed values 2019-04-05 09:48:35 -07:00
Paul Cornett
628e7af79e Check for self-assignment in operator=() 2019-04-05 09:27:15 -07:00
Paul Cornett
8791313aff Add defaults to switch statements to avoid many warnings about unhandled enum values 2019-04-05 09:26:05 -07:00
Paul Cornett
67773f58f1 Avoid immediate destruction of temporary wxBusyInfo object 2019-04-05 09:23:40 -07:00
Paul Cornett
210e162302 Use newer wxDECLARE_* macros 2019-04-05 09:21:29 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
d52acfe469 Use correct printf format specifier 2019-04-05 09:09:53 -07:00
Paul Cornett
6a35140686 Remove redundant conditionals 2019-04-05 09:06:06 -07:00
Vadim Zeitlin
0dfe0d0a9c Don't add extra padding in wxMSW wxToolBar best size calculation
DoGetBestSize() mistakenly added extra (half of) padding for each tool
explicitly when the padding is already taken into account of by
GetToolSize() itself, so this resulted in extra space at the end of the
toolbar proportional to the number of buttons in it.
2019-04-05 13:39:31 +02:00
Paul Cornett
25e9be6873 Avoid binding reference to NULL pointer when wxUSE_VALIDATORS==0
Undefined behavior sanitizer complains about it
2019-04-04 10:56:14 -07:00
Paul Cornett
90ce6a4334 Remove unused variables 2019-04-04 10:40:45 -07:00
Paul Cornett
5629f71c32 Remove unused/redundant assignments 2019-04-04 10:28:42 -07:00
Paul Cornett
ff01f4a5a8 Avoid uninitialized variables 2019-04-04 10:17:21 -07:00
Paul Cornett
e89cd4f2dd Fix unintentional self-assignment
Assume what it was meant to be
2019-04-04 10:09:21 -07:00
Paul Cornett
ea5cf38d62 Fix unused variables
Infer from context how they were meant to be used
2019-04-04 09:59:01 -07:00
Vadim Zeitlin
9f95e86e76 Fix apparent activation loss after hiding previous popup
Commit 58d4b0e209 introduced a regression:
if a previous popup still existed when the new one was shown, dismissing
the second popup would result in the owner window losing its "active"
appearance.

This was due to the fact that ::GetActiveWindow() still returned the
former popup when it was about to be dismissed, so it was too early to
call it in WM_NCACTIVATE handler. Do it now in DismissOnDeactivate()
itself which is both simpler and more correct.
2019-04-02 18:13:27 +02:00
Vadim Zeitlin
1f64877ca4 Merge branch 'msw-display-refresh'
Fixes for display information refreshing under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/1282
2019-04-02 17:19:01 +02:00
Vadim Zeitlin
b0ad9ccffd Use control current, not best, size in wxMSW wxToolBar layout code
Avoid allocating too much space to the control in the toolbar, it may
have been made smaller than its best size on purpose and, in any case,
we don't resize the control, so it's useless to allocate more space to
it than it's going to use.

See #18294.
2019-03-31 13:39:57 +02:00
Vadim Zeitlin
3959810d42 Avoid unnecessary cached display information updates
Only invalidate display cache when something related to the displays has
changed and not whenever any system option has.

This should avoid completely unnecessary refreshes when a UAC prompt is
shown, for example: even if doing this works now, after the previous
commit, we still don't have to do it at all.
2019-03-31 13:22:30 +02:00
dasimx
f3c5923e1a Fix refreshing display information in wxMSW in some special cases
Passing screen HDC to EnumDisplayMonitors() doesn't work if we do it
while a UAC prompt is shown or during log-off process, so change the
code enumerating the displays to use monitor-appropriate HDC instead.

This fixes the problem with losing display information entirely if
WM_SETTINGSCHANGE was generated when showing UAC prompt, as it happens
when "automatic background color" option is set under Windows 10.
2019-03-31 13:18:41 +02:00
Vadim Zeitlin
8927d7b092 Update displays sample correctly when displays change
wxEVT_DISPLAY_CHANGED notifies not only about the change of resolution
of a display, but also about removal or addition of a new display, so we
need to completely repopulate the notebook showing the displays on
receiving it.
2019-03-31 13:04:43 +02:00
dasimx
e9ca12aaac Remove the now unnecessary wxDisplayFactoryMSW::RefreshMonitors()
wxDisplay::InvalidateCache() does the same thing this function does, so
just remove it to avoid confusion.

This also allows to get rid of ms_factory duplicating the factory
pointer stored at wxDisplay level.

See https://github.com/wxWidgets/wxWidgets/pull/1281
2019-03-30 14:15:14 +01:00
Vadim Zeitlin
58d4b0e209 Fix for showing multiple popups in a row in wxMSW
There were at least 2 problems when showing a transient popup while
another one was already shown in wxMSW, as could be seen by showing
several wxRichToolTips in a row from a timer event handler, for example:

First problem was that wxCurrentPopupWindow was incorrectly reset in
this case by the old popup window when it was hidden, even though it
should have been remaining set to the new popup window. Fix this by
checking that we only reset wxCurrentPopupWindow when hiding the popup
if it still points to this popup, but not if it has been changed to
point to another one in the meanwhile.

Second problem was more mysterious and resulted in simply not receiving
the activation events for the new popup when showing it resulted in
hiding the previous one. The working hypothesis is that hiding a window,
which changes activation on its own, from WM_NCACTIVATE handler in our
code confused ShowWindow(), which handles switching activation, which
didn't expect this to happen, so the fix is to avoid doing anything
immediately from this handler and wait until the next idle event to do
it instead.

These fixes ensure that showing several popups in a row works correctly,
i.e. hides the previous popup when a new one is shown and also keeps the
parent window appearing active during all the time and deactivates it if
the focus switches to another top level window at the end.
2019-03-30 04:11:46 +01:00
New Pagodi
211b81f459 Restore handling of XPMs with a mask in wxStyledTextCtrl
Fix XPM to RGBA conversion code for Scintilla markers to handle mask
correctly.

Closes #18374.
2019-03-30 03:44:09 +01:00
dasimx
a15004fc5f Fix handling display disconnection under wxMSW
Information about display cached in wxDisplayFactory::m_impls and in
wxDisplayFactoryMSW::m_displays could get out of sync after removing a
display from the system, resulting in failures when calling various
wxDisplay functions later.

To fix this, reuse InvalidateCache() to invalidate the cache in
wxDisplayFactoryMSW too, making it virtual in order to allow overriding
it there. Also call InvalidateCache() from wxDisplayFactoryMSW itself
instead of doing it from wxWindow, as this works even when the
application isn't showing any windows (and also keeps all
display-related code together).

Closes https://github.com/wxWidgets/wxWidgets/pull/1246
2019-03-29 23:19:59 +01:00
PB
15a68c9916 Add basic information to wxDisplayChangedEvent documentation
The event had no description at all, so at least the very basic
information has been added.

Closes https://github.com/wxWidgets/wxWidgets/pull/1280
2019-03-29 22:17:48 +01:00
PB
198a1efee5 Correct wxListCtrl::InsertColumn() documentation
In InsertColumn(long, const wxListItem&) a line was split inside a
referred overloaded method signature which prevented doxygen to
recognize and link the referred method.

In InsertColumn(long, const wxString&, int, int) non-existing
Insert(long, const wxListItem&) overload was referenced instead of
InsertColumn(long, const wxListItem&).

Clsoes https://github.com/wxWidgets/wxWidgets/pull/1279
2019-03-29 21:32:49 +01:00
Vadim Zeitlin
7f39e4ab88 Merge branch 'gtk-mnemonics'
Fixes for association of controls with their mnemonics in wxGTK.

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

Closes #15776.
2019-03-29 19:22:05 +01:00
Vadim Zeitlin
e81c738694 Fix spurious assert in wxMSW when destroying a TLW with buttons
This commit partially reverts 17055fb8c6
which resulted in asserts when destroying dialogs with buttons, one of
which had focus, see https://github.com/wxWidgets/wxWidgets/pull/1245

This happened because wxGetTopLevelParent() returns NULL when the parent
TLW was already half-destructed, resulting in an assert, while the
original code still returned NULL in this case, but did it silently,
which is the right thing to do here as we can't avoid being called
during the parent TLW destruction.

Closes https://github.com/wxWidgets/wxWidgets/pull/1268
2019-03-29 19:20:19 +01:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

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

Closes #18294.
2019-03-29 19:16:40 +01:00
Vadim Zeitlin
6b6fee8685 Avoid TB_DELETEBUTTON errors when recreating wxMSW wxToolBar
Reset the number of buttons to skip deleting the old buttons in
wxToolBar::Recreate() as these buttons don't exist any more (having been
created in the old control) and trying to delete them just results in
debug error messages from TB_DELETEBUTTON.
2019-03-29 19:13:45 +01:00
Vadim Zeitlin
876d0f293f Avoid querying wxToolBar size in wxMSW while it's being recreated
Recreating the toolbar tried to offset the new toolbar window being
created by the size of the existing toolbar, when it was set up as the
main frame toolbar. Luckily, this didn't work because getting the size
of a wxWindow without a valid HWND failed, but it resulted in debug
warning messages and was a wrong thing to do in the first place.

Fix this by hiding the old toolbar before destroying it, this suffices
for the parent frame not to use it for the client area calculations.
2019-03-29 19:09:49 +01:00
Vadim Zeitlin
b0133392b7 Fall back on the main widget if connect one isn't focusable
If neither main widget nor connect widget is focusable (which notably
happens when they're the same anyhow, as is the case for wxChoice, for
example), still use the main widget as mnemonic instead of not using any
mnemonic at all.

This fixes activation of a wxChoice preceded by wxStaticText by pressing
the key combination corresponding to the label mnemonic, which didn't
work previously.
2019-03-27 15:41:53 +01:00
Vadim Zeitlin
01ed0842ff Set mnemonics for the closest preceding label
Due to a wrong "else" in RealizeTabOrder() implementation, we could set
the mnemonic widget for a previous widget using mnemonics (i.e.
wxStaticText or wxStaticBox) rather than the one closest to the actual
control activated by the mnemonic.
2019-03-27 15:39:39 +01:00
Paul Cornett
b8789b9d6f Fix drag move of wxMiniFrame under Wayland
Use gtk_window_begin_move_drag() instead of trying to do it manually
See #18372
2019-03-26 10:04:35 -07:00
Vadim Zeitlin
82290bfd10 Merge branch 'donovan6000_wxdataviewitem_fix' of https://github.com/donovan6000/wxWidgets
Render disabled items as greyed out in wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1277
2019-03-26 15:05:59 +01:00
Vadim Zeitlin
9926619adf Don't use hard-coded size for wxSpinCtrl in the dialogs sample
This truncates the control with GTK+ 3 where 40 or 60 pixels is never
enough for its width (even without speaking about high DPI displays) and
results in tons of GTK+ warnings.
2019-03-26 13:57:21 +01:00