Commit Graph

18316 Commits

Author SHA1 Message Date
oneeyeman1
28a84486bd Implement wxClipboard::Flush() in wxGTK
Update the documentation and also add a call of Flush() to the sample.

Closes #10515.

Closes https://github.com/wxWidgets/wxWidgets/pull/1316
2019-05-10 01:46:54 +02:00
Vadim Zeitlin
02adddfa1a Merge branch 'wxlistctrl-virtual-checkboxes' of https://github.com/MaartenBent/wxWidgets
Add support for checkboxes to virtual wxListCtrl too.

See https://github.com/wxWidgets/wxWidgets/pull/1315
2019-05-10 01:39:33 +02:00
Vadim Zeitlin
04689e9727 Merge branch 'utf8-text-stream'
Really fix reading from UTF-8 text streams.

Closes #14720.

See https://github.com/wxWidgets/wxWidgets/pull/1304
2019-05-10 01:35:55 +02:00
Vadim Zeitlin
998097b3a4 Merge branch 'col-dialog-current'
Add events for current colour change in wxColourDialog and
wxColourPickerCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1301
2019-05-10 01:31:18 +02:00
Maarten Bent
353b0aabba Add virtual function to provide virtual wxListCtrl checkbox state 2019-05-05 14:24:30 +02:00
Maarten Bent
ceaf2aa803 Move virtual stub functions to wxListCtrlBase 2019-05-05 14:23:44 +02:00
Maarten Bent
d262aa02d1 Remove obsolete wxOSX/Carbon listctrl header 2019-05-04 15:03:20 +02:00
QuentinC
413abb066e Allow retrieving current filter from wxFileDialog extra controls
Add wxFileDialog::GetCurrentlySelectedFilterIndex() similar to the
existing GetCurrentlySelectedFilename(), which can be used to retrieve
the index of the currently selected filter and update the state of the
extra controls in wxFileDialog accordingly.

Implement this for wxMSW only by updating the internally stored value
from the native CDN_TYPECHANGE notification and also generating a
wxEVT_UPDATE_UI event to allow the extra controls to update themselves.

Closes https://github.com/wxWidgets/wxWidgets/pull/1310
2019-05-02 19:53:05 +02:00
Artur Wieczorek
9df9e32a70 Get rid of unnecessary casts to wxPGProperty*
These casts are unnecessary and can be removed.
2019-04-28 17:04:07 +02:00
Artur Wieczorek
50b1cfd0b5 Use dedicated function to change wxPGProperty flags
Using wxPGProperty::ChangeFlag() function makes the code simpler and more readable.
2019-04-28 16:38:48 +02:00
Artur Wieczorek
bd313b64ab Fix copying wxPGAttributeStorage
We need implement copy ctor and assignment operator because we are going to do a shallow copy of wxPGHashMapS2P data member and therefore we have to manually update reference counters of the objects being referenced in this map.
2019-04-28 16:35:11 +02:00
Artur Wieczorek
f39e70be15 Use dedicated event type to notify header about column width changes
Notification about changes of column widths needs to be sent locally from wxPropertyGrid to  wxPropertyGridManager (to update the header) so it would be good to use a dedicated non-public event type for these purposes.
2019-04-28 15:31:10 +02:00
Vadim Zeitlin
bf3f84c867 Compilation fix for TempHWNDSetter in wxQt
Fix wxQt build after 2aef6570bb:
TempHWNDSetter can only be defined when using wxMSW.
2019-04-26 13:11:43 +02:00
Vadim Zeitlin
91b3bfedf8 Fix using std::reverse() with wxString iterators in a proper way
The solution with specializing std::iter_swap() for wxString::iterator
was not conforming as the iterator was still not swappable, as it is
required to be.

Fix this by providing std::swap() overload for wxString::iterator, which
is correct and even simpler.

This allows std::reverse(s.begin(), s.end()) work with clang too and
incidentally avoids warnings about the code relying on non-conforming
extensions with MSVS 2017 which were due to the fact that iter_swap()
workaround wasn't enabled for it, while the new swap() overload is.
2019-04-26 03:20:38 +02:00
Vadim Zeitlin
a1b39ce78b Merge branch 'wxsvgfiledc-improvements' of https://github.com/MaartenBent/wxWidgets
Fix wxSVGBitmapFileHandler directory for saving files and other
miscellaneous improvements to wxSVGFileDC code and documentation.

