Commit Graph

66377 Commits

Author SHA1 Message Date
Vadim Zeitlin
7206194d08 Show new wxTextCtrl value in the widgets sample
This is useful for quickly checking that we're getting expected events
when modifying the control and/or not getting any unexpected ones and
was already done on wxComboBox page, but not for wxTextCtrl.
2019-07-08 11:08:53 +02:00
Vadim Zeitlin
a2ffca0d96 Merge branch 'msvs2019'
Add full MSVS 2019 support.

See https://github.com/wxWidgets/wxWidgets/pull/1375
2019-07-08 10:43:10 +02:00
dos
d846cfae6f Add use of Visual Studio 2019 (vc142) to official build scripts
Build binaries using MSVS 2019/vc142 toolset too.

Closes https://github.com/wxWidgets/wxWidgets/pull/1384
2019-07-08 10:42:26 +02:00
Vadim Zeitlin
8a4fc479e0 Fix wxTextCtrl using hints and handling wxEVT_TEXT in wxGTK2 etc
With the generic hint support (used in pre-Vista wxMSW, wxGTK2, ...),
defining a wxEVT_TEXT handler not skipping the event completely broke
the control functionality as it was cleared, i.e. replaced the
user-entered text with the hint, whenever it lost focus.

This happened because wxTextEntryHintData::OnTextChanged() was never
called in this case, as the user-defined wxEVT_TEXT handler preempted
it. Work around this by pushing an event handler to the front of the
window event handlers chain instead of just binding to the window events
directly -- this could still potentially result in the same problem if
the user code pushes their own event handler, but this should be much
more rare and, in any case, there is not much we can do about this (the
only solution would seem to be to modify all platform-specific code to
update wxTextEntryHintData explicitly whenever the text changes).
2019-07-08 10:28:10 +02:00
Vadim Zeitlin
4a6f16cf15 Merge branch 'statictext-setlabel'
wxControl label-related fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1364
2019-07-08 10:09:49 +02:00
Vadim Zeitlin
958521183a Add minimal support for ellipsization to wxQt wxStaticText
Set the visible label to the ellipsized value, if necessary.

Also call AutoResizeIfNecessary() for consistency with the other ports.
2019-07-08 10:09:14 +02:00
Vadim Zeitlin
1f9dd05797 Stop passing wxString by value to wxLog::GetComponentLevel()
This function is almost exclusively called from IsLevelEnabled() which
doesn't get inlined (at least by MSVS) when wxString is passed by value
to it, and so had to be updated to take a const reference instead, which
means that a copy is always going to be made anyhow, so don't try to be
smart and avoid it -- it doesn't work anyhow and just results in unusual
code, requiring explanatory comments (not needed any longer) and
upsetting static code analyzers.

No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/1387
2019-07-08 10:04:14 +02:00
iwbnwif
a7fe78eda8 Implement wxSlider ticks support in wxGTK
Tick marks were not available for wxSlider under GTK+ 2 or GTK+ 3
implementations of wxWidgets. However, tick marks have been available
for the GtkScale widget since GTK+ 2 version 2.16.

This change adds similar functionality in relation to tick marks
as was already available in wxMSW builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/1355
2019-07-07 17:04:55 +02:00
Vadim Zeitlin
0c64345890 Add instructions for adding support for new MSVS version
Try to collect all the information in a single place to make things
easier for the next update.
2019-07-07 15:32:33 +02:00
Igor Korot
e8991252ec Improve documentation of wxAuiPaneInfo direction-related methods
Mention the corresponding flag in the documentation of all helper
functions, not just some of them.

Closes #9722.

Closes https://github.com/wxWidgets/wxWidgets/pull/1388
2019-07-07 14:01:21 +02:00
Andreas Falkenhahn
c3ce5244e3 Return -1 from GetLineLength() if line number is out of range
Make wxTextCtrl behaviour in all ports consistent with the documentation
and also update wxStyledTextCtrl to behave accordingly.

Closes #18431.
2019-07-07 03:35:21 +02:00
Andreas Falkenhahn
6e556d4a71 Check parameters of XYToPosition() and PositionToXY() in wxSTC too
For consistency with wxTextCtrl, return -1 if input parameters are out
of range.

Closes #18430.
2019-07-07 03:30:37 +02:00
Vadim Zeitlin
cc41ddf62a Document wxGCDC::SetGraphicsContext() difference from ctor
Document the discrepancy between constructing wxGCDC from
wxGraphicsContext directly or default-constructing it and calling
SetGraphicsContext() later.

Current behaviour is somewhat inconsistent, but useful, because it
allows to draw on wxGraphicsContext using wxDC API using any kind of pen
and brush, even those not supported by this API, while remaining
backwards-compatible (i.e. we can't change SetGraphicsContext() to not
re-apply font, pen and brush, as this would break any existing code
relying on this happening), so it seems like the best alternative.
2019-07-07 03:18:18 +02:00
Vadim Zeitlin
8926928a8f Fix regression in wxGCDC initialization from wxGraphicsContext
The changes of ae2cb7d347 resulted in
transformation matrix not being initialized correctly any more.

Fix this by adding yet another helper, DoInitContext(), called both when
initializing wxGCDC using an existing wxGraphicsContext in the
corresponding ctor and the just created one in the other ones.

Closes #18429.
2019-07-07 03:14:21 +02:00
Vadim Zeitlin
a1bd57d1d8 Make wxLog non-copyable
It doesn't make sense to copy objects of this class and this wouldn't
work correctly due to the presence of m_formatter field.

See https://github.com/wxWidgets/wxWidgets/pull/1389
2019-07-07 02:54:20 +02:00
Vadim Zeitlin
c5f6836d6f Upgrade bundled Expat to post-2.2.7 version with a security fix
This upgrade includes the fix for CVE-2018-20843.

Closes https://github.com/wxWidgets/wxWidgets/pull/1374
2019-07-03 23:49:20 +02:00
Chris Lemin
efe9236b16 Add support for alignment flags to wxStaticText in wxQt
Ensure static text fields use the alignment specified by WX on creation.

This is the second commit doing this, the first one was reverted because
it accidentally included unrelated changes, sorry for the trouble.

See https://github.com/wxWidgets/wxWidgets/pull/1381
2019-07-03 23:48:22 +02:00
Vadim Zeitlin
a51af03670 Revert "Add support for alignment flags to wxStaticText in wxQt"
This reverts commit 0f49825d64 because it
accidentally included unrelated changes. It will be re-committed again
soon.

See https://github.com/wxWidgets/wxWidgets/pull/1381
2019-07-03 23:47:09 +02:00
Vadim Zeitlin
8e15849706 Use wxOVERRIDE for deprecated wxBitmap methods in wxQt too
When WXWIN_COMPATIBILITY_3_0 is on, compiling this header results in a
bunch of harmless but annoying -Winconsistent-missing-override clang
warnings, so add wxOVERRIDE to silence them.

No real changes.
2019-07-03 15:31:15 +02:00
Chris Lemin
0f49825d64 Add support for alignment flags to wxStaticText in wxQt
Ensure static text fields use the alignment specified by WX on creation.

Closes https://github.com/wxWidgets/wxWidgets/pull/1381
2019-07-03 15:28:55 +02:00
Graham Dawes
e5ba6d9393 Implement SetForegroundColour and SetBackgroundColour for wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1373
2019-07-03 13:25:55 +02:00
Graham Dawes
9e35bb92c0 Avoid focus loss event when wxComboBox popup is opened in wxQt
Prevent wxComboBox from generating a wxEVT_KILL_FOCUS event when the
user opens the drop-down list under wxQt, as logically the drop-down is
part of wxComboBox, even if it's a separate window at Qt level.

Closes https://github.com/wxWidgets/wxWidgets/pull/1377
2019-07-03 13:18:30 +02:00
Graham Dawes
1c5921f85a Fix wxTreeCtrl right click and middle click events for wxQt
This fixes the issue in the sample with the context menu not appearing
when the user right clicks on an item.

Closes https://github.com/wxWidgets/wxWidgets/pull/1379
2019-07-03 13:05:19 +02:00
Graham Dawes
25c9bf9664 Fix misaligned icons in wxTreeCtrl for wxQt
Center the items vertically, as this looks much better, and is also more
consistent with the appearance in the generic version, which was
previously used.

Closes https://github.com/wxWidgets/wxWidgets/pull/1378
2019-07-03 13:03:04 +02:00
Graham Dawes
81c31c6094 Fix wxTreeCtrl::IsVisible() for wxQt
Return false if the item is expanded but scrolled outside of the
viewport, to conform to the function documentation and the behaviour in
the other ports.

Closes https://github.com/wxWidgets/wxWidgets/pull/1380
2019-07-03 13:01:32 +02:00
Graham Dawes
07c6c61b2c Don't show context help button by default in wxQt dialogs
Only show it if wxDIALOG_EX_CONTEXTHELP was explicitly specified for
consistency with the other ports.

Closes https://github.com/wxWidgets/wxWidgets/pull/1382
2019-07-03 12:57:23 +02:00
Graham Dawes
ab553cd6db Add support for wxLB_EXTENDED style to wxQt wxListBox
Closes https://github.com/wxWidgets/wxWidgets/pull/1383
2019-07-03 12:53:26 +02:00
Vadim Zeitlin
c6ae346028 Update the latest supported MSVS version in top-level README too 2019-07-02 12:10:36 +02:00
Vadim Zeitlin
ae2cb7d347 Merge branch 'gcdc-from-context-ctor'
Don't overwrite wxGraphicsContext attributes from wxGCDC ctor.

See https://github.com/wxWidgets/wxWidgets/pull/1078
2019-07-02 11:47:01 +02:00
Vadim Zeitlin
3e728170b2 Fix best size of wxMSW wxSpinCtrl with non-default font
This has been broken by dce65bed1c after
which the actual font used for the control was not taken into account
any longer. Fix this by ensuring the wxTextCtrl used for size
calculation uses the same font as wxSpinCtrl itself.

See #12297, #18391.

Closes #18427.
2019-07-02 11:46:11 +02:00
Vadim Zeitlin
af6e478182 Don't reset wxGraphicsContext attributes in wxGCDC ctor from it
When creating wxGCDC from an existing wxGraphicsContext, it is better to
keep using the attributes (such as font, pen, brush) already configured
for it rather than overwriting them with the default values, which is
not very useful, unlike the new behaviour, which allows to configure
wxGraphicsContext using features not supported by wxDC API (e.g. alpha
channel for pens/brushes) and then use it via wxDC API only (allowing
the existing legacy code to use alpha, for example).
2019-06-30 19:19:31 +02:00
Vadim Zeitlin
0338ad5124 Factor out wxGCDCImpl::CommonInit()
No real changes, just a small refactoring that will allow reusing the
new CommonInit() method in the next commit.
2019-06-30 19:19:31 +02:00
Vadim Zeitlin
b192b4f676 Remove redundant m_colour initialization in wxGCDCImpl
This field is already initialized by the base class ctor, there is no
need to do it here again.
2019-06-30 16:15:31 +02:00
Vadim Zeitlin
2ff910de4f Add a helper for generating wxQt tags 2019-06-29 20:52:10 +02:00
Vadim Zeitlin
e67223e6c4 Merge branch 'qt-treectrl'
Closes https://github.com/wxWidgets/wxWidgets/pull/1225
2019-06-29 20:51:09 +02:00
Vadim Zeitlin
66d596dd09 Use standard naming convention for wxQtListTextCtrl::OnMove() 2019-06-29 20:49:47 +02:00
Vadim Zeitlin
2ce16cba08 Implement wxTreeCtrl::GetFirstChild() in terms of GetNextChild()
This makes the code slightly simpler, as there is just one function
instead of two, and also changes the meaning of the value stored in the
cookie parameter as a side effect: previously, it was the index of the
last retrieved item, while now it's the index of the next item to
retrieve.

The difference is not huge, but the latter is more usual and, more
importantly, avoids a stack overflow due to infinite recursion in the
treectrl sample, which assumed that cookie is never null after a
successful call to GetFirstChild(). The code in the sample is arguably
incorrect, as the cookie is supposed to be opaque, but it's still better
to avoid crashing, especially because similar code is almost certainly
present in user code if it was copied from the sample.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
21b2eef7e5 Make platform test slightly more readable
Also add a comment explaining what are we doing here.

And fix the #endif comment to match the updated #if condition.

No real changes.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
32e3846e27 Remove private headers from the public headers list
Private headers should not be installed and so must not be included in
the HDR variables in the file lists.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
a20cb4f680 Make new source file non-executable 2019-06-29 20:49:47 +02:00
Vadim Zeitlin
44634cbf90 Merge branch 'qt_tree_control' of https://github.com/GeoTeric/wxWidgets into qt-fixes
See https://github.com/wxWidgets/wxWidgets/pull/1225
2019-06-29 20:49:25 +02:00
Artur Wieczorek
a4ba437aeb Fix handling wxHeaderCtrlSimple events in widgets sample
Generic implementation of wxHeaderCtrlSimple processes EVT_HEADER_xxx internally so we cannot block processing these events in our handlers.
2019-06-29 11:16:31 +02:00
Artur Wieczorek
ec56795572 Fix recursion in calling const getters
We have to explicitly call non-const getter to avoid recursive calls of the const getter.
2019-06-29 11:16:30 +02:00
Artur Wieczorek
d55cf1fc1f Fix marking wxPGIterator template class with dllexport/import attributes
It's not allowed to mark the class template. Only explicit instantiation can be marked with dllexport/import attributes.
2019-06-29 11:16:29 +02:00
Artur Wieczorek
d0a61a09ec Make validation helper functions private in all numeric wxPG properties
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.
2019-06-29 11:16:01 +02:00
Artur Wieczorek
48adc38bbb Refactor code for numeric validation in numeric wxPG properties
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
2019-06-29 11:13:14 +02:00
Artur Wieczorek
69632371e3 Implement wxNumericProperty as a base class for all wxPG numeric properties
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-06-29 11:13:13 +02:00
Artur Wieczorek
bd1b5c4111 Simplify calls for numeric validation
Instantiate NumericValidation() template directly for required data type in DoValidation() and avoid this way intermediate conversions to another data types.
2019-06-29 11:12:41 +02:00
Artur Wieczorek
e96bc37066 Refactor template function to validate numeric wxPG properties
Duplicating the code of the entire NumericValidation() template function just for one specialization (for double value type) seems to be an overkill. Only small fraction of the code (to round the validated value) is really dependent on the value type and this part can be moved to the template function GetRoundedValue() which in turn can be specialized as required.
2019-06-29 11:12:40 +02:00
Artur Wieczorek
dbb727a716 Use dedicated function to check if the mouse button is pressed 2019-06-29 11:12:39 +02:00