Commit Graph

66979 Commits

Author SHA1 Message Date
Vadim Zeitlin
1bcde69a73 Use white in wxDC::Clear() if background brush is reset in wxGTK2
Although white background was used if the brush was never set, setting
and resetting it nothing unexpectedly (and inconsistently with the other
ports) resulted in using black background.

Fix this by just resetting the brush to white if it's invalid, instead
of not setting it at all.
2019-10-02 02:45:28 +02:00
Vadim Zeitlin
40d989f297 Revert "Use white background when rendering print preview"
This reverts commit 70f0900799.

It is not necessary any more after fixes to wxDC::Clear() in the
previous commits.
2019-10-01 01:30:11 +02:00
Vadim Zeitlin
1f8b73b0d8 Clear background with white brush by default in wxGCDC
This makes wxGCDC consistent with wxDC.

This commit is best viewed ignoring whitespace.
2019-10-01 01:30:11 +02:00
Vadim Zeitlin
c8ca1df2cb Don't clear background with transparent brush in wxGCDC
Bail out immediately if the background brush is transparent, for
consistency with the other wxDC implementations.

See #10273.
2019-10-01 01:30:11 +02:00
Vadim Zeitlin
771832ebbb Clear background if background brush is invalid in wxGTK2 too
We only should avoid clearing the background if the brush is
transparent, not if it's not set.

This refines 6549d4c3c5

See #10273.
2019-10-01 01:30:11 +02:00
Vadim Zeitlin
f82eb24c54 Remove useless code in wxGCDCImpl::SetBackground()
No changes.
2019-10-01 01:19:33 +02:00
Vadim Zeitlin
90106003d3 Clear DC using white background by default in wxMSW
Since 848f5e78a6 the background wasn't
cleared at all if the background brush hadn't been explicitly set prior
to calling wxDC::Clear(). This was incompatible with the old behaviour
and even managed to break our own print preview code, so it clearly
wasn't a good idea to change Clear() like this.

Instead, continue to clear the DC using white background by default,
while still not doing anything if a transparent background brush had
been explicitly set.

This fixes print preview background under MSW.

See #10273, #18371.
2019-10-01 01:13:42 +02:00
Vadim Zeitlin
19d567a29b Merge branch 'msvc-version-abi-compat'
Add wxMSVC_VERSION_ABI_COMPAT.

See https://github.com/wxWidgets/wxWidgets/pull/1576
2019-09-30 23:33:56 +02:00
Ilya Sinitsyn
f7e335c031 Fix recent regression in grid content autosizing
Fix autosizing broken in 3c72396a36: we
must add the extra margin to "extentMax".

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

Closes https://github.com/wxWidgets/wxWidgets/pull/1578
2019-09-30 17:47:38 +02:00
Vadim Zeitlin
0c1c13883c Merge branch 'per-monitor-dpi-aware-controls-2'
Improve Per-Monitor DPI awareness in more controls.

See https://github.com/wxWidgets/wxWidgets/pull/1572
2019-09-29 23:23:57 +02:00
Vadim Zeitlin
059838f5ed Compilation fix for PCH-less build
Include wx/combobox.h as we use wxDynamicCast(wxComboBox).
2019-09-29 23:21:55 +02:00
Vadim Zeitlin
8d2b2c0f56 Add wxMSVC_VERSION_ABI_COMPAT
This symbol can be predefined to use the libraries built with "vc14x" as
the compiler prefix. This can be useful to reuse the same binaries for
all ABI-compatible VC 14.x versions: 14.0 (MSVS 2015), 14.1 (2017) and
14.2 (2019).
2019-09-29 22:59:50 +02:00
Vadim Zeitlin
dc50646ae4 Document wxMSVC_VERSION and wxMSVC_VERSION_AUTO
Extend the description of library selection symbols used with MSVC to a
more general discussion of MSVC-specific symbols and document the
symbols affecting compiler prefix in this section too.
2019-09-29 22:51:11 +02:00
Vadim Zeitlin
5a785be03f Fix confusing people in the last change to the guide
s/the,/them/
2019-09-29 22:47:29 +02:00
Artur Wieczorek
90e4ceb1c6 Make wxMask::GetBitmap a public function
According to the documentation this function should be declared as public,
not protected.
2019-09-29 20:19:10 +02:00
Maarten Bent
2b41ba2702 Apply review comments 2019-09-29 19:30:39 +02:00
Maarten Bent
0a7c191e27 Fix wxChoice-based control height in wxToolBar on DPI change 2019-09-29 19:30:36 +02:00
Vadim Zeitlin
fe3f1ee6ab Update an embarrassingly outdated application writing guide
At least mention wxGraphicsContext and Bind() instead of only speaking
of wxDC and event tables.