See https://github.com/wxWidgets/wxWidgets/pull/1290
2019-04-25 18:54:23 +02:00
Vadim Zeitlin
2aef6570bb Add TempHWNDSetter RAII helper to wxMSW and use it
No real changes, just replace pairs of SetHWND(hwnd)/SetHWND(0) calls
with the use of TempHWNDSetter.
2019-04-25 17:12:41 +02:00
Maarten Bent
e32721247a Use wxFileName in wxSVGBitmapFileHandler constructor 2019-04-23 21:20:02 +02:00
Artur Wieczorek
cd1dafb619 Make wxPG_ATTR_MULTICHOICE_USERSTRINGMODE a built-in attribute
This attribute is used only internally in wxArrayStringProperty and thus can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
2019-04-22 20:16:15 +02:00
Vadim Zeitlin
84dc4707d7 Fix horizontal scrollbar handling for wxCheckListBox in wxMSW
The scrollbar wasn't shown when the control became only slightly more
narrow than its contents, resulting in truncation of the rightmost part
of the strings shown in it.

Fix this by accounting for the check box explicitly in wxListBox
SetHorizontalExtent() method using the new MSWGetFullItemSize() helper
which is also used to avoid code duplication between wxCheckListBox
MSWOnMeasure() and DoGetBestClientSize() methods.

Closes #18377.
2019-04-22 14:57:55 +02:00
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Vadim Zeitlin
5d770e5cbe Use "m_" prefix for wxExecuteData members
No real changes, just rename the members to use the standard prefix
which is more consistent with the rest of wxWidgets and also allows to
avoid both the hacks with "foo_" names for the arguments of some
functions that were used to avoid the conflicts with member "foo" and
at least one remaining shadowing warning for "exitcode".
2019-04-22 14:09:28 +02:00
Stefan Csomor
5020a810db Fix macOS memory leaks, also avoid false positive warnings from clang analyzer
__clang_analyzer__ is a constant that only is defined during analyze build, this helps avoiding false positives as long as there is no specific way to silence analyzer messages
2019-04-21 23:52:37 +02:00
Artur Wieczorek
b35170dc61 Make wxPG_BOOL_USE_CHECKBOX and wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING built-in attributes
Both attributes are used only in wxBoolProperty and wxFlagsProperty to set respective internal flags and don't have to be stored in the property's attribute store.
2019-04-21 23:39:32 +02:00
Artur Wieczorek
ccd877c458 Make wxPG_FLOAT_PRECISION a built-in wxFloatProperty attribute
wxPG_FLOAT_PRECISION value is used only internally in wxFloatProperty and there is no need to make it readable via getter function.
2019-04-21 23:39:30 +02:00
Vadim Zeitlin
af83769bd0 Add wxMBConv::GetMaxCharLen()
This is not used yet, but will be needed soon in order to determine
whether we have sufficiently many to decode them.
2019-04-21 20:04:52 +02:00
Vadim Zeitlin
9a9c845289 Add wxSystemAppearance to check for dark mode under macOS
Provide a way to retrieve the name of the current system appearance
(mostly for diagnostic purposes) and check if it uses predominantly dark
colours.

Currently this class has a non-trivial (but still very simple)
implementation under macOS only and simply checks whether the default
text colour is brighter than the default background colour under the
other platforms, but other platform-specific implementations could be
added later.

Also update the drawing sample "system colours" page to show the system
appearance as well.
2019-04-21 02:11:07 +02:00
Vadim Zeitlin
d662a2223e Add wxColour::GetLuminance()
This method can be used to return the perceived brightness of the
colour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1300
2019-04-21 02:09:42 +02:00
Vadim Zeitlin
b6477e0b9c Merge branch 'stcpopup'
Many usability and appearance improvements for autocompletion popups and
call tips in wxSTC.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-04-21 02:03:32 +02:00
Vadim Zeitlin
807d95e07d Add wxEVT_COLOURPICKER_CURRENT_CHANGED and DIALOG_CANCELLED events
Send events from generic wxColourPickerCtrl when the currently selected
colour in the dialog shown by it changes and when this dialog is
cancelled.

Notice that currently this only works on wxMSW as it relies on
wxEVT_COLOUR_CHANGED support in wxColourDialog which is only available
there.

Based on work of Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
2019-04-21 01:53:14 +02:00
Vadim Zeitlin
35c16935f1 Send wxEVT_COLOUR_CHANGED from wxColourDialog under MSW
Add support for a new event sent by wxColourDialog, currently only under
MSW, when the colour currently selected in it changes.

Based on work by Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
2019-04-21 01:53:14 +02:00
Vadim Zeitlin
1f15b41f55 Merge branch 'osx-warnings'
Fix a few warnings with Xcode 10 and start using __builtin_available for
macOS version checks.

