Commit Graph

67597 Commits

Author SHA1 Message Date
Lauri Nurmi
04d71c80e3 Fix build when configured with --disable-sysoptions 2020-01-20 22:18:55 +02:00
Lauri Nurmi
4901b3784a Fix wxGTK build when configured with --disable-intl
That is, #include scopedptr.h explicitly in nonownedwnd.cpp.
2020-01-20 22:18:55 +02:00
pan93412
2d89c3fad0 Updaye zh_TW translations
Closes https://github.com/wxWidgets/wxWidgets/pull/1714
2020-01-20 20:54:49 +01:00
Vadim Zeitlin
68d7cb5082 Merge branch 'msw-fix-radiobtn-and-initial-focus'
Fix problems with focus due to the pending focus mechanism used by
wxRadioButton in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1713
2020-01-20 20:51:59 +01:00
Václav Slavík
7a5618df77 Silence Xcode 11 warnings about shadowing read() 2020-01-20 19:19:40 +01:00
Václav Slavík
11780f69aa Fix typos in AddStdXRCID_Records(): , instead of ; 2020-01-20 19:18:40 +01:00
Vadim Zeitlin
db4c025e42 Document wxRadioButton relationship with focus in wxMSW
Explain that calling SetValue(true) may change the focus, as this is
not really obvious (and doesn't happen in the other ports).
2020-01-20 13:21:44 +01:00
Vadim Zeitlin
ec07635801 Don't recurse upwards when updating pending focus in wxMSW
This is unnecessary, we only need to update the pending focus in the
immediate parent window to prevent a wrong radio button from being
focused (and hence selected) when it regains focus, there is no good
reason at all to interfere with the focus in the grandparent (and
higher) windows.

Doing this was not only useless, but actually harmful, as it overrode
explicit calls to SetFocus() in the user code, so just stop doing it.
This also allows to avoid having 2 functions related to this and keep
just a single virtual WXSetPendingFocus() one.

Closes #18653.
2020-01-20 13:16:41 +01:00
Vadim Zeitlin
724621929d Improve the check for TLW in focus handling code
Use IsTopNavigationDomain() instead of IsTopLevel() to do the right
thing for MDI child frames too.
2020-01-20 12:42:18 +01:00
Vadim Zeitlin
50a6e80be5 Fix checking for the deepest shown window in focus handling code
wxSetFocusToChild() could recurse to the parent TLW, which was clearly
nonsensical as it means that restoring last focus in a dialog could end
up setting it to the parent frame.

Fix this by breaking out of the loop as soon as we reach a TLW.

See #18653.
2020-01-20 00:32:21 +01:00
Artur Wieczorek
ed8fd1893a Avoid compilation warning under OS X 10.11
NSWindow.allowsAutomaticWindowTabbing property
is available since SDK 10.12.
2020-01-19 20:27:01 +01:00
Vadim Zeitlin
b9038a1e8c Merge branch 'msw-headerctrl' of https://github.com/MaartenBent/wxWidgets
Fix applying style of MSW wxHeaderCtrl and add tests for doing it to the
widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1710
2020-01-19 17:49:40 +01:00
Vadim Zeitlin
c1ef9f1f2d Merge branch 'dvc-col-update'
Avoid recursively updating wxHeaderColumns during resize in the generic
wxDataViewCtrl implementation.

See https://github.com/wxWidgets/wxWidgets/pull/1711
2020-01-19 17:48:19 +01:00
Vadim Zeitlin
a73194f6b4 Allow parsing all fractional sizes in wxFont descriptions
Remove the check that the size representation was the same as float and
as double, which was supposed to catch various edge cases (NaNs, huge
numbers etc) but actually caught plenty of perfectly valid font sizes
such as 13.8 that simply lost precision when converting from double to
float.

Just check that the size is positive and less than FLT_MAX to avoid
using values that really don't make sense as font sizes.

Also add a unit test checking that using fractional font sizes in
description string works as expected.

Closes #18590.

Closes https://github.com/wxWidgets/wxWidgets/pull/1707
2020-01-19 17:46:55 +01:00
Maarten Bent
b3f259c99c Fix reverting to standard cursor in widgets sample
Don't set the cursor to wxSTANDARD_CURSOR, but set it to wxNullCursor so the
default system cursor is used.
2020-01-19 14:56:48 +01:00
Maarten Bent
a31cf55a8d Add more columns to Header control in widgets sample
Show column settings horizontally.
Fix binding to header control events after it is recreated.
2020-01-19 14:56:45 +01:00
Maarten Bent
fd9df06d35 Fix applying header style of wxMSWHeaderCtrl
Call SetWindowStyleFlag when creating the control. Apply wxHD_BITMAP_ON_RIGHT
style. Get rid of the helper function.
2020-01-19 14:55:39 +01:00
Artur Wieczorek
28098259a8 Suppress MSVC++ performance warning
MSVC++ doesn't seem to honour implicit int -> bool conversion and raises
warning C4800: "'int': forcing value to bool 'true' or 'false' (performance
warning)".
2020-01-19 09:56:24 +01:00
Vadim Zeitlin
b02fbafb96 Don't update wxDataViewColumn after it was resized interactively
Previously, the column was updated, i.e. wxHeaderCtrl::UpdateColumn()
was called, after the column width was changed interactively by the
user. This was unnecessary and actually harmful as it resulted in
recursion and display corruption.

