Commit Graph

67568 Commits

Author SHA1 Message Date
Vadim Zeitlin
cdc6899924 Store MONITORINFOEX inside wxDisplayMSW
There is no reason to call ::GetMonitorInfo() all the time, e.g. just to
determine if the monitor is primary, as we can just store it entirely.

We already invalidate the information stored for all the displays
whenever anything changes, so the cached information doesn't risk
getting out of sync.
2019-11-08 00:34:40 +01:00
Vadim Zeitlin
d8cd02b480 Create primary monitor when using wxDisplay default ctor
Previously, the first monitor was created instead and while it was often
also the primary one, this wasn't always the case.

In particular, this makes wxGetDisplayPPI() always return something
reasonable instead of returning (0, 0) when the first monitor is not the
primary one, as expected by plenty of code, including our own printing
sample, which divides by the values returned from wxGetDisplayPPI()
without checking if they're zero.
2019-11-08 00:26:20 +01:00
Vadim Zeitlin
46cb23b030 Don't assume that the first monitor is always the primary one
This is not necessarily the case at least under MSW, so while it makes
sense to do this by default in wxDisplayImpl::IsPrimary()
implementation, MSW-specific version should override it instead of being
totally unused as it was until now.
2019-11-08 00:09:29 +01:00
Vadim Zeitlin
767f545be5 Number displays in the sample starting from 1, not 0
This is more usual and coincides with the built-in display names under
MSW, where they're called "DISPLAY1", "DISPLAY2" etc.

No real changes.
2019-11-08 00:07:54 +01:00
Paul Cornett
e87ea7389b Avoid inadvertently destroying a shared PangoContext on GTK2
wxMemoryDC and wxScreenDC dtors were freeing a context they didn't own, potentially
causing a crash. Fixed by having the base wxWindowDC dtor free the context.
See #18566
2019-11-07 11:26:10 -08:00
Maarten Bent
6878a46725 Prevent spurious debug error messages in wxMSW wxToolBar code
When wxGetTBItemRect() is called on a control tool, it can cause a
TB_GETITEMRECT error message. Swap the if statements around so
wxGetTBItemRect is only called when it is needed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1639
2019-11-07 00:55:46 +01:00
Vadim Zeitlin
cdc588e4eb Don't resize the parent from wxToolBar::SetSize() in wxUniv
This could result in infinite recursion in wxX11, as the test for the
new size being different from the old one which was supposed to stop the
recursion, failed there in case the new size was 0: as wxX11 can't use 0
size for the window, the actual size was always different and so we kept
sending size events to the parent, which kept resizing the toolbar etc.

It could be argued that there is a bug in wxX11 and that GetSize() must
return the same value as was passed to SetSize(), even if it was 0, and
this might even be correct, in theory, but it doesn't seem worth to do
it just to accommodate this weird use case, especially because resizing
the parent from the child shouldn't be necessary in the first place and
none of wxToolBar implementations in the other ports does it.

So just remove this code completely.

Closes #18554.
2019-11-06 15:06:36 +01:00
Vadim Zeitlin
23f7614626 Don't set 0 client size in wxX11 neither
This also results in BadValue X11 error, so ensure that the size is
valid here too, just as we do in DoSetSize().
2019-11-06 15:05:47 +01:00
Vadim Zeitlin
8df84db842 Add EnsureValidXWindowSize() helper to wxX11 code
Instead of repeating the same checks in several places, do it in a
single one.

Also use the smallest possible valid size (1, 1) instead of the totally
arbitrary (20, 20).
2019-11-06 15:04:35 +01:00
Stefan Csomor
014f04b437 show as many items as possible on macOS 10.13+
on these systems scrollbars on comboboxes are not always shown, even if the system is configured to do so, in these cases show all possible to avoid the impression of a limited subset

see https://github.com/wxWidgets/wxWidgets/pull/1534/files
2019-11-05 22:42:18 +01:00
Maarten Bent
4340e46b72 Fix height of rich wxTextCtrl after DPI change
The font of rich controls is not adjusted when the DPI changes, so do it here.
2019-11-05 22:07:04 +01:00
Stefan Csomor
21063a7850 cleaner implementation 2019-11-05 21:26:03 +01:00
Vadim Zeitlin
b842f2afa2 Merge branch 'im/menu' of https://github.com/imciner2/wxWidgets
Make wxEVT_MENU_HIGHLIGHT generation when there is no highlighted item
consistent across all the major ports: use wxID_NONE instead of wxID_ANY
in wxGTK and send these events, which were previously not sent at all in
this case, in wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/1637
2019-11-05 20:09:14 +01:00
Vadim Zeitlin
bf43d35636 Merge branch 'socket-thread'
Add a unit test for reading from wxSocket in a thread.

