Commit Graph

66667 Commits

Author SHA1 Message Date
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
pk
1d52cf1d2d CMake: some cleanup 2019-07-15 11:05:43 +03: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
f74d756ca5 Use DPI Aware wxGetSystemMetrics
If no wxWindow is known, use wxTheApp->GetTopWindow().
Also use a wxWindow for all wxSystemSettings::GetMetric calls.
2019-07-15 00:00:18 +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
Deamhan
7be4d12749 CMake: pthread symbols has been removed from export (MinGW) 2019-07-15 00:10:45 +03:00
Deamhan
82dfc62a62 CMake: multiple definition issue (MinGW) has been fixed 2019-07-14 23:58:09 +03:00
Artur Wieczorek
1f78aec527 Update wxPropertyGrid wxMSW appearance image
Replace wxPG screenshot under Win XP with more recent Win 10.
2019-07-14 21:38:12 +02:00
Artur Wieczorek
4cec04cacf Show list of wxPropertyGrid events in wxPropertyGridEvent documentation
For the sake of consistency with documentation of other controls like e.g.
wxGrid, the list of events should be presented on the wxPropertyGridEvent
page so it should be moved there from the main wxPropertyGrid page.
2019-07-14 21:38:11 +02:00
Artur Wieczorek
a6e6a948ea Use conditional operator instead of conditional statement
This notation is more intuitive in this context.
2019-07-14 21:37:39 +02:00
Artur Wieczorek
b330fac6a1 Remove redundant assignments
These assignments to the temporary variables are not necessary.
2019-07-14 21:36:59 +02:00
Artur Wieczorek
f1e81ea483 Declare WXVARIANT template specialization to assign wxColourPropertyValue to wxVariant 2019-07-14 21:36:25 +02:00
Artur Wieczorek
894c69c0cd Declare WXVARIANT template specialization to assign wxFontData to wxVariant 2019-07-14 21:35:31 +02:00
Artur Wieczorek
21f9329836 Used specialized template functions to assign wxColour and wxFont to wxVariant 2019-07-14 21:34:57 +02:00
Artur Wieczorek
0b27a66700 Get rid of wxT() macro from string literal in propgrid sample
Since wxDirsProperty derives from wxArrayStringProperty and new implementation of this class no longer passes this macro parameter to OnButtonClick() so wxChar* string is no longer required here.
2019-07-14 21:32:42 +02:00
Artur Wieczorek
ac9a74ad29 Make wxArrayDoubleProperty a parent of wxEditorDialogProperty
wxArrayDoubleProperty uses TextCtrlAndButton editor so it can be implemented as parent of wxEditorDialogProperty to re-use common functions and data.
2019-07-14 21:32:41 +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
a1dac5aa38 Show wxPGProperty editor dialog only in response to clicking main editor button
Properties with editor dialog (like those derived from wxEditorDialogProperty) should show it only in response to clicking the main editor button.
2019-07-14 21:32:38 +02:00
Artur Wieczorek
30630d4ea5 Update wxFontDataProperty to conform to the current design of wxPG properties with editor dialog
Since wxFontDataProperty derives from wxFontProperty, it should re-implement DisplayEditorDialog() to work as expected.
2019-07-14 21:31:11 +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
New Pagodi
f18699c0af Fix invalid parameter names in wxSTC docs 2019-07-14 12:53:29 -05:00
Vadim Zeitlin
81a2984ba9 Improve wxTE_PROCESS_ENTER documentation
Explicitly mention that if no handler for wxEVT_TEXT_ENTER is defined
(or if a handler exists, but skips the event), the default handling of
"Enter" still takes place.
2019-07-14 16:55:44 +02:00
Vadim Zeitlin
13aa2a6721 Add unit tests for checking wxTE_PROCESS_ENTER handling
Verify that pressing Enter in a dialog activates its default button when
a text-like (i.e. wxTextCtrl or wxComboBox) has focus either if it
doesn't have wxTE_PROCESS_ENTER style or if it does, but its handler
skips the event, but not if the style is used and the event is handled.
2019-07-14 16:55:44 +02:00
Vadim Zeitlin
f7ead9f844 Fix "Enter" behaviour when wxEVT_TEXT_ENTER is skipped in wxGTK
Bring wxGTK in sync with wxMSW and wxMac by activating the default
button manually if wxEVT_TEXT_ENTER handler skips the event.
2019-07-14 16:55:44 +02:00
Vadim Zeitlin
cf16c29e39 Remove CppUnit boilerplate from wxEvent::Clone() test case
Just remove the unnecessary macros and test case class.