See https://github.com/wxWidgets/wxWidgets/pull/1299
2019-04-18 22:58:23 +02:00
Vsevolod V Gromov
20c7421a67 Add Get{Min,Max,Range}() to numeric validator classes
Just provide accessors matching the existing setters.

Closes https://github.com/wxWidgets/wxWidgets/pull/1287,
https://github.com/wxWidgets/wxWidgets/pull/1288
2019-04-18 16:47:02 +02:00
Vsevolod V Gromov
3674bd1c1f Add wxDCTextBgColourChanger and wxDCTextBgModeChanger helpers
These classes are similar to the existing wxDCTextColourChanger and
allow temporarily changing other wxDC attributes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1298
2019-04-18 16:34:38 +02:00
Vadim Zeitlin
fe311b9cc5 Use __builtin_available() when available in wxMac builds
The advantage of using this compiler builtin instead of our own platform
checks is that the compiler will warn us (if -Wunguarded-availability is
turned on for APIs introduced before 10.13 or by default for later ones)
if a check is forgotten, which is not the case for the manual checks.

Update the code to use WX_IS_MACOS_AVAILABLE() macro, which expands to
__builtin_available() when supported, and also use API_AVAILABLE() where
it makes sense to avoid having too many checks.
2019-04-18 00:02:34 +02:00
Vadim Zeitlin
b53c516564 Add more wxOVERRIDE to avoid clang warnings
This fixes several thousands of -Winconsistent-missing-override warnings
given by Xcode 10 when building the library.
2019-04-17 19:05:31 +02:00
orbitcowboy
d82de6b5bf Fix a typo in wxWindow::CaptureMouse() comment
There are no functional changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1291
2019-04-16 02:04:56 +02:00
Maarten Bent
310b06402e Remove unused variable in wxSVGFileDC 2019-04-10 23:44:26 +02:00
Maarten Bent
b7bf6640ed Restore original wxSVGBitmapFileHandler behaviour
Save the embedded images in the same directory as the SVG file, not in the
runtime directory.
2019-04-10 23:41:58 +02:00
Maarten Bent
19c66c780d White-space only changes in wxSVGFileDC code 2019-04-10 23:37:34 +02:00
Paul Cornett
9511ab08f1 More use of wxOVERRIDE 2019-04-05 11:08:53 -07:00
Paul Cornett
794c1374b8 Remove unneeded overrides
These just forward to the base class
2019-04-05 10:54:54 -07:00
Paul Cornett
af1cf0a5f3 Use ctor-initializer rather than assignment for non-POD class members 2019-04-05 10:21:04 -07:00
Paul Cornett
1a90833839 Avoid 31-bit left shift of 32-bit signed values 2019-04-05 09:48:35 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
25e9be6873 Avoid binding reference to NULL pointer when wxUSE_VALIDATORS==0
Undefined behavior sanitizer complains about it
2019-04-04 10:56:14 -07:00
Vadim Zeitlin
9f95e86e76 Fix apparent activation loss after hiding previous popup
Commit 58d4b0e209 introduced a regression:
if a previous popup still existed when the new one was shown, dismissing
the second popup would result in the owner window losing its "active"
appearance.

This was due to the fact that ::GetActiveWindow() still returned the
former popup when it was about to be dismissed, so it was too early to
call it in WM_NCACTIVATE handler. Do it now in DismissOnDeactivate()
itself which is both simpler and more correct.
2019-04-02 18:13:27 +02:00
Vadim Zeitlin
58d4b0e209 Fix for showing multiple popups in a row in wxMSW
There were at least 2 problems when showing a transient popup while
another one was already shown in wxMSW, as could be seen by showing
several wxRichToolTips in a row from a timer event handler, for example:

First problem was that wxCurrentPopupWindow was incorrectly reset in
this case by the old popup window when it was hidden, even though it
should have been remaining set to the new popup window. Fix this by
checking that we only reset wxCurrentPopupWindow when hiding the popup
if it still points to this popup, but not if it has been changed to
point to another one in the meanwhile.

Second problem was more mysterious and resulted in simply not receiving
the activation events for the new popup when showing it resulted in
hiding the previous one. The working hypothesis is that hiding a window,
which changes activation on its own, from WM_NCACTIVATE handler in our
code confused ShowWindow(), which handles switching activation, which
didn't expect this to happen, so the fix is to avoid doing anything
immediately from this handler and wait until the next idle event to do
it instead.

These fixes ensure that showing several popups in a row works correctly,
i.e. hides the previous popup when a new one is shown and also keeps the
parent window appearing active during all the time and deactivates it if
the focus switches to another top level window at the end.
2019-03-30 04:11:46 +01:00
dasimx
a15004fc5f Fix handling display disconnection under wxMSW
Information about display cached in wxDisplayFactory::m_impls and in
wxDisplayFactoryMSW::m_displays could get out of sync after removing a
display from the system, resulting in failures when calling various
wxDisplay functions later.