See https://github.com/wxWidgets/wxWidgets/pull/1632
2019-11-05 20:02:22 +01:00
Stefan Csomor
c9c5a4d99d fixing include style 2019-11-05 19:52:53 +01:00
Stefan Csomor
9be9112392 fixing @available warning 2019-11-05 19:50:41 +01:00
Stefan Csomor
294c8a6b23 moving datatransfer.h to source files
former place in private.h broke Audacity builds
2019-11-05 19:20:51 +01:00
Stefan Csomor
f2212f2162 temporary fix for files having urls constructed as directories 2019-11-05 18:53:06 +01:00
Ian McInerney
11f8d9d478 Document unhighlight event changes 2019-11-05 12:09:51 +00:00
Ian McInerney
3a668b4d0a GTK: Use wxID_NONE for unhighlight events 2019-11-05 12:09:26 +00:00
Ian McInerney
790c1818cb Update menuitem docs with unhighlight event 2019-11-05 09:15:55 +00:00
Ian McInerney
11991137e1 Send EVT_MENU_HIGHLIGHT when menu item is unhighlighted
On OSX this only happens if no new menu item is being highlighted.
2019-11-05 08:58:11 +00:00
Ian McInerney
15909a5f7c OSX: If no menu item given, use wxID_NONE as item ID 2019-11-05 08:58:11 +00:00
Stefan Csomor
715cb66ac4 Fixing IconRef Build re adding support for reading icns files 2019-11-05 09:46:02 +01:00
Stefan Csomor
442149e723 fixing file params in wxCocoaLaunch
unfortunately the API does not work as advertised, so use a newer one if possible, fallback to individually sending an open
2019-11-05 09:39:33 +01:00
Vadim Zeitlin
6421ddb9b2 Only use underline-rgba property with GTK > 3.16
This avoids glib warnings

object class 'GtkTextTag' has no property named 'underline-rgba-set'

when calling g_object_get() with older GTK and just avoids doing useless
work.
2019-11-04 22:57:46 +01:00
Vadim Zeitlin
a03e2b8b4f Merge branch 'grid-align'
Fix value returned from wxGridCellAttr::GetNonDefaultAlignment() for the
default attribute.

See https://github.com/wxWidgets/wxWidgets/pull/1636
2019-11-04 19:33:47 +01:00
Vadim Zeitlin
8d1aae5443 Improve compatibility after wxTopLevelWindow::Layout() change
The changes of 3241e7a850 resulted in
Layout() not called any longer from wxEVT_SIZE handler for windows that
didn't use neither sizers nor constraints themselves, but did call
SetAutoLayout(true).

Fix this regression by checking for GetAutoLayout() explicitly.

See #18472.
2019-11-04 19:32:10 +01:00
Maarten Bent
fcda2beabb Let standard buttons on wxMSW have at least the height of wxBU_EXACTFIT
Closes #18563
2019-11-04 01:16:18 +01:00
Vadim Zeitlin
19844d27ac Fix default attribute wxGridCellAttr::GetNonDefaultAlignment()
This function is not supposed to overwrite the given alignment values
unless the alignment is specifically set for the given cell, but it
always overwrote them when called on m_defaultCellAttr, i.e. the
attribute used by the cells that don't have any special attribute.

This meant that custom attributes had to be set (or, more efficiently, a
custom attribute provider returning non-null attributes for all cells
had to be used) previously just to make the right alignment used by
default by number or date renderers work.

Fix this by ignoring the values set in the default attribute in this
function.

Also add a unit test (which required adding a special helper class just
to allow testing wxGrid::GetCellAttr() used by the renderers) that used
to fail but passes now.
2019-11-04 00:35:32 +01:00
Besnik Bleta
e19e9bce79 Translate more messages for Albanian 2019-11-04 00:10:51 +01:00
Maarten Bent
0e335b9dc1 Make button and searchctrl pages in widgets sample more DPI aware 2019-11-03 21:50:27 +01:00
Maarten Bent
8c0c3cc2b9 Use 'fit exactly' on button page in widgets sample to toggle wxBU_EXACTFIT 2019-11-03 21:50:27 +01:00
Maarten Bent
ced00c6231 Simplify wxSearchCtrl::DoGetBestClientSize() 2019-11-03 21:50:26 +01:00
Maarten Bent
82668e1e85 Remove FromDIP in wxGetEditHeightFromCharHeight
This caused wxTextCtrl to become to high at higher DPI.

