Commit Graph

18121 Commits

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