To fix this, reuse InvalidateCache() to invalidate the cache in
wxDisplayFactoryMSW too, making it virtual in order to allow overriding
it there. Also call InvalidateCache() from wxDisplayFactoryMSW itself
instead of doing it from wxWindow, as this works even when the
application isn't showing any windows (and also keeps all
display-related code together).

Closes https://github.com/wxWidgets/wxWidgets/pull/1246
2019-03-29 23:19:59 +01:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

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

Closes #18294.
2019-03-29 19:16:40 +01:00
Paul Cornett
b8789b9d6f Fix drag move of wxMiniFrame under Wayland
Use gtk_window_begin_move_drag() instead of trying to do it manually
See #18372
2019-03-26 10:04:35 -07:00
Vadim Zeitlin
39380847da Avoid redundant declarations for wxQsort()
This works around gcc -Wredundant-decls warning that was given (if
explicitly enabled) when both wx/vector.h and wx/utils.h were included.

The workaround is ugly, but it doesn't seem worth it to introduce a
separate wx/qsort.h header just for this single function, which seems to
be the only other way to fix this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1271
2019-03-21 02:44:27 +01:00
New Pagodi
fe7b332b7b Regenerate STC files after recent changes 2019-03-20 00:15:44 -05:00
Vadim Zeitlin
626a96058f Fix clang -Winconsistent-missing-override when not using RTTI
In this case wx-specific RTTI is used and GetWxTypeId() method was
overridden without using wxOVERRIDE, which resulted in dozens of
warnings for each translation unit.
2019-03-19 02:12:01 +01:00
Vadim Zeitlin
6e949961ef Detect wxNO_RTTI automatically for clang too
This has been already done for gcc and MSVC, add clang-specific check as
well.
2019-03-19 02:10:53 +01:00
Vadim Zeitlin
1cdc0acfbe Merge branch 'stcxpm' of https://github.com/NewPagodi/wxWidgets
Improve XPM images handling in wxStyledTextCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1215
2019-03-18 22:36:25 +01:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

Closes https://github.com/wxWidgets/wxWidgets/pull/1257

Closes #18341.
2019-03-18 18:29:19 +01:00
exprosic
7a2d9d0d10 Fix compilation of MFC support code in MSVS conformance mode
Allow the code to be compilable with /permissive-, which is on by
default in VS2017.

Closes https://github.com/wxWidgets/wxWidgets/pull/1263
2019-03-18 18:11:42 +01:00
New Pagodi
f4e0c1aaee Regenerate wxSTC files after recent changes 2019-03-17 01:49:30 -05:00
Stefan Csomor
f163578c94 macOS expose scroll invertion in event
applied patch from #18358, thanks for the patch Andy
2019-03-12 12:22:41 +01:00
Artur Wieczorek
86af7d5ee9 Get rid of unnecessary overriding function
OnValidationFailure() in derived class wxEnumProperty has the same implementation (empty body) as the implementation in the base class wxPGProperty so overriding this function in derived class is not necessary.
2019-03-09 18:57:56 +01:00
Vadim Zeitlin
5a78b82673 Add support for passing nullptr to wx pseudo-vararg functions
Allow passing literal nullptr as an argument corresponding to "%p" in
the format string.

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

Closes #18355.
2019-03-09 01:14:31 +01:00
Paul Cornett
61d59dfc85 non-pch build fix 2019-03-06 08:49:05 -08:00
Vadim Zeitlin
d841f7b34e Merge branch 'wxQt-memory-leaks' of https://github.com/catalinr/wxWidgets
Fix many memory leaks in wxQt port.

See https://github.com/wxWidgets/wxWidgets/pull/1243
2019-03-05 23:36:41 +01:00
David Connet
c2c3096530 Detect MSVS 2019 in msvc/wx/setup.h correctly
_MSC_VER 1920 should be detected as MSVS 2019, which corresponds to 14.2
toolset value, rather than 14.1.
2019-03-05 23:28:20 +01:00
Vadim Zeitlin
f670cf2d29 Remove stray CR characters from msvc/wx/setup.h
See 46ba9ca2f9 which accidentally added
them.