It was added to fix appearance of wxSearchCtrl at high DPI. Remove an unneeded
FromDIP there too, so it gets the same height as a normal wxTextCtrl.
And centre the textctrl inside the searchctrl.
2019-11-03 21:50:24 +01:00
Vadim Zeitlin
f0868129c6 Fix problems with themed borders (dis)appearance in wxMSW
Ensure that all native controls get WM_NCCALCSIZE soon after creation,
so that we can tell Windows about the themed controls we draw ourselves
in WM_NCPAINT.

Otherwise we could end up without any visible borders at all and, worse,
with bad display artefacts after resizing the control.

Just call SetWindowPos(SWP_FRAMECHANGED) to ensure that WM_NCCALCSIZE is
generated, even if the control is not resized later, which happens for
controls with fixed initial size.

Closes #18549.
2019-11-02 21:40:57 +01:00
Vadim Zeitlin
41eb39b4a7 Don't activate items on Ctrl-M in generic wxListCtrl
This is unexpected, so add the check for the modifiers, as is done in
generic wxDataViewCtrl, to only accept the "real" Enter here and not
Ctrl-M sending the same key code.

Closes #17458.
2019-11-02 20:34:07 +01:00
Vadim Zeitlin
0dfafdcafb Merge branch 'pmdpi-sizers' of https://github.com/MaartenBent/wxWidgets
Update sizer borders and spacers on DPI change.

Closes #18551.

See https://github.com/wxWidgets/wxWidgets/pull/1628
2019-11-02 16:26:14 +01:00
Maarten Bent
140b138494 Use for-loop to iterate sizer and window children 2019-11-01 21:23:51 +01:00
Maarten Bent
918e102533 Support DPI change in sizers
Return the size of DoGetDefaultBorderInPx as float, so no precision is lost
when multiplying it for DoubleBorder and TripleBorder.

Closes #18551.
2019-11-01 21:07:15 +01:00
Vadim Zeitlin
fe35ddd34b Make date cells in the grid sample more readable
Add labels for the columns using date format and labels for the cells
using date renderer/editor explicitly to give a better idea about what's
going on here.

Also use the same rows numbers for date cells as for the column ones for
consistency.

No real changes.

See 659ab78c6d
2019-11-01 18:48:07 +01:00
Vadim Zeitlin
6bc30968c5 Don't create CFSocket unnecessarily when closing wxSocket
DoClose() shouldn't do anything if CFSocket hadn't been created at all
(as will be the case for blocking sockets) instead of creating it only
to destroy it immediately afterwards.
2019-11-01 16:00:22 +01:00
Vadim Zeitlin
ef224dbe41 Add unit test for reading from wxSocket in a thread
Check that reading from blocking socket in a thread works.
2019-11-01 16:00:01 +01:00
Vadim Zeitlin
02314de0ee Suppress spurious "unsupported DPI awareness" configure messages
If --with-dpi option is not specified at all, wxWITH_DPI_MANIFEST
remains empty, so take this value into account explicitly.
2019-11-01 15:39:52 +01:00
Vadim Zeitlin
be83879733 Merge branch 'always-use-wchar_t'
Remove obsolete wxUSE_WCHAR_T option, it must be always 1.

See https://github.com/wxWidgets/wxWidgets/pull/1624
2019-11-01 14:32:42 +01:00
Vadim Zeitlin
5ef1e77c79 Merge branch 'remove-mac-launch'
Remove wxMacLaunch() function unused any longer.

See https://github.com/wxWidgets/wxWidgets/pull/1629
2019-11-01 14:32:02 +01:00
Paul Cornett
4697ce23d9 Don't allow DestroyClippingRegion() to remove paint update area clipping with GTK3
See #18560
2019-10-31 23:30:18 -07:00
Vadim Zeitlin
e376e74210 Fix build-breaking typo in the GUI test suite
Fix after afe1816996.

See #17400.
2019-11-01 00:53:12 +01:00
Vadim Zeitlin
4df94771da Merge branch 'dataview_cocoa' of https://github.com/thesiv/wxWidgets
Ensure that last wxDataViewCtrl columns is always expanded to fit the
control width and a unit test checking for the scenario in which this
wasn't the case before, but is now.

See https://github.com/wxWidgets/wxWidgets/pull/1313
2019-11-01 00:49:29 +01:00
Vadim Zeitlin
b761e1819e Merge branch 'test-gtk-log'
Don't output spurious empty log messages when running test suite under
GTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1625
2019-11-01 00:12:44 +01:00