No real changes.
2019-07-14 14:12:25 +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
Stefan Csomor
914e6f99f4 adding xh_dataview.cpp to Xcode project 2019-07-14 10:31:14 +02:00
Vadim Zeitlin
ef03d3bb93 Fix "Enter" in wxComboBox with wxTE_PROCESS_ENTER in wxMSW
Activate the default button of the dialog containing the wxComboBox if
wxEVT_TEXT_ENTER handler didn't process the even, just as it was already
done for wxTextCtrl.

See #18273.
2019-07-14 01:58:49 +02:00
Vadim Zeitlin
c43e0fa123 Move WM_CHAR handling inside the switch in wxTextCtrl code
No real changes, just check for WM_CHAR inside the existing "switch"
instead of writing a separate "if" statement just for it.

Note that removing HasFlag(wxTE_PROCESS_ENTER) test shouldn't matter as
we should be only getting WM_CHAR for VK_RETURN when this flag is used.
2019-07-14 01:58:48 +02:00
Vadim Zeitlin
17f9a71586 Don't mark WM_CHAR for VK_RETURN as processed if it wasn't
This doesn't seem to change anything in practice, but it's more logical
to not pretend that we processed the message if we didn't do anything at
all with it.
2019-07-14 01:37:32 +02:00
Vadim Zeitlin
8746da90fe Add wxTextEntry::ClickDefaultButtonIfPossible() to wxMSW
Factor out this function from wxTextCtrl to allow its reuse in
wxComboBox in the upcoming commit.

No real changes, this is a pure refactoring.
2019-07-14 01:37:32 +02:00
New Pagodi
3ccb912e62 Store SELECTION_CHANGE data in wxSTCListBoxVisualData
The first attempt to add the wxEVT_STC_AUTOCOMP_SELECTION_CHANGE event to wxSTC
passed the data needed for the event through the constructor for the
wxSTCListBox class. Instead of mdifying the constructor for wxSTCListBox, it’s
better to store the data in the wxSTCListBoxVisualData class with accessors for
setting and retrieving the data.
2019-07-13 15:53:33 -05:00
Vadim Zeitlin
4bd78b06a0 Correct misleading wxMenuEvent::GetMenu() documentation
Don't claim that the menu is never null, as this does happen when
opening/closing the window system menu under MSW.

Closes #18443.
2019-07-13 22:02:32 +02:00
New Pagodi
3ce4a89c06 Refer wxSTC documnentation to wxStyledTextEvent page
The current wxSTC documentation page currently has a bare listing of the
event types defined for wxStyledTextEvent. These event types are
completely documented on the wxStyledTextEvent page. However the bare
listing on the wxSTC page can lead to the conclusion that there is no
documentation for the event types.

Remove the bare listing from the wxSTC page and replace it with a
referral to the wxStyledTextEvent page. This is consistent with other
large classes such as wxGrid and wxRichTextCtrl that separate the
documentation for their methods and events.
2019-07-13 12:56:21 -05:00
New Pagodi
67825e42f7 Update wxEVT_STC_CHANGE documentation 2019-07-13 12:55:52 -05:00
New Pagodi
61d4dbc66b Fix crash with wxSTC autocomp on macOS
On macOS, the autocompletion popup maintains a pointer to its parent
control since it sometimes needs to set a cursor on the control. However
when the control is destroyed while the popup is active, the control is
destroyed before the popup because of the delayed destruction used by
the popup. This leaves the popup with a dangling pointer and can lead to
crashes.

To prevent this, let the popup handle the window destroy event for the
control. Reset the pointer to NULL in that handler so that the popup
will no longer try to access its parent control after it is deleted.
2019-07-13 12:40:27 -05: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
Stefan Csomor
8a69ec7c4e Perform Default Item Click on macOS for combobox
even when wxTE_PROCESS_ENTER has ben applied if we don’t have a non-skipping handler, see #18273
2019-07-13 18:22:35 +02: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
3d65840f8f Implement doCommandBySelector for the wxNSComboBox class
* Use the same code as for wxNSTextField (copy-pasted).
* This method is used to redirect the enter key event to the OnChar
  event.
* This makes it possible to implement the default button activation by
  pressing the enter key (for comboboxes which doesn't have the 
  wxTE_PROCESS_ENTER style).
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
Deamhan
242ecbb185
Update build/cmake/options.cmake
Co-Authored-By: Maarten <MaartenBent@users.noreply.github.com>
2019-07-13 18:51:19 +03: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