No real changes.
2019-03-05 23:25:34 +01:00
Cătălin Răceanu
934698d8ac Change Qt smart pointers with wx ones to fix compilation 2019-02-27 22:06:47 +02:00
Cătălin Răceanu
1578240b6e Change a couple of data types and simplify code a bit 2019-02-27 17:42:01 +02:00
Cătălin Răceanu
113822d024 Change member variable type 2019-02-27 16:58:35 +02:00
Cătălin Răceanu
315a9460c0 Remove memory leaks by using smart pointers or explicit delete 2019-02-27 01:12:03 +02:00
Cătălin Răceanu
595a9945b5 Do not leak the list of panes 2019-02-26 23:13:12 +02:00
Paul Cornett
7c3ce912e0 Use ctor-initializer rather than assignment for non-POD class members 2019-02-25 10:23:35 -08:00
Paul Cornett
5e3c39043d Fix wxQT monolithic build on Linux
- Remove duplicate wxConsoleAppTraits::CreateEventLoop()
  It's already defined for Unix as well as Windows

- Remove wxEventLoop AddSourceForFD() "override"
  the base version is static and therefore clearly not meant to be overridden
2019-02-25 00:35:27 -08:00
Cătălin Răceanu
cb74819562 Don't leak QApplication and command line arguments 2019-02-24 23:45:46 +02:00
Vadim Zeitlin
7c8ba45705 Reuse helper MSWGetFittingtSizeForControl() in a couple of places
Refactor the code to reuse the same function for determining the size
needed by an embedded control in the toolbar, including its label.
2019-02-24 18:19:49 +01:00
Vadim Zeitlin
82857cfa9d Add small helper function to wxMSW wxToolBar code
Encapsulate the logic for deciding whether we should show the labels for
the embedded controls or not in a small helper function, to make it
simpler to change it in the future if needed and also to have a single
place to explain why do we do what we do now.

