Commit Graph

66440 Commits

Author SHA1 Message Date
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
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
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
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
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
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