Commit Graph

66969 Commits

Author SHA1 Message Date
Vadim Zeitlin
758bd6fa6e Create test frame in menu test in more predetermined position
Create this frame as child of the main application window to make it
appear near it, instead of in a more or less random location. This
facilitates debugging, but doesn't really change anything otherwise.
2019-09-30 00:20:06 +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
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
Vadim Zeitlin
4b832dbc25 Merge branch 'stcreplaceraw' of https://github.com/NewPagodi/wxWidgets
Add "Raw" variants for replacement functions to wxSTC.

Closes #18108.

See https://github.com/wxWidgets/wxWidgets/pull/1571
2019-09-28 14:36:00 +02:00
New Pagodi
203074567c Regenerate wxSTC files after recent changes 2019-09-28 00:50:47 -05:00
New Pagodi
97713e81a1 Remove the flag wxSTC_FIND_CXX11REGEX from wxSTC docs
wxSTC is currently built without c++11 regex support, but the search
flag wxSTC_FIND_CXX11REGEX was included with wxSTC any way. This commit
modifies gen_iface.py so that this flag will no longer be generated or
documented. To prevent any code that is currently using this flag from
being broken, the flag is manually defined in stc.h.in.

In short, the flag will be preserved as it currently is but will be
undocumented so users won't mistakenly try to use it.
2019-09-28 00:50:12 -05:00
New Pagodi
2976c64821 Add Raw variants for replacement functions to wxSTC
Implement ReplaceSelectionRaw, ReplaceTargetRaw, and ReplaceTargetRERaw
in the same manner as AddTextRaw, InsertTextRaw, and the other raw
variants.
2019-09-28 00:49:46 -05:00
Vadim Zeitlin
194870fe5e Recognize system UTF-8 encoding under MSW too
Recent versions of Windows 10 (finally!) allow to set up UTF-8 as the
system encoding, so recognize when it is returned by GetACP() in
wxLocale::GetSystemEncoding() and GetSystemEncodingName().
2019-09-27 19:34:32 +02:00
Vadim Zeitlin
7feaa024b3 Add support for code page 1361 (Johab Korean)
As with the previous commit, recognize the system CP1361 encoding, which
can be mapped to an existing wxFONTENCODING_CP1361 constant.
2019-09-27 19:31:38 +02:00
Vadim Zeitlin
5dbfff839e Add support for code page 1258 (Vietnamese)
There doesn't seem to be any good reason to not support this one, when
we support (or at least recognize) all the other CP125x encodings.
2019-09-27 19:30:22 +02:00
Vadim Zeitlin
35d9b0f056 Rewrite a chain of "if"s as a switch
No real changes, just make the code a bit more maintainable and easier
to read.
2019-09-27 19:29:42 +02:00
Graham Dawes
11f24369fd Prevent selection by dragging in wxTreeCtrl in wxQt
This prevented the user from dragging the items in wxTreeCtrl, which is
something that's supposed to be possible.

To allow selection by dragging, we'd need to extend wx API with a method
indicating that dragging is not used in this particular control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1458
2019-09-27 19:21:39 +02:00
Vadim Zeitlin
04949050b2 Merge branch 'qt-fixes'
A multitude of miscellaneous Qt fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1552
2019-09-27 19:18:11 +02:00