Commit Graph

64480 Commits

Author SHA1 Message Date
Vadim Zeitlin
6ed3865925 Remove commented out stream operations in wxSearchCtrl
Just remove unused and unnecessary declarations.
2018-07-07 00:54:30 +02:00
Vadim Zeitlin
df4d1d456f Make wxSearchCtrl margins proportional to DPI
Use FromDIP() in wxSearchCtrl implementation to make the margins of the
same size, proportionally, at any DPI.
2018-07-07 00:52:26 +02:00
Artur Wieczorek
81cac4e46b Simplify getting current wxPG editor control
We can just return the pointer, whether it is NULL or not.
2018-07-06 22:57:53 +02:00
Artur Wieczorek
858b5e7222 Prevent losing the focus by active editor when error dialog box is closed
Displaying error dialog can cause on some platforms native focus changes
what triggers unwanted focus change events in wxPG and disturbs expected
sequence of events. To prevent this from happening (regardless of platform),
we need to save focused window before dialog box is displayed and restore
it after closing the dialog.

Closes #18046.
2018-07-06 22:56:55 +02:00
Vadim Zeitlin
5766280311 Fix recent regression in wxMSW wxTopLevelWindow::IsMaximized()
Recent 3518f1a7d8 broke IsMaximized()
return value when the window was visible and had been previously
maximized by calling Maximize(), but wasn't actually maximized any
longer because it started to always return true when m_showCmd was set
to SW_MAXIMIZE.

Fix this by only using m_showCmd when the window is hidden, as it
shouldn't matter what it is when it's shown. Also simplify/optimize the
logic of IsMaximized() to use either ::IsZoomed() or m_showCmd depending
on whether the window is shown or not, but not both.

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

Closes #18163.
2018-07-06 19:04:09 +02:00
PB
c93ccda035 Fix building docview sample with CMake
Should have been part of 64fc4dc
2018-07-06 12:33:59 +02:00
Vadim Zeitlin
9121b906e8 Restore initial wxEVT_SIZE generation for hidden frames in wxMSW
Changes of commit cf20a9ced5 suppressed
the generation of the initial wxEVT_SIZE for hidden wxFrames, as the
initial WM_SIZE was ignored. This went unnoticed for "normal" frames,
which got another WM_SIZE when they were shown in any case, but broke
frames with wxFRAME_TOOL_WINDOW style as they're shown using SW_SHOWNA
command and in addition to suppressing activation, it also suppresses
the generation of WM_SIZE, so such frames didn't get any wxEVT_SIZE at
all and appeared without being laid out properly, as could be seen, for
example, in the splash sample.

Fix this by continuing to generate the size events even for hidden
frames, just as we did before, while still skipping all the other stuff
which is not necessary for the hidden windows.

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

Closes #18161.
2018-07-05 19:42:33 +02:00
Vadim Zeitlin
6d02c45867 Don't write spurious </font> to wxRichText HTML output
The opening <font> tag was only written to the output if the style had a
non-default font, but the matching closing tag wasn't guarded by the
same check.

Do add the check now to ensure that the tags are always balanced.

Closes #18157.
2018-07-04 20:09:49 +02:00
Vadim Zeitlin
5e5f878db0 Improve wxWindow::FindWindowByName() documentation
Mention that the "name" is interpreted as the label if no window with
such name is found.

Also document that both this and FindWindowByLabel() functions do
recurse into child TLWs, unlike FindWindow().
2018-07-03 18:54:19 +02:00
Vadim Zeitlin
64ae76fadd Merge branch 'mac-lbox-sel-events'
Fix Mac wxListBox selection behaviour and events.

See https://github.com/wxWidgets/wxWidgets/pull/847
2018-07-03 18:31:37 +02:00
Artur Wieczorek
9acb2fe3a0 Fix AddArcToPoint when no current point is set on wxGraphicsPath
Current behavior of AddArcToPoint() when there is no current point is not
documented and moreover it is not the same in native macOS and in generic
implementation. Under macOS nothing is done and "no current point" error
is raised but under other ports (generic implementation) only arc
is drawn (without initial line).
When there is no current point, in similar functions AddCurveToPoint(),
AddQuadCurveToPoint() it is initially set to the some known control point
of the curve but this approach cannot be applied to AddArcToPoint().
The only well defined fallback point seems to be (0, 0) and this option
is implemented here.

See #18086.
2018-07-02 22:31:24 +02:00
Artur Wieczorek
fd5576a326 Explicitly return (0,0) if no current point is set for graphics path (macOS)
This is to suppress a harmless warning displayed in the console
if CGPathGetCurrentPoint() is called when no current point is set.
2018-07-02 20:50:44 +02:00
Artur Wieczorek
534b8840d2 Fix AddCurveToPoint and AddQuadCurveToPoint if no current point is set (macOS)
If current point is not yet set, these functions should behave
as if they were preceded by a call to MoveToPoint(cx1, cy1).

Closes #18111.
2018-07-02 20:39:42 +02:00
Artur Wieczorek
8349c4bf7f Fix AddLineToPoint() if no current point is set (macOS)
AddLineToPoint() should behave as MoveToPoint() if there is no current point.