Stop doing this by adding yet another width-related function to the
generic wxDataViewColumn called WXOnResize(), which just updates the
main window display, but doesn't update the header at all, and calling
it instead of SetWidth(), which does both, when the column is resized.

Closes #18245.
2020-01-19 03:28:13 +01:00
Vadim Zeitlin
655e29ff1a Remove a duplicate OnColumnChange() call
If the width really changed, wxDataViewColumn::SetWidth() already calls
wxDataViewCtrl::OnColumnChange() (via UpdateWidth()), so it's
unnecessary to call the latter again immediately after calling the
former. And if the width didn't change, it's not necessary to call it at
all, so in either case the OnColumnChange() call can be just removed.

No real changes.
2020-01-19 03:11:40 +01:00
Vadim Zeitlin
6873dc67fb Update bundled libtiff to 4.1.0 2020-01-17 03:15:30 +01:00
Vadim Zeitlin
f216fce116 Update bundled libpng to 1.6.37 version 2020-01-17 03:15:12 +01:00
Maarten Bent
e700a02964 Use correct toolbar tool index when determining best size
Closes #18652.

Closes https://github.com/wxWidgets/wxWidgets/pull/1708
2020-01-17 03:04:38 +01:00
Vadim Zeitlin
1ace3b336e Update strings of already created wxGridCellChoiceEditor too
Calling wxGridCellChoiceEditor::SetParameters() didn't have any effect
if the editor had been already used because this method only updated the
internally stored m_choices, used for creating the combobox, but not the
strings actually used by the combobox, if it had been already created.

Also mention that this works in the documentation.

Closes #10465.
2020-01-15 20:03:56 +01:00
Lauri Nurmi
e8b8b0288f Make wxNewId() and others return/take wxWindowID rather than int
wxWindowID is a typedef of int, so nothing should really change, except
for the improved readability.

Closes https://github.com/wxWidgets/wxWidgets/pull/1682
2020-01-15 14:28:33 +01:00
Vadim Zeitlin
fdc2e1b8bd Merge branch 'grid-ellipsize'
Implement support for ellipsization in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/1705
2020-01-15 14:23:29 +01:00
ExplorerLog
4636c563c7 Fix "Quit" menu item help translation to zh_CN
Closes https://github.com/wxWidgets/wxWidgets/pull/1706.

Closes https://github.com/wxWidgets/Phoenix/issues/1484.
2020-01-15 12:23:33 +01:00
Vadim Zeitlin
f5548e399e Fix problem with dragged icon remaining on screen under MSW 10
Always perform cleanup on drop, even if OnDrop() threw an exception.

Closes #18499.
2020-01-11 23:37:38 +01:00
Vadim Zeitlin
1b6856931a Fix problem with dragged icon remaining on screen under MSW 10
Always perform cleanup on drop, even if OnDrop() threw an exception.

Closes #18499.
2020-01-11 23:36:38 +01:00
Vadim Zeitlin
2c26830991 Fix closing minimized top level windows under Windows 10
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.

Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.

Closes #18622.

See https://github.com/wxWidgets/wxWidgets/pull/1690
2020-01-11 23:14:10 +01:00
Vadim Zeitlin
13752968ea Fix closing minimized top level windows under Windows 10
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.

Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.

Closes #18622.

See https://github.com/wxWidgets/wxWidgets/pull/1690
2020-01-11 23:13:03 +01:00
Vadim Zeitlin
46042843e8 Implement support for ellipsization mode in wxGrid
Add another wxGrid::DrawTextRectangle() overload, taking wxGridCellAttr
and ellipsizing the string if necessary, i.e. if the fitting mode of
this attribute indicates that we should do it.

Switch the code of all renderers for which it makes sense to use
ellipsization to use the new overload.
2020-01-11 19:15:15 +01:00
Vadim Zeitlin
41dcd9ecdb Add API for ellipsization support to wxGrid
This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
2020-01-11 19:14:23 +01:00
Vadim Zeitlin
f13085441c Add wxGridFitMode and functions working with it
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.

