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
Vadim Zeitlin
37f7da858d
Merge branch 'qt-painter-fixes'
...
Fixes for measuring text extent and improve/simplify ownership in
wxQtGraphicsContext.
See https://github.com/wxWidgets/wxWidgets/pull/1160
2019-01-22 15:43:45 +01: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
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
Richard Smith
1a7f9124b6
Update insertion point in wxTextEntry::Remove()
...
Move the insertion point to the end of the string if its position has
become invalid after removing part of the text.
2019-01-21 23:08:07 +01:00
Richard Smith
b0defd5876
Don't select the newly added item in wxChoice
2019-01-21 23:08:07 +01:00
Richard Smith
f2538a0bc4
Reset selection in after deleting selected item from wxChoice
2019-01-21 23:08:07 +01:00
Vadim Zeitlin
cfdf80d586
Rename wxChoice::InitialiseSort() to QtInitSort()
...
Use the prefix to indicate that this function is unique to this port.
Also don't make unnecessarily make it virtual.
2019-01-21 23:08:07 +01:00
Richard Smith
b27971c501
Use case-insensitive comparison in Qt wxComboBox and wxChoice
...
Define LexicalSortProxyModel to use the same sort order in wxQt as in
the other ports.
2019-01-21 23:08:07 +01:00
Vadim Zeitlin
000f8ef422
Put private wxQtChoice class inside an anonymous namespace
...
No real changes, just avoid polluting global scope unnecessarily.
2019-01-21 20:06:31 +01:00
Vadim Zeitlin
21e989751f
Get rid of m_ownsPainter flag in wxQtGraphicsContext
...
Use wxScopedPtr to ensure that the pointer is destroyed automatically
instead of doing it manually.
2019-01-21 19:44:05 +01:00
Vadim Zeitlin
8434adb00e
Use AttachPainter() instead of setting m_ownsPainter directly
...
No real changes, just another tiny simplification.
2019-01-21 19:40:22 +01:00
Vadim Zeitlin
6d91374dff
Simplify QPainter ownership in wxQtGraphicsContext
...
No real changes, just refactor the code to use more explicit
AttachPainter() when giving ownership of a new QPainter object to
wxQtGraphicsContext.
This method also allows to simplify wxQtImageContext as it doesn't need
to handle ownership on its own and can just leave it to the base class.
And m_ownsPainter can now be made private.
2019-01-21 19:40:11 +01:00
Jay Nabonne
b991dc9d5a
Fix using inactive painter when getting text extent
...
Ensure that the painter is active before using it.
2019-01-21 19:31:30 +01:00
Jay Nabonne
a5174c7483
Don't use desktop in wxQtMeasuringContext
...
This doesn't work, so create a new QPainter instead.
2019-01-21 19:20:57 +01:00
Vadim Zeitlin
613513501b
Merge branch 'qt_dialog_show_modal' of https://github.com/GeoTeric/wxWidgets
...
Fix several issues with modal dialogs in wxQt and make them work more
consistently with the other ports.
See https://github.com/wxWidgets/wxWidgets/pull/1155
2019-01-21 19:10:00 +01:00
Vojtech Kral
63432e5ef5
Fix wxShowEvent not being received for maximized frames on MSW
...
Send wxEVT_SHOW explicitly when showing a maximized TLW under MSW as the
system doesn't send WM_SHOW in this case (as documented in the MSDN and
also confirmed by testing).
Closes https://github.com/wxWidgets/wxWidgets/pull/1153
2019-01-21 18:38:46 +01:00
Liam Treacy
a2356fbe4a
Made the wxListBox::GetSelection method more efficient
2019-01-21 16:16:17 +00:00
Liam Treacy
d8d7f673b2
Added comment explaining style mutual exclusive flags
2019-01-21 16:02:03 +00:00
Liam Treacy
ab3c460a93
Updated the GetSelections method to use QListWidget method to retrieve selected items rather than iterating through the list. Also updated the UnSelectAll method to be more efficient
2019-01-21 16:00:03 +00:00
Liam Treacy
ffcda97d04
wxListBox GetSelection and DoSetSelection now use the proper QListWidget interface for specifying which index is selected.
2019-01-21 15:48:12 +00:00
Liam Treacy
eb6b660d27
Added setStyle method to wxListBox to allow for the proper setting of sorting and selection style of the QListWidget
2019-01-21 14:04:47 +00:00
Graham Dawes
9cfecad878
Generate wxDialogInit event for wxDialog under wxQT
2019-01-21 13:53:59 +00:00
Graham Dawes
467bb0ec66
Add WX_HOOK_MODAL_DIALOG for wxMessageDialog under wxQT
2019-01-21 13:53:14 +00:00
Graham Dawes
26cba3bcf9
Add missing WX_HOOK_MODAL_DIALOG to wxDialog::ShowModal for wxQT
2019-01-21 12:50:36 +00:00
Artur Wieczorek
e4198c149b
Allow entering plus/minus characters for floating point numbers
2019-01-20 18:41:05 +01:00
Artur Wieczorek
4b0d74e04d
Create wxPGHeaderCtrl in one step
...
Code simplification - 2-step creation is useless here.
2019-01-20 18:32:48 +01:00
Artur Wieczorek
547db34ce4
Don't allow reordering wxPropertyGrid header columns
...
wxPropertyGrid is designed to work with fixed order of columns.
2019-01-20 18:27:03 +01:00
Artur Wieczorek
4c9684f8d1
Improve calculating wxSimpleCheckBox rectangle
...
The code to calculate rectangle occupied by the check box is moved to the shared function GetBoxRect().
Check box rectangle is stored in the data member and this cached position and size are used in the drawing operations and hit tests.
2019-01-20 18:21:30 +01:00
Artur Wieczorek
9ff9442226
Update column width in wxHeaderCtrlSimple while resizing the column
...
In EVT_HEADER_RESIZING event handler there is necessary to update actual
column width and redraw the control to show the column with new width.
Closes #18331 .
2019-01-20 13:22:50 +01:00
Artur Wieczorek
3000091cd2
Allow columns reordering only if its wxCOL_REORDERABLE flag is set
...
Dragging the column should be allowed only if wxHD_ALLOW_REORDER header
style and wxCOL_REORDERABLE column flag are both set.
Closes #18332 .
2019-01-20 13:22:03 +01:00
Vadim Zeitlin
704f03e70e
Don't use destroyed wxToolBar in wxFrame::SetToolBar() in wxQt
...
Store QToolBar pointer in wxFrame itself to avoid having to query the
already half-destroyed wxToolBar object when SetToolBar() is called from
its base class dtor.
This fixes crash when toggling the toolbar in the toolbar sample.
Closes https://github.com/wxWidgets/wxWidgets/pull/1140
2019-01-20 03:21:12 +01:00
Vadim Zeitlin
61b391da90
Make wxFrame ctors inline in wxQt
...
No real changes, just make trivial (and going to remain trivial)
functions inline.
2019-01-20 03:13:04 +01:00
Vadim Zeitlin
5b36917548
Fix harmless -Wsign-compare gcc warnings in wxQt wxStatusBar code
...
QList::count() returns int, so cast it to size_t explicitly before
comparing with wxArray::GetCount() which returns size_t.
2019-01-20 03:01:51 +01:00
Vadim Zeitlin
5bb683bcfe
Fix harmless -Wunused-parameter warnings in wxQt code
...
Note that other such warnings remain where they indicate important
missing functionality (notably in wxCairoContext ctor from wxPrinterDC).
2019-01-20 02:59:46 +01:00
Vadim Zeitlin
f20180e743
Avoid -Wswitch gcc warning in wxQt wxNativeFontInfo::SetStyle()
...
Explicitly handle wxFONTSTYLE_MAX, even if it's just to assert that it's
unexpected here.
2019-01-20 02:57:45 +01:00
jtbattle
30f9d60eec
Fix ability to replay wxSound sample on OSX
...
The sound handle was returned to the OS after the first play completed
(or the loop first stopped), making it impossible to replay that sound
again.
Now the handle is returned upon destruction of the wxSound object.
Closes https://github.com/wxWidgets/wxWidgets/pull/1149
2019-01-19 23:17:25 +01:00
Konstantin S. Matveyev
557b8526d1
Fix several problems with wxAppProgressIndicator in wxOSX
...
Don't release NSProgressIndicator too soon, we need to be able to keep
it to use it later, so move "release" from wxAppProgressDockIcon ctor to
its dtor.
OTOH, remove an extraneous "retain" to fix memory leak of
wxAppProgressDockIcon.
Finally, show the indicator, if it had been hidden, when Pulse() is
called for consistency with SetProgress().
Closes https://github.com/wxWidgets/wxWidgets/pull/1150
2019-01-19 23:13:02 +01:00
Vadim Zeitlin
d3ab6a9968
Merge branch 'qt_toolbar_area' of https://github.com/GeoTeric/wxWidgets
...
Use only a single position style for QToolBar and minor cleanup in the
related code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1145
2019-01-19 23:04:23 +01:00
Graham Dawes
57c12db2d9
Fix GetColumnCount() not working for wxRadioBox in wxQt
...
Add missing SetMajorDim() call to wxRadioBox::Create().
Closes https://github.com/wxWidgets/wxWidgets/pull/1144
2019-01-19 23:03:14 +01:00
Liam Treacy
d9dd8b1f1a
Grouped related headers together
2019-01-18 11:30:43 +00:00
Liam Treacy
ccfec32eb9
In wxFrame::SetToolBar, only one style will now be applied to the QToolbar
2019-01-18 11:00:55 +00:00
Vadim Zeitlin
c575f595f5
Merge branch 'qt_fix_radiobox_layout' of https://github.com/GeoTeric/wxWidgets
...
Add support for grid layout for wxRadioBox under wxQt.
See https://github.com/wxWidgets/wxWidgets/pull/1136
2019-01-18 01:14:33 +01:00
Artur Wieczorek
715b25aaf3
Allow columns reordering only if wxHD_ALLOW_REORDER style is set
...
Dragging the column should be allowed only if wxHD_ALLOW_REORDER style
is set.
Closes #18329 .
2019-01-17 23:37:49 +01:00
Jay Nabonne
1d117b75f7
Add wxGraphicsContext implementation for wxQt
...
Add graphics renderer using Qt classes and use it by default in wxQt
port under MSW.
Closes https://github.com/wxWidgets/wxWidgets/pull/1139
2019-01-17 00:50:47 +01:00
Vadim Zeitlin
8571cfed2f
Remove unnecessary RECT initialization in WM_NCCALCSIZE handler
...
No real changes, just make RECT (lack of) initialization before calling
GetThemeBackgroundContentRect() consistent between WM_NCCALCSIZE and
WM_NCPAINT handlers.
See https://github.com/wxWidgets/wxWidgets/pull/1141
2019-01-16 22:11:15 +01:00
Vadim Zeitlin
712e3652ff
Deal with themes not implementing GetThemeBackgroundContentRect()
...
Some custom themes apparently don't implement this function at all and
just return failure error code from it, but our code either assumed that
it never failed (when handling WM_NCPAINT) or didn't handle its failure
correctly (when handle WM_NCCALCSIZE the client rect wasn't returned at
all to the system in this case).
Fix this by just falling back to the initial rectangle in case of
failure.
2019-01-16 01:52:37 +01:00
Vadim Zeitlin
d47dbe9faa
Take into account enabled state when drawing themed borders
...
Pass ETS_DISABLED instead of ETS_NORMAL when the window is disabled.
2019-01-16 01:52:10 +01:00
Vadim Zeitlin
78072514e9
Simplify setting nState in WM_NCPAINT handler
...
No real changes, this is just a trivial simplification removing some
unnecessary and unused commented out code.
2019-01-16 01:46:34 +01:00