Commit Graph

18251 Commits

Author SHA1 Message Date
Vadim Zeitlin
7e90def99a Merge branch 'gtk-text-changed-coalesce'
Harmonize wxEVT_TEXT events in wxGTK with other ports.

Also use IME for wxComboBox in wxGTK too.

See https://github.com/wxWidgets/wxWidgets/pull/1400
2019-07-16 19:41:32 +02:00
marius
8ab9fed14e Fix wxGenericTimerImpl DLL declaration in wxX11 build
This class is defined in the core library, so use the appropriate
WXDLLIMPEXP macro.

Closes #16813.
2019-07-16 02:06:01 +02:00
Vadim Zeitlin
7db13c7b93 Merge branch 'pm-dpi-aware-1-systemmetric' of https://github.com/MaartenBent/wxWidgets
Make GetSystemMetrics() and wxSystemParametersInfo DPI-aware in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1407
2019-07-15 13:21:16 +02:00
Vadim Zeitlin
ac16da0073 Merge branch 'timerevent-no-def-ctor'
Remove wxTimerEvent default constructor.

See https://github.com/wxWidgets/wxWidgets/pull/1409
2019-07-15 13:18:27 +02:00
Vadim Zeitlin
73800d66fd Merge branch 'morestcfixes' of https://github.com/NewPagodi/wxWidgets
Several minor improvements to wxSTC and documentation and one crash fix
under macOS.

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

Closes #18434.
2019-07-15 13:16:15 +02:00
Maarten Bent
e32c20ffcc Use const wxWindow in wxSystemSettings::GetMetric 2019-07-15 00:00:20 +02:00
Maarten Bent
b87a599f07 Remove static reference to NONCLIENTMETRICS
These metrics can change when the DPI of a Window changes, so we can not keep a
static reference.

According to documentation, the second parameter (uiParam) should be set to the
size of the NONCLIENTMETRICS object.
2019-07-15 00:00:19 +02:00
Maarten Bent
0a79c48631 Use DPI Aware wxSystemParametersInfo
Require a wxWindow when requesting GetNonClientMetrics.
If no wxWindow is known, use wxTheApp->GetTopWindow().
2019-07-15 00:00:19 +02:00
Maarten Bent
c0c6a4b826 Add DPI Aware replacement of SystemParametersInfo
Use SystemParametersInfoForDpi when this function is available and the DPI is
known. Otherwise keep using SystemParametersInfo.
2019-07-15 00:00:19 +02:00
Maarten Bent
04b99d54bd Add DPI Aware replacement of GetSystemMetrics
Use GetSystemMetricsForDpi when this function is available and the DPI is
known. Otherwise keep using GetSystemMetrics.
2019-07-14 23:57:27 +02:00
Artur Wieczorek
9f75d4e909 Make wxArrayStringProperty a parent of wxEditorDialogProperty
wxArrayStringProperty uses TextCtrlAndButton editor so it can be implemented as parent of wxEditorDialogProperty to re-use common functions and data.
2019-07-14 21:32:40 +02:00
Artur Wieczorek
a3ec84fdd1 Make wxFontProperty and wxMultiChoiceProperty parents of wxEditorDialogProperty
wxFontProperty and wxMultiChoiceProperty use TextCtrlAndButton editor so they can be implemented as parents of wxEditorDialogProperty to share common functions and data.
2019-07-14 21:30:00 +02:00
Artur Wieczorek
37f9c6f083 Implement wxEditorDialogProperty as a base class for wxPG properties with dialog editor
Properties using TextCtrlAndButton editor (like wxLongStringProperty, wxDirProperty, wxFileProperty) share some features, like button triggering the editor dialog, and share a data, like dialog window attributes, so for the sake of the clear design it would be good to derive them from the common base class in which all shared functions/data are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-07-14 21:29:21 +02:00
Vadim Zeitlin
bd09b4132d Remove wxTimerEvent default constructor
This ctor just created unusable wxTimerEvent objects (all of the methods
specific to this class would just crash if called on them) and doesn't
seem to be useful at all.

It was added in e47859daeb apparently only
in order to allow using wxIMPLEMENT_DYNAMIC_CLASS() instead of the
previously used wxIMPLEMENT_ABSTRACT_CLASS() for wxTimerEvent, but there
doesn't seem to be any reason to prefer macro over another, and there
are good reasons to not allow creating objects in an invalid state.