Also mention sizers.

Do _not_ mention obsolete and deprecated wxList and friends.
2019-09-29 19:11:23 +02:00
Vadim Zeitlin
1d3dd168ac Add another email for Danny Scott to Git mailmap 2019-09-29 17:36:21 +02:00
Danny Scott
191aa30222 Update "MSVC binaries" section of the release build instructions
Reflect currently used versions.

Closes https://github.com/wxWidgets/wxWidgets/pull/1569
2019-09-29 17:34:08 +02:00
Artur Wieczorek
b21f9ff6f5 Fix getting a sub-bitmap of wxBitmap with alpha channel and mask
Since wxBitmap can have both alpha channel values and mask we have to use
alpha channel (if required) in the sub-bitmap even if the mask is provided
too.

See #18513.
2019-09-29 16:28:12 +02:00
Artur Wieczorek
93f1384f7e Don't use m_ prefix in the names of non-member variables
Using "m_" prefix for non-member variables is not in line with the naming
convention and hence is misleading.
2019-09-29 16:23:12 +02:00
Artur Wieczorek
ac9c4d06e2 Fix creating wxMask image from raw data
In the function wxMask::OSXCreate() to create a mask image, data copying
from the supplied memory buffer was not actually implemented and therefore
created mask was invalid.

Closes #18513.
2019-09-29 16:21:45 +02:00
Artur Wieczorek
96cb3b6714 Add tests of retrieving sub-bitmaps 2019-09-29 16:16:55 +02:00
Vadim Zeitlin
66526adf7a Document issues with event handlers called when mouse is captured
Notably mention that showing modal dialogs won't work in this case.

Also link to this explanation from wxListCtrl documentation as
wxEVT_LIST_ITEM_SELECTED is one of the perhaps less expected cases in
which this problem arises.

See #9973.
2019-09-29 14:57:59 +02:00
Vadim Zeitlin
7a1bc568e5 Document that move events are only generated for non-TLW in wxMSW
wxGTK only sends these events for TLWs.

Closes #18485.
2019-09-29 00:08:21 +02:00
Liam Treacy
121336a3d8 Fix setting the initial value of non-editable wxComboBox in wxQt
Use setCurrentText(), which works for non-editable combo boxes as well
as for editable ones, instead of setEditText(), which only works for the
latter ones.

Closes https://github.com/wxWidgets/wxWidgets/pull/1542
2019-09-28 23:53:01 +02:00
Maarten Bent
a24d58a6d3 Use wxWindow instead of wxDisplay for wxGraphicsContext::GetDPI 2019-09-28 23:47:04 +02:00
Maarten Bent
459ffcff61 Remember wxBitmapComboBox selection when recreating the control
Recreate the control with the correct height when adding the first item with bitmap.
2019-09-28 23:47:04 +02:00
Maarten Bent
092d507714 Update comment in wxRendererMSW::GetCheckBoxSize related to DPI 2019-09-28 23:47:04 +02:00
Maarten Bent
85a2769ae5 Use the already determined hwnd in wxWindowMSW::GetDPI 2019-09-28 23:47:04 +02:00
Maarten Bent
b39c79cb4a Set column count to 1 in wxListCtrl with list view 2019-09-28 23:47:04 +02:00
Maarten Bent
370ae40b35 Use more FromDIP for hardcoded sizes 2019-09-28 23:47:04 +02:00
Vadim Zeitlin
ff3c005519 Merge branch 'msw-encodings'
Recognize a few more system encodings under MSW, including UTF-8.
2019-09-28 23:45:05 +02:00
Vadim Zeitlin
e46385e964 Test that adding window to 2 sizers results in an assert
Check that adding a window to either the same, or different, sizer the
second time asserts -- but that it can still be moved to another sizer
if it is detached from the first one first.

Also document that SetContainingSizer() should never be called from
outside the library.