Preserve the existing API by reimplementing it in terms of the new one.

Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
2020-01-11 18:02:12 +01:00
Vadim Zeitlin
325408f062 Make wxGridCellAttr ctor taking a single argument explicit
There doesn't seem to be any reason for allowing to implicitly convert
wxGridCellAttr pointer to wxGridCellAttr object.
2020-01-11 14:05:09 +01:00
Vadim Zeitlin
59111e0d11 Suppress warnings due to use of deprecated WebKit functions
This is not the best solution, but getting dozens of lines of warnings
when compiling this file is not great neither and there doesn't seem to
be anything else to do about this.
2020-01-10 19:20:26 +01:00
Lauri Nurmi
09e0b3927b Fix building tests when configured with --disable-log
Add missing wxUSE_LOG checks to wxTextCtrl test and disable wxLog test
entirely when wxUSE_LOG==0.

Closes https://github.com/wxWidgets/wxWidgets/pull/1703
2020-01-10 16:38:41 +01:00
Igor Korot
b8d689422f Check item index in wxListCtrl::GetItemState() in wxMSW too
This was already the case in the generic version, but wxMSW one just
silently returned 0 for invalid item index.

Make it consistent with the other platforms and SetItemState() by
checking the index in it too.

Closes https://github.com/wxWidgets/wxWidgets/pull/1702
2020-01-10 16:36:12 +01:00
Ian McInerney
64ac20536a Remove event macros expansions from the documentation
The expansions do not really add anything to the documentation
page, and can be confusing at first.

Closes https://github.com/wxWidgets/wxWidgets/pull/1701
2020-01-10 16:30:20 +01:00
Vadim Zeitlin
7dd0ad9a0d Merge branch 'composite-contextmenu-event'
Fix event object and ID of wxEVT_CONTEXT_MENU sent from parts of a
composite control.

See https://github.com/wxWidgets/wxWidgets/pull/1698
2020-01-09 23:27:17 +01:00
Vadim Zeitlin
e3eb05df72 Skip not handled mouse events in wxGrid code
Unhandled mouse events should be skipped. Otherwise wxEVT_CONTEXT_MENU
event couldn't be generated by right clicking anywhere inside wxGrid and
could be only generated for the main grid part (but not the labels) by
pressing Shift-F10 under MSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/1697
2020-01-09 23:26:46 +01:00
Vadim Zeitlin
52ae67ef86 Replace dynamic casts with virtual wxWindow::WXGetTextEntry()
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
2020-01-09 23:25:49 +01:00
Mitrik Sicilian
20ecab6268 Remove redundant const from Mac wxDataFormat methods return type
No real changes, but useless top-level const in the return type resulted
in -Wignored-qualifiers warning (if it was enabled).

Closes #18646.
2020-01-09 22:43:12 +01:00
Vadim Zeitlin
db5cf010d7 Improve wxLIST_STATE_DONTCARE documentation
Don't say that it's MSW-specific because it's just a symbolic name for
0, and is used under all platforms if no other flags are set.
2020-01-09 16:28:00 +01:00
Ian McInerney
9b974b5dd1 Fix error in OSX dataview attribute setting
Fix saving background colour of the cell before changing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1699
2020-01-09 04:04:13 +01:00
Vadim Zeitlin
9ec0511924 Add a test of catching wxEVT_CONTEXT_MENU to the grid sample
Verify that these events are seen as coming from the grid itself after
the changes of the previous commit.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
52416931a4 Send wxEVT_CONTEXT_MENU to the main window of composite controls
This is important to allow catching the context menu events from the
composite control children at the main window level using the main
window ID: previously, these events used the (typically auto-generated
internally) ID of the child window, which was an implementation detail
and prevented the code binding to these events using the ID of e.g.
wxListCtrl itself from working under the other platforms, where
wxListCtrl is a generic composite window, even if it worked under MSW,
where wxListCtrl is native.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
3a09975465 Create WXSendContextMenuEvent() helper function
Put common code from all the different ports into it.

This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
2020-01-07 18:22:09 +01:00
Steve Browne
bb14c5f69b Preserve mask when copying wxBitmapRefData to avoid crashes
This crash was introduced in 2d15218c9d
and could happens inside wxBitmap::MSWBlendMaskWithAlpha() because the
code checked for a mask and alpha, but the mask could be lost after
AllocExclusive().

In practice, this happened e.g. when using 16-bit color as is the case
for Windows 7 Hyper-V VMs.

Closes https://github.com/wxWidgets/wxWidgets/pull/1695
2020-01-07 16:56:50 +01:00
Vadim Zeitlin
d52331046c Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:22:52 +01:00