The only place where we relied on having default ctor for this event was
in wxEvent::Clone() unit test, so update it to handle wxTimerEvent
specially now that this ctor doesn't exist any longer.
2019-07-14 14:10:55 +02:00
New Pagodi
d24f58cc55 Add AUTOCOMP_SELECTION_CHANGE event for wxSTC
The SCN_AUTOCSELECTIONCHANGE notification was added in Scintilla 4.0 to
notify an application when a new item is selected in an autocompletion
or user list. However the version of Scintilla currently used is 3.7.2,
so this potentially useful notification is not available.

These changes allow an event corresponding to this notification to be
generated completely in the wxWidgets portion of wxSTC. If the Scintilla
library is ever updated to 4.0 or later, only one method should need to
be modified let Scintilla generate the event instead.
2019-07-13 12:23:06 -05:00
New Pagodi
caaebf43bc Remove wxSTC methods for configuring autocomp popup
The wxSTC methods AutoCompSetColours and AutoCompUseListCtrl were added
in fe7b332b7b to allow some configuration
of the autocompletion popup window. Based on subsequent discussion, it
was decided that a better method of configuring the popup and getting
information about the configuration is needed. For now, simply remove
the current methods while the better solution is created.

In addition, since the configuration options are being removed, set the
popup to have the appearance of a list control since that was the
appearance before any configuration options were added.
2019-07-13 12:20:10 -05:00
fuscated
158288cb35 Improve handing of the enter key in wxComboBox control
* Copy-paste the code for OnChar in the wxTextCtrl.
* This implements two features:
  1. This adds support for the wxTE_PROCESS_ENTER style.
  2. Support for pressing the default button in a dialog if there is one.
2019-07-13 17:53:40 +02:00
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
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
Paul Cornett
41a2f790e6 Fix generation of mouse events for wxDataViewCtrl with GTK
See #12650
2019-07-12 23:17:20 -07: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
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
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
2c6dcc2e51 Coalesce wxEVT_TEXT events in wxGTK wxTextCtrl and wxComboBox
For consistency with the other platforms, coalesce multiple wxEVT_TEXT
events resulting from a single user action into a single one in wxGTK
too. For example, when pressing a key in a control with some text
selected, wxGTK previously generated 2 wxEVT_TEXT events: one
corresponding to the removal of the selection and another one to the
addition of the new text. Now only a single event with the new text is
generated, as in the other ports.

Doing this requires delaying sending wxEVT_TEXT until GTK itself ends
handling the key press, however we delay it as little as possible, so
hopefully this shouldn't have any visible effects at wx API level.

Closes #10050.
2019-07-10 02:14:21 +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
958df5fb74 Use IME in wxGTK wxComboBox too
There was confusing with the method GTKIMFilterKeypress() in wxGTK
wxTextEntry: it was called the same as wxWindow virtual method of the
same name, but didn't override it, of course, as wxTextEntry doesn't
derive from wxWindow.

It also wasn't called for wxComboBox which inherited from wxTextEntry
but didn't override wxWindow::GTKIMFilterKeypress() to actually call its
method.

Fix this and rename the wxTextEntry to use a different name for clarity.
2019-07-09 19:37:21 +02:00
Jouk
d3a3353a8d Merge recent stattext chages also into WXgtk1 2019-07-09 09:02:14 +02:00
Vadim Zeitlin
5c766c0b8b Use the same "changed" GTK callback for wxComboBox and wxTextCtrl
And reuse EnableTextChangedEvents() between these classes as well.

No real changes so far, this is just a refactoring to centralize the
code in a single place before modifying it.
2019-07-08 18:50:58 +02:00
Vadim Zeitlin
c024944d78 Move logic from GTK callback to GTKOnTextChanged() virtual method
Check whether we should ignore the event and mark the control as being
dirty if necessary in a virtual method, which can be defined in
wxTextEntry and overridden by wxTextCtrl, instead of doing it in GTK
callback itself.

This will allow to reuse wxTextEntry callback for wxTextCtrl too in the
upcoming commits.

No real changes so far.
2019-07-08 18:31:57 +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
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
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
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
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
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
66d596dd09 Use standard naming convention for wxQtListTextCtrl::OnMove() 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
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
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