Commit Graph

66002 Commits

Author SHA1 Message Date
Vadim Zeitlin
c65647130b Return 0 for wxSYS_CARET_ON_MSEC in wxGTK if appropriate too
For some reason, 7f10d1fa8a handled
wxSYS_CARET_ON_MSEC and wxSYS_CARET_OFF_MSEC differently in wxGTK, even
though it looks like they should be handled in exactly the same way.

Change the code to do this, which results in returning 0 for the former
setting if the caret doesn't blink at all, just as was already the case
for the latter one.

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

See #17629.
2019-04-18 18:05:10 +02:00
PB
e5d850d76c Improve returning wxSYS_CARET_* metrics in wxMSW
The documentation stated that (a) wxSYS_CARET_{ON|OFF}_MSEC  settings
were not supported on MSW and (b) if a setting was not supported a
negative value was returned. However, when calling
wxSystemSettings::GetMetric(wxSYS_CARET_{ON|OFF}_MSEC), not only the
method asserted but 0 was returned instead of a negative value.

Fix this by using the value returned by ::GetCaretBlinkTime() for
wxSYS_CARET_{ON|OFF}_MSEC.

The documentation for wxSYS_CARET_TIMEOUT_MSEC does not list any
platform limitations; however, attempting to obtain this value resulted
in an assert and 0 returned. Fix this by returning -1. Returning -1 may
not the be the ideal solution, but there is no value reserved for the
setting not being supported and the caret on MSW usually blinks.

Closes https://github.com/wxWidgets/wxWidgets/pull/1285
2019-04-18 17:11:20 +02:00
Maarten Bent
94907d3893 Do not limit label width in wxToolBar by control width
This removes irregular behaviour in setting the label of a control. Creating
a control with label now behaves the same as setting or changing the label
later on. And behaves the same as for other tools in the wxToolBar.

Closes https://github.com/wxWidgets/wxWidgets/pull/1289
2019-04-18 16:51:10 +02:00
Vsevolod V Gromov
20c7421a67 Add Get{Min,Max,Range}() to numeric validator classes
Just provide accessors matching the existing setters.

Closes https://github.com/wxWidgets/wxWidgets/pull/1287,
https://github.com/wxWidgets/wxWidgets/pull/1288
2019-04-18 16:47:02 +02:00
Vsevolod V Gromov
3674bd1c1f Add wxDCTextBgColourChanger and wxDCTextBgModeChanger helpers
These classes are similar to the existing wxDCTextColourChanger and
allow temporarily changing other wxDC attributes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1298
2019-04-18 16:34:38 +02:00
Artur Wieczorek
e41f219131 Notify wxPropertyGrid about selected property while restoring editable state
Grid should be notified about selected property on actually selected page
to e.g. update property description.
2019-04-17 18:25:19 +02:00
Artur Wieczorek
6bcf1bad71 Fix restoring width of first wxPropertyGrid column
While restoring editable state also the position of the first splitter
should be set.
2019-04-17 18:12:01 +02:00
orbitcowboy
d82de6b5bf Fix a typo in wxWindow::CaptureMouse() comment
There are no functional changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1291
2019-04-16 02:04:56 +02:00
Artur Wieczorek
b63e89db92 Simplify calculation of wxPropertyGrid header position
We can just query the grid its for actual border width instead of
calculating it on our own.
2019-04-15 18:31:02 +02:00
Vadim Zeitlin
6cc1d63d68 Add a comment to wxToolBar::DoGetBestSize()
No real changes, just explain one of the changes done in the commit
909adbb6bf a bit better.
2019-04-14 18:25:56 +02:00
Artur Wieczorek
e6a7267811 Fix calculation of spin button size in wxSpinCtrl editor
Under GTK+ 3 wxSpinButton (being a part wxSpinCtrl editor) is always
displayed horizontally and its minimal width is greater than 18 pixels
so its best width has to be left unmodified and we can only attempt
to fit its height to the height of the wxSpinCtrl property cell.
For other ports wxSpinButton can be displayed vertically and scaled as
necessary.

Closes #18385.
2019-04-14 12:02:51 +02:00
Vadim Zeitlin
445e320df2 Avoid use of C++11 range-based for loop in wxOSX code
This results in clang -Wc++11-extensions warning if -std=c++1x (for some
value of "x") is not used.
2019-04-13 19:42:33 +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