No real changes.
2019-02-24 02:04:55 +01:00
Cătălin Răceanu
0e3784c46e Implement support for value range in wxQt wxSpinButton
Closes https://github.com/wxWidgets/wxWidgets/pull/1237
2019-02-22 19:49:06 +01:00
Vadim Zeitlin
38d7ba21e2 Merge branch 'tglbtn' of https://github.com/catalinr/wxWidgets
Reimplement wxToggleButton correctly for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1228
2019-02-21 04:33:56 +01:00
Paul Cornett
1229ceb440 Remove unnecessary copy ctor/operator= definitions 2019-02-17 23:09:49 -08:00
Paul Cornett
7c75f46098 wxOVERRIDE 2019-02-17 22:42:26 -08:00
Paul Cornett
360342659b Remove unimplemented wxListBase ctor declaration 2019-02-17 18:26:17 -08:00
Paul Cornett
ad59df7355 Remove unuseable wxListBase ctor
It calls Append(void*), which calls the pure virtual CreateNode(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:19:16 -08:00
Paul Cornett
c41ff4e694 Remove unuseable wxPGArrayEditorDialog ctor
It calls Create(), which calls the pure virtual ArrayGetCount(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:00:26 -08:00
Cătălin Răceanu
be9c18cbd6 Reuse Qt implementation of normal button for toggle buttons 2019-02-13 01:23:20 +02:00
Cătălin Răceanu
7be9c8c670 Remove functions that are identical with the ones in base classes 2019-02-13 01:15:19 +02:00
Cătălin Răceanu
50edbf24cc Change the base class of wxBitmapToggleButton 2019-02-13 01:09:16 +02:00
Cătălin Răceanu
39c9992ec9 Remove declaration already present in common code 2019-02-13 00:58:54 +02:00
Cătălin Răceanu
193cf3fee9 Change the order of class declarations only 2019-02-13 00:55:00 +02:00
Catalin Raceanu
fb00507fb5 Implement image support for button states in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1224
2019-02-11 19:34:26 +01:00
Graham Dawes
6482664955 Fix build errors when building with gcc 2019-02-08 14:43:04 +00:00
Jay Nabonne
8844e16b03 Fix new header. 2019-02-08 14:03:32 +00:00
Jay Nabonne
b7ff45799c Clean up file. 2019-02-08 10:57:08 +00:00
Graham Dawes
57348b4a59 Add EditControl support for wxTreeCtrl under wxQT 2019-02-06 09:20:13 +00:00
Graham Dawes
cfe36f7ae7 Move wxQtTreeItemEditorFactory to its own header 2019-02-06 08:57:29 +00:00
Vadim Zeitlin
9a9ff29098 Remove redundant wxUSE_XXX checks from wx/filesys.h
These checks are already performed in wx/chkconf.h and don't need to be
redone here, especially incorrectly (testing for "!wxUSE_FILESYSTEM"
inside "#if wxUSE_FILESYSTEM" is useless).
2019-02-05 21:03:27 +01:00
Graham Dawes
2a91c00c10 Add missing d'tor 2019-02-05 16:13:56 +00:00
Graham Dawes
8efe01bd8e Implement basic styles for wxTreeCtrl under wxQT 2019-02-05 13:46:32 +00:00
Graham Dawes
308ef18a6d Start "native" implementation of wxTreeCtrl for wxQT 2019-02-05 13:23:12 +00:00
Graham Dawes
eb00d7623a Rename internal tree widget to something more appropriate for
a wxListCtrl.
2019-02-05 08:06:26 +00:00
Vadim Zeitlin
153b5e85fb Merge branch 'qt_combobox_crash' of https://github.com/GeoTeric/wxWidgets
Fix crashes when using wxCB_READONLY in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1221
2019-02-05 03:04:21 +01:00
Vadim Zeitlin
ddc550105e Merge branch 'qt-radio-groups'
Fix radio button grouping in Qt.

See https://github.com/wxWidgets/wxWidgets/pull/1212
2019-02-05 03:03:10 +01:00
Graham Dawes
a60c2470b5 Dedupe wxCB_READONLY check 2019-02-04 09:26:10 +00:00
Vadim Zeitlin
efa1e8f4ff Merge branch 'gc-from-unknown-dc'
Add wxGraphicsRenderer::CreateContextFromUnknownDC().

See https://github.com/wxWidgets/wxWidgets/pull/1213
2019-02-03 22:14:01 +01:00
Dan Gudmundsson
22fc3cff8f Use base implementation of dragAcceptFiles in wxOSX
As is done in wxGTK implementation.

Closes https://github.com/wxWidgets/wxWidgets/pull/1116
2019-02-02 22:43:14 +01:00
Vadim Zeitlin
8bbac921f3 Add wxGraphicsRenderer::CreateContextFromUnknownDC()
It seems wrong to have this function in wxGraphicsContext only and not
in wxGraphicsRenderer, as this makes it impossible to create a context
associated with a non-default renderer while it doesn't cost us anything
to allow doing this.
2019-02-02 21:22:19 +01:00
Vadim Zeitlin
9a7a89b7b2 Merge branch 'qt-convert-simplify'
Simplify Qt conversion functions and stop mapping wxPoint(-1,-1) and
wxSize(-1,-1) to QPoint(0,0) and QSize(0,0), respectively.

See https://github.com/wxWidgets/wxWidgets/pull/1206
2019-02-02 17:12:50 +01:00
chris2oph
f8c345ca95 Fix painting logic in wxQt wxClientDC implementation
The original drawing mechanism was generating lots of QWarning messages
when running samples (e.g. htlbox, caret, etc.) and in some cases was
not actually completely drawing every element of the sample. The issue
was that the QPicture was being shared incorrectly between wxWindow and
wxClientDC and attempts to start painting, update, etc. were generating
console warnings.

Closes https://github.com/wxWidgets/wxWidgets/pull/1152
2019-02-02 16:23:49 +01:00
Vadim Zeitlin
6370662cc8 Merge branch 'qt-dnd'
Initial drag-and-drop implementation for wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1205
2019-02-02 15:54:21 +01:00
Graham Dawes
f2d20384a0 Implement wxListCtrl::GetEditControl() for wxQt
To get access to the control used for editing items, we need to create
it ourselves, which involves defining our own factory for doing this,
but seems to be the only way of achieving our goal.

Closes https://github.com/wxWidgets/wxWidgets/pull/1204
2019-02-02 15:35:26 +01:00
Vadim Zeitlin
10b35c22f5 Remove unnecessary "protected:" from wx/qt/radiobut.h
No real changes, just remove an empty protected section.
2019-02-02 15:06:11 +01:00
Vadim Zeitlin
481b29e6ce Stop mapping QSize(0,0) to wxSize(-1,-1) as well
Do this for consistency with a similar recent change to wxPoint.
2019-02-02 14:24:16 +01:00
Vadim Zeitlin
1a9f0f8b8d Make trivial Qt <-> wx conversion functions inline
No real changes, just make often used and trivial functions inline as
this like an obviously better thing to do.
2019-02-02 14:24:16 +01:00
Vadim Zeitlin
5154cc711a Include QRect, QSize and QString from wx/qt/private/converter.h
Similarly to the previous commit, it doesn't seem to be worth it to
avoid including these simple and common headers from there and it
simplifies code and will allow making the converter functions inline.
2019-01-30 18:12:12 +01:00
Vadim Zeitlin
b0d88a306d Include wx/qt/private/converter.h from src/qt/converter.cpp
Follow standard practice and include the header corresponding to the
source file from it explicitly.

Also include wx/gdicmn.h from the header itself, this is a pretty common
header and there is no real advantage in avoiding it there and including
it allows to avoid a bunch of forward declarations.
2019-01-30 18:07:33 +01:00
Vadim Zeitlin
4d16029f8b Merge branch 'notebook-add-page-events'
Harmonize events sent by wxNotebook::AddPage(): they are now sent only
when adding any page except the first one if it is selected in all
ports.

See https://github.com/wxWidgets/wxWidgets/pull/1192
2019-01-30 17:38:51 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Matthew Griffin
ae94f4da9c Ensure that top level window is active when it's shown in wxQt
Under some (not totally clear) circumstances, a TLW can remain inactive
after being shown, which is undesirable, as it prevents setting focus to
its children from working.

Work around this by calling activateWindow() explicitly if necessary.

Closes https://github.com/wxWidgets/wxWidgets/pull/1179
2019-01-30 17:27:15 +01:00
Jay Nabonne
653979936b Clean up the code a bit to follow the guidelines, including handling of default in switches and line length. 2019-01-30 15:59:37 +00:00
Jay Nabonne
ece6626a59 Switch wxQt to use UTF-8 for text data transfer via wxDataObject. The result otherwise was less than useful. 2019-01-30 15:03:05 +00:00
Jay Nabonne
df38836862 Fixed some spacing. 2019-01-30 14:36:06 +00:00
Jay Nabonne
6fa65900f9 Implement cursor overriding for DnD on wxQt.
This uses the cursor variant (as opposed to the icon one) since these actually are cursors, the base class looks like cursors are meant to be used, and the icon thing looks like a hack.
2019-01-30 14:22:01 +00:00
Graham Dawes
c3b8b81da5 Remove unused includes from qt/window.h 2019-01-30 09:27:35 +00:00
Jay Nabonne
6ba6d9967a Change Qt wxDropTarget to remember widget and disconnect self when necessary. Clean up naming a bit. 2019-01-29 17:11:09 +00:00
Jay Nabonne
8c63c40953 Clean up wxDropTarget and wxWindow a bit more by moving DnD stuff fully into drop target (besides connecting and disconnecting).
Window doesn't have to know more than how to hook itself up.
Impl now performs function of event filter/adapter.
2019-01-29 16:55:31 +00:00
Jay Nabonne
2bceaaa572 Clean up wxDropTarget (first stage) by moving Qt specific stuff (e.g. QMimeData) into an Impl. 2019-01-29 16:29:58 +00:00
Jay Nabonne
323cbdabdb Implement initial try of wxDropTarget.
The drop target needs to use an event filter to capture drag-and-drop events from the window.
2019-01-29 16:13:41 +00:00
Graham Dawes
3cb395a5a5 Implement wxNotebook::DeleteAllPages() for wxQt
See https://github.com/wxWidgets/wxWidgets/pull/1191
2019-01-28 19:07:28 +01:00
Vadim Zeitlin
665b5a76a8 Remove unnecessary wxNotebook::DoSetSelection() from wxQt
Having this method didn't really help, it's simpler and more
straightforward to implement ChangeSelection() as a signal-blocking
wrapper around SetSelection() instead.

No real changes in behaviour, this is a pure refactoring.
2019-01-28 17:51:27 +01:00
Jay Nabonne
0dc1654ab6 Get simple (text) drag and drop case working with drop source.
We ended up not needing the underlying QMimeData-based implementation, as the classes sitting on top of it
bypassed it anyway. It now treats the hierarchy as a pure data storage mechanism, generating the
QMimeData when drag-drop is initiated.
2019-01-28 15:30:25 +00:00
Jay Nabonne
ea4c7120ff Fixed up and cleaned up Qt variant of wxDataFormat.
Kept "mime type" and "id" conceptually separate in the interface in case they need to diverge later.
Got rid of the odd "wxChar *" variants and the QString one.
Implemented unimplemented "type" functions.
Implemented "!=" in terms of "==", to keep from having two places to keep in sync.
2019-01-28 15:22:01 +00:00
Vadim Zeitlin
66727bf04b Merge branch 'wxradiobox' of https://github.com/MaartenBent/wxWidgets
Several wxRadioBox-related improvements:

- Fix its minimum width calculation to take the title into account.
- Remove unused nor useful wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM.
- Tidy up the radiobox page of the widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1187
2019-01-28 01:17:34 +01:00
New Pagodi
07f64c3b75 Add wxPU_CONTAINS_CONTROLS style for wxPopupWindow
This restores the default behavior of a popup window in MSW to the
behavior it had before 56c4191168. The new
flag added by this commit can be used to give the popup window the
behavior from after that commit, i.e. choose the implementation using a
WS_POPUP window rather than the default one using a WS_CHILD of the
desktop.

The old behavior kept the popup from taking focus from its parent window
but left some controls not working. The new behavior has the popup take
focus and lets all controls work.

Closes https://github.com/wxWidgets/wxWidgets/pull/1123
2019-01-28 00:48:16 +01:00
Tomay
8deb2cf0bb Add wxUSE_WINSOCK2 wxMSW option to include winsock2.h
Including <winsock.h> and <winsock2.h> is incompatible and if the
application wants to use the latter, it may be convenient to define
wxUSE_WINSOCK2 when building wxWidgets instead of having to work around
winsock.h implicit inclusion from include/wx/msw/wrapwin.h.

Closes https://github.com/wxWidgets/wxWidgets/pull/1122
2019-01-28 00:34:34 +01:00
Maarten Bent
a377f0e5f0 Get rid of wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM styles
This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead.
Do not remove them from the definitions, to not break user code.

Closes #18100.
2019-01-27 15:26:16 +01:00
Vadim Zeitlin
c74727c20f Merge branch 'qt_more_event_loop_improvements' of https://github.com/GeoTeric/wxWidgets
Event loop and idle events improvements for wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1171
2019-01-27 03:55:38 +01:00
ali kettab
84fc5c1714 Fix changing tooltip via wxToolTip::SetTip() in wxQt
Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.

Also implement wxToolTip::SetWindow().

Closes https://github.com/wxWidgets/wxWidgets/pull/1175
2019-01-25 14:39:37 +01:00
Liam Treacy
83f23cec89 Added virtual and override specifiers to derived method in ListCtrl 2019-01-24 14:31:17 +00:00
Graham Dawes
9cd566789d Added file missing from previous commit 2019-01-24 08:08:12 +00:00
phowstan
7cfb5b91a5 Implement wxStaticBox::Set/GetLabel() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1167
2019-01-23 16:38:25 +01:00
Vadim Zeitlin
2753bb2f50 Merge branch 'qt_event_loop' of https://github.com/GeoTeric/wxWidgets
Use QEventLoop for wxEventLoop implementation in wxQt to fix several
issues with wxEventLoop, notably avoid "QApplication::exec is already
running" errors.

See https://github.com/wxWidgets/wxWidgets/pull/1165
2019-01-22 19:05:53 +01:00
Liam Treacy
31c2bd7aa3 Add default parameter to wxDialog::Show() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1164
2019-01-22 15:49:44 +01:00
Vadim Zeitlin
6fbc7a7e16 Merge branch 'qt-region-fixes'
wxQt region-related fixes: fix bugs in clipping region handling and
add wxRegion::DoCombine().

See https://github.com/wxWidgets/wxWidgets/pull/1162
2019-01-22 15:46:19 +01:00
Vadim Zeitlin
8703f0c437 Merge branch 'qt-dropdown'
Make wxQt wxComboBox behave more consistently with the other ports. Also
includes related fixes to wxChoice and wxTextEntry.

See https://github.com/wxWidgets/wxWidgets/pull/1161
2019-01-22 15:45:03 +01:00
Graham Dawes
8a73f65285 Use QEventLoop to implement wxEventLoop for wxQT 2019-01-22 14:37:18 +00:00
Graham Dawes
7fa7fd1beb Don't generate idle events when the event loop is not running 2019-01-22 08:11:30 +00:00
Graham Dawes
278f4fa1d6 Add wxOVERRIDE to overriden methods 2019-01-22 08:11:30 +00:00
Vadim Zeitlin
26c9fd0033 Merge branch 'qt_listbox_failing_tests'
Fixes for item selection and cleanup.

See https://github.com/wxWidgets/wxWidgets/pull/1159
2019-01-21 23:43:56 +01:00
Vadim Zeitlin
c8f427181e Reuse code between wxListBox::Create() overloads
Add DoCreate() helper to actually create and initialize QListWidget.
2019-01-21 23:43:03 +01:00
Vadim Zeitlin
c28a8c9e7e Implement wxRegion operations in terms of DoCombine() 2019-01-21 23:34:12 +01:00
Jay Nabonne
5b8b30d243 Don't use pointer for wxDC::m_clippingRegion in wxQt
An object can be used directly instead.
2019-01-21 23:34:12 +01:00
Richard Smith
3618356cf1 Fix wxComboBox implementation of wxTextEntry interface
Implement missing methods and send, or suppress, the expected events.
2019-01-21 23:08:42 +01:00