See #18111.
2018-07-02 20:32:30 +02:00
Artur Wieczorek
f258dc4c64 Fix setting current point of wxGraphicsPath (GDI+)
After executing native operations on the graphics path, the native
current point is updated properly and should be used instead
of manually maintained logical point.

See #18111.
2018-07-02 20:24:43 +02:00
Artur Wieczorek
fc53007ab4 Add unit test for current point of wxGraphicsPath
Verify that last point is properly positioned after the operations
on wxGraphicsPath.

See #18111.
2018-07-02 20:08:30 +02:00
Vadim Zeitlin
c53524a59b Also check the old selection index for validity
It's not totally clear if the old selection is always guaranteed to be
valid so prefer to check it explicitly.
2018-06-30 23:18:28 +02:00
Vadim Zeitlin
30c798b70a Fix row validity check in MacHandleSelectionChange()
Valid indices must be in [0, count[ half-open interval.
2018-06-30 23:17:37 +02:00
Vadim Zeitlin
f51cb52004 Reformat comments and code in MacHandleSelectionChange()
No real changes, just trying to make the code more clear.
2018-06-30 23:17:03 +02:00
Vadim Zeitlin
eadcd93bf9 Remove wxListBox::MacGetBlockEvents()
Just test m_blockEvents directly, there doesn't seem to be any gain in
using an accessor here.

Also test it only once instead of doing it twice in
MacHandleSelectionChange().
2018-06-30 23:14:36 +02:00
Vadim Zeitlin
dde6f662fc Move wxListBox selection event generation to wxListBox itself
This allows to avoid making DoChangeSingleSelection() and
CalcAndSendEvent() public.

No real changes, this is just a refactoring.
2018-06-30 23:13:33 +02:00
Vadim Zeitlin
1eee7a8a3c Slightly improve the assertion failure message
Also remove the unnecessary wxT().
2018-06-30 23:10:02 +02:00
Vadim Zeitlin
0084fb94be Use wxDynamicCast() instead of static_cast<>
This is safer as it really checks if the pointer is of the correct type.
2018-06-30 23:09:06 +02:00
ikamakj
c369c792a3 Fix selection event generation in wxMac wxListBox
Prevents deselecting the selected item in single-selection listbox.

Also generate correct events in the multi-selection case by reusing the
existing wxListBoxBase::CalcAndSendEvent() method.

Closes #15603.
2018-06-30 23:05:57 +02:00
Stefan Csomor
2ab430965c Fixing wxGLCanvas under 10.14, preparing for layer based drawing
see https://github.com/wxWidgets/wxWidgets/pull/846 , thanks to dkulp
2018-06-30 16:57:57 +02:00
Stefan Csomor
24dbe9775c Switching colorspace according to Apple's recommendation 2018-06-29 15:40:23 +02:00
Vadim Zeitlin
17c7048f36 Fix crash when appending items of empty vector to wxItemContainer
Passing an empty std::vector<wxString> to Append() or Insert() methods
of any wxItemContainer-derived classes, such as e.g. wxComboBox,
resulted in undefined behaviour due to accessing the first element of an
empty vector.

Fix this by avoiding using it when the vector is empty.
2018-06-29 14:33:56 +02:00
Paul Cornett
32db375e46 Avoid assertion failure in wxGLContext ctor
Check for NULL pointers directly rather than making assumptions based
on a version check.
See #18155
2018-06-28 10:38:14 -07:00
Vadim Zeitlin
a824ee092d Change the return type of wxListCtrl::SetItem() overload to bool
For some reason lost in the depths of time (but probably just a typo)
(but probably just a typo) (but probably just a typo) (but probably just
a typo), SetItem() overload taking the column index returned "long" and
not "bool", even though the actual return value was always "true" or
"false" (or even just always "true" in the case of the generic version).

Change it to return "bool" for consistency with the other overload and
because this just makes more sense and shouldn't break any existing code
due to the implicit conversions between bool and long.

Also document the return value meaning.

Closes #18153.
2018-06-28 00:39:31 +02:00
VZ
7331903f56
Merge pull request #844 from catalinr/Qt_build_fixes_2
wxQt build fixes
2018-06-28 00:38:15 +02:00
Artur Wieczorek
60669e9b50 Harmonize wxGraphicsPathData::AddArcToPoint() behaviour across all ports
AddArcToPoint() on macOS port is implemented with native API (CGPathAddArcToPoint) so its behaviour should be considered as a reference for generic implementation used in another ports.

Closes #18086.
2018-06-27 22:46:45 +02:00
Artur Wieczorek
c716b59783 Fix swapped numerator and denominator in the equation
tan(a/2) = sin(a) / (1 + cos(a)), so 1/tan(a/2) = 1 / sin(a) * (1 + cos(a))

See #18142.
2018-06-27 22:36:57 +02:00
PB
2842108e24 Fix typos in container classes descriptions
Closes https://github.com/wxWidgets/wxWidgets/pull/845
2018-06-27 19:40:42 +02:00
Vadim Zeitlin
689b9b78a3 Document that SetStatusText() updates the display immediately
This is done by explicitly calling Update() in the generic version and
seems to also be done by the native MSW one, even if it's not documented
to do it.
2018-06-27 19:37:23 +02:00
Stefan Csomor
616f0ca7f9 Fixing notebook drawing
Workaround for drawing problems under 10.14 as we do not draw the notebook ourselves, this should be ok on all system versions, for details see #18146
2018-06-27 18:33:23 +02:00
Vadim Zeitlin
cc931612ee Fix a bug with layout of grandchildren in wxMSW wxScrolledWindow
Apparently changing the window scrollbars in the middle of a window
deferred repositioning operation is not allowed and confuses
EndDeferWindowPos() which doesn't update the position of _grand_
children correctly in this case.

This bug notably manifested itself when loading a wxScrolledWindow
containing wxStaticBox from XRC, as the parent window was initially
created with the default small size and then relaid out when it was
resized to its real size on first wxEVT_SIZE event which also updated
the scrollbars. As a result, the children of the wxStaticBox were
shifted downwards.

The fix simply flushes the current repositioning operation and starts
one anew in wxWindow::SetScrollbar().
2018-06-26 00:58:20 +02:00
Vadim Zeitlin
0fa00b5159 Don't do anything when ScrollWindow(0, 0) is called in wxMSW
This doesn't really change anything, but just skips executing some code
uselessly if we know in advance we are not going to do anything, which
is nice as ScrollWindow() actually ends up being called with 0 arguments
surprisingly often from wxScrollHelperBase::SetScrollRate().

This is also consistent with what wxGTK does.
2018-06-25 15:49:50 +02:00
Cătălin Răceanu
fc7cae9825 Fixed typo 2018-06-24 19:53:48 +03:00
Cătălin Răceanu
df4e2d3d6e Disable wxActivityIndicator if it can't draw itself 2018-06-24 19:52:46 +03:00
Cătălin Răceanu
1105361d80 Use the correct include path for Qt headers 2018-06-24 19:49:55 +03:00
Cătălin Răceanu
ca2860907e Regenerated after Qt build changes 2018-06-24 19:48:18 +03:00
Cătălin Răceanu
6b0d920c3f Fixes for mingw64 to allow configure to finish under MSW 2018-06-24 19:47:55 +03:00
Cătălin Răceanu
e2594c8bb9 Add QT5_CUSTOM_DIR as Qt root dir for install and lib subdirs 2018-06-24 19:46:58 +03:00
trivia21
107e66e725 Simplify and make more robust wxHtmlWindow layout logic
Rewrite CreateLayout() using SetVirtualSize() to avoid trying to detect
whether the vertical scrollbar is shown manually. This is simpler and
avoids the problem of entering infinite loop if the scrollbar size used
by this function (based on wxSystemSettings::GetMetric(wxSYS_VSCROLL_X))
wasn't correct, as used to be the case for wxGTK until the recent commit
900752b152 and might still be the case in
the other ports.

Closes #18141.
2018-06-24 00:29:20 +02:00
Olly Betts
e753dc6072 Improve wxTreeCtrl::SetItemState() docs
Make it clear that the state parameter can be an index into the state
image list, not just one of the special values listed.

Closes #18152.
2018-06-24 00:00:50 +02:00
Vadim Zeitlin
d1175c00e1 Revert "Allow WM_SYSKEYDOWN to still be processed by MSWDefWindowProc, even if"
This reverts commit e771b7e4ac5c7f73a579f7329ce15e2d6710670d.

Don't always pass WM_SYSKEYDOWN to the system for processing as this can
be undesirable: e.g. inside a dialog, any Alt-X key presses with X not
being a mnemonic character result in a beep from IsDialogMessage().
Handle events for the system keys in the same way as for the normal
ones, i.e. let the system process them only if they're not handled by
the application.

This is incompatible with the previous wxMSW behaviour, but compatible
with the other ports and makes more sense, so it seems to be worth it,
on balance.
2018-06-23 23:46:10 +02:00
Artur Wieczorek
fe6ebc528d Transform trigonometric formulas to minimize the loss of precision
Closes #18142.
2018-06-23 20:45:49 +02:00
Vadim Zeitlin
9daf5bec98 Merge branch 'msw-tlw-state'
Fix showing TLWs under MSW when restoring their geometry.

See https://github.com/wxWidgets/wxWidgets/pull/842
2018-06-22 19:46:44 +02:00
mrX
89ecd81460 Don't change wxTextCtrl colour automatically under macOS
When wxColourDialog is shown, any changes to the colour selected in it
apparently result in broadcast messages to all currently visible text
controls, which was unexpected.

Block the changeColor: message to prevent this from happening.

Closes https://github.com/wxWidgets/wxWidgets/pull/830
2018-06-22 19:45:28 +02:00
Vadim Zeitlin
175756506c Minor cleanup of wxFrame::DoGetClientSize() in wxQt
Test whether height != NULL just once and make the code slightly more
compact.
2018-06-22 14:33:26 +02:00