See #17166.
2019-09-28 23:42:37 +02:00
Vadim Zeitlin
7bba2d09fd Merge branch 'drop-cppunit-window-test'
Get rid of CppUnit compatibility macros in wxWindow unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/1568
2019-09-28 23:42:37 +02:00
Maarten Bent
54d514489e Update custom header font after DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
017978a139 Fix font of custom attributes in wxTreeCtrl on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
b075465645 Fix wxSearchCtrl buttons on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
a98d8448fa Fix size of wxDateTimePickerCtrl after DPI change
Do not use DateTime_GetIdealSize or DTM_GETIDEALSIZE. They return
incorrect sizes after the DPI of the window has changed. For every DPI
change, the returned size is 4 pixels higher, even if the DPI is
lowered.

Improve the existing method to also take the minimum height of the
scroll-arrows into account.
2019-09-28 23:37:01 +02:00
Maarten Bent
2c6d132efe Resize wxListCtrl columns on DPI change
Fix font of custom attributes in wxListCtrl on DPI change.
2019-09-28 23:37:01 +02:00
Maarten Bent
56fab0aabb Improve wxDataView on DPI change
Fix the row heights after a DPI change and adjust the column widths.
Use DPIChangedEvent instead of MSWUpdateFontOnDPIChange because the child
controls (m_clientArea, m_headerArea) need to update their font sizes first.
2019-09-28 23:37:01 +02:00
Maarten Bent
fd2cf1f4e2 Fix wx[Check]ListBox font and margin on DPI change
These control are drawn using a wxDC. When the DPI changes, call SetFont
to update the font of the wxDC. First call wxListBoxBase::SetFont() so
m_font is updated to the new DPI, then use this font in the wxDC.
For wxCheckListBox update the margins to fit the changed checkbox size.
2019-09-28 23:37:01 +02:00
Maarten Bent
123da53306 Fix wxBitmapComboBox size in high DPI
Convert hard-coded sizes to DPI depended size, remove unused size.
Implement MSWUpdateFontOnDPIChange() and update the control elements.
2019-09-28 23:37:01 +02:00
Vadim Zeitlin
37be4adec6 Don't change RICHEDIT control font on DPI change
The control seems to somehow react to DPI changes on its own (which is
rather mysterious as we don't forward WM_DPICHANGED to it, so it's not
really clear how does it do it, but it does) and changing its font is
worse than useless, as it's not just redundant, but also resets all the
styles used inside the control and so is really undesirable.

Hence override the just added MSWUpdateFontOnDPIChange() to do nothing
for rich edit controls, while still updating the font for the plain EDIT
ones (which is required as they don't scale correctly on their own).
2019-09-28 23:37:01 +02:00
Maarten Bent
32aabf7a41 Update font of wxSpinCtrl when DPI changes
Fix position of spin control in wxSpinCtrlDouble after DPI change
The old size of the control was used to determine the position. Use GetBestSize
instead, which will return the correct size.
2019-09-28 23:37:01 +02:00
Maarten Bent
8bff737438 Support DPI change in wxToolBar
Manually resize the embedded controls and Realize the toolbar again.
2019-09-28 23:37:01 +02:00
Maarten Bent
e57139bb21 Use system DPI for some native Windows dialogs
Some native dialogs do not scale correctly (color picker, font picker,
open file with custom controls). ALl other native dialogs do scale correctly
(open file, open directory, find replace, print).

Change the DPI Awareness Context temporarily to SystemAware, so Windows handles
the scaling.
2019-09-28 23:37:01 +02:00
Václav Slavík
17e2f8c477 Fix EOLs buffer shortening in wxFFile::ReadAll()
As the comments in the function explain, fread() may return a shorter
buffer than expected due to CRT's implicit conversion of DOS EOLs to
\n.
The logic for handling this was however broken: it NUL-terminated the
buffer appropriately, but that had no effect when later used in
wxString constructor, which used buffer's length for string length.

This resulted in slightly larger strings with uninitialized tails that
were mostly invisible to the user as the tail would disappear anywhere
the string was handled as a NULL-terminated C string. It also caused
occassional UTF-8 conversion failures when the tailing bytes didn't
form a valid sequence.

Fixed by using wxCharBuffer::shrink() to properly truncate the buffer.
2019-09-28 18:57:26 +02:00
Ilya Sinitsin
ce01d8286b Xcode iphone (#1565)
* Adapt xcodeproj for iPhone to generic imaglist.cpp

* Fix the installation error in the iPhone minimal sample

Fix "Failed to install the requested application" error.
2019-09-28 17:16:35 +02:00