Commit Graph

66403 Commits

Author SHA1 Message Date
fuscated
491c131886 Add shortcuts for the combobox (select all, copy, cut, paste)
* It is the same as the code in the implementation of the wxTextCtrl, I
  guess this could be extracted in a common function, but I don't know
  where to put it.
2019-07-13 17:53:40 +02:00
Vadim Zeitlin
6cdf22b5dd Fix out-of-bounds buffer read in Scintilla MMIXAL lexer
Fix off-by-1 error in the loop condition.

Apply our own minimal fix because Upstream is aware of the bug (see
https://sourceforge.net/p/scintilla/bugs/2019/) but refuses to fix it
there.

Closes #18440.
2019-07-13 17:01:10 +02:00
Deamhan
b92c30191c CMake: Add wxUSE_NO_RTTI option
This is similar to configure --enable-no_rtti option.

Closes https://github.com/wxWidgets/wxWidgets/pull/1405
2019-07-13 16:57:51 +02:00
PB
67361b89d5 Improve wxColour documentation
In the class description mention that in addition to RGB, an alpha value
is stored as well. Remove incorrect description of operator=(), clarify
meaning of "on" parameter in MakeMono(), and make few minor text edits.

Closes https://github.com/wxWidgets/wxWidgets/pull/1411
2019-07-13 16:55:24 +02:00
Vadim Zeitlin
4bb53ff5f3 Document the bounds of wxRect more precisely
Explain which points exactly lie inside the rectangle and the
relationship between width/height and the bottom right corner
coordinates.
2019-07-13 16:53:28 +02:00
Vadim Zeitlin
53f40b5029 Update comment and documentation related to C4535 MSVC warning
Update the compiler version in the comment and explain how/when to
update it in the future.
2019-07-13 16:31:19 +02:00
Deamhan
59245dd232 CMake: Don't use /EHa for MSVS
This is unnecessary and may result in worse performance for the
generated code.

Closes #18436.

Closes https://github.com/wxWidgets/wxWidgets/pull/1396
2019-07-13 16:23:11 +02:00
Paul Cornett
41a2f790e6 Fix generation of mouse events for wxDataViewCtrl with GTK
See #12650
2019-07-12 23:17:20 -07:00
Artur Wieczorek
82f88906cf Add @since tags for newly implemented wxNumericProperty 2019-07-12 21:07:21 +02:00
Artur Wieczorek
050d608bcf Don't use export/visibility attributes in typedefs 2019-07-12 21:07:21 +02:00
Artur Wieczorek
6898abf8d6 Fix build with wxUSE_VARIANT==0
wxPropertyGrid and wxRichTextCtlr depend on wxVariant.
2019-07-12 21:06:59 +02:00
Vadim Zeitlin
fe0d81a376 Merge branch 'msw-font-dpi'
Various wxFont-related fixes and refactorings in preparation for adding
per-monitor DPI support.

Closes https://github.com/wxWidgets/wxWidgets/pull/1408
2019-07-12 18:53:24 +02:00
Maarten Bent
c7efab6d8a Fix using invalid HFONT in wxGetTextMetrics()
If the window has no valid font, GetFont() returns a temporary font.
Extend this font lifetime, so the HFONT remains valid till the end of
the function.
2019-07-12 18:48:03 +02:00
Vadim Zeitlin
63c118f186 Fix DPI used in wxTextCtrl::GetStyle()
Using the window DPI resulted in returning a twice bigger size in points
than the size really used for the windows on high-DPI monitors as,
apparently, RichEdit always uses DPI of 96 internally (tested with both
wxTE_RICH and wxTE_RICH2 in 192 DPI under Windows 10.0.16299.785).
2019-07-12 18:48:03 +02:00
Vadim Zeitlin
69586bb03b Reuse wxNativeFontInfo::GetLogFontHeightAtPPI()
Instead of calling ::MulDiv() directly, reuse GetLogFontHeightAtPPI()
as it is more readable.
2019-07-12 18:48:03 +02:00
Vadim Zeitlin
de6d7472a2 Add static GetLogFontHeightAtPPI() overload taking point size
This will be useful elsewhere too and makes SetFractionalPointSize()
implementation less fragile as we don't have to be careful about
changing pointSize member before setting lf.lfHeight any more.
2019-07-12 18:48:03 +02:00
Vadim Zeitlin
72a225924d Remove wxCreateFontFromLogFont() and wxFillLogFont()
These functions are not really useful as converting between wxFont and
LOGFONT can be done trivially by passing via wxNativeFontInfo and, in
fact, wxCreateFontFromLogFont() managed to do the conversion wrongly by
forgetting to update wxNativeFontInfo::pointSize member when changing
wxNativeFontInfo::lf.

This fixes one unit test failure after the latest changes, although not
yet the other one, see the upcoming commit for this.
2019-07-12 18:48:03 +02:00
Vadim Zeitlin
90186f7740 Refactor handling point size in wxNativeFontInfo
No real changes yet, this commit just prepares for adding support for
per-monitor DPI by reorganizing some code.
2019-07-12 18:48:04 +02:00
Vadim Zeitlin
fda3bcbfc5 Remove unused static variable from wxMSW wxDisplay code
This should have been done in f936a54000
which removed dynamic loading of display-related functions.

No real changes.
2019-07-12 16:35:01 +02:00
Vadim Zeitlin
b62563b907 Remove redundant Free() from wxFont::SetFractionalPointSize()
Free() is already called from wxFontRefData::SetFractionalPointSize(),
so there is no need to call it from wxFont too and doing this makes this
method gratuitously inconsistent with all the other setters.

No real changes.
2019-07-12 00:11:54 +02:00
Vadim Zeitlin
b24d7e3ae4 Add a simple wxSetWindowFont() helper
This function is a just a very thin wrapper for WM_SETFONT, but it's
still better to have it rather than write casts to WPARAM and
MAKELPARAM() in several different places.

Note that this removes the assert for font validity from
wxWindow::SetFont() which really doesn't make much sense (and if we
wanted to have it, it would be better to have it for all ports in
wxWindowBase instead) and was never triggered since more than 20 years
of its existence.
2019-07-12 00:11:53 +02:00
Vadim Zeitlin
7d229dd695 Allow really using wxHeaderCtrl in the grid sample
The "Native" menu item actually only toggled drawing native-lookalike
labels, but didn't use wxHeaderCtrl as could be expected. Rename the
existing menu item to "Native-like" and add the new "Native" one which
really enables the use of wxHeaderCtrl.
2019-07-10 16:51:31 +02:00
Vadim Zeitlin
e8712b3c56 Make wxTreeCtrl::EnsureVisible() work while frozen in wxMSW
Scrolling the item into view to make it visible didn't work since the
changes of badf6bc300, which suppressed
scrolling completely while frozen, any longer.

Work around it by remembering the item to make visible and actually
doing it when the control is thawed.

Also add menu item to call Freeze()/Thaw() on wxTreeCtrl in the sample
to make testing this and similar problems easier.

Closes #18435.
2019-07-09 23:00:11 +02:00
Vadim Zeitlin
1cdba2b5ab Remove unnecessary headers included from src/msw/control.cpp
They are not needed any more since the changes removing the dynamic
casts to wx{List,Tree}Ctrl in c45a8d49f1.

No real changes.
2019-07-09 22:58:09 +02:00
Vadim Zeitlin
7715bd5170 Remove obsolete note about limited wxFileDataObject support
This class seems to be implemented in all the major ports, so remove
note saying that it supports dragging files from the applications only
under MSW.

Closes #18437.
2019-07-09 22:36:20 +02:00
Jouk
d3a3353a8d Merge recent stattext chages also into WXgtk1 2019-07-09 09:02:14 +02:00
Jouk
acef902ea6 add src/xrc/xh_dataview.cpp to OpenVMS makefiles 2019-07-08 14:48:32 +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