Commit Graph

37327 Commits

Author SHA1 Message Date
Graham Dawes
331dc1fdfe Change wxFont::GetEncoding to return UTF8 for wxQt
QT doesn't have the concept of font encoding and is generally Unicode
aware throughout. The previous implementation of wxFont::GetEncoding for
wxQT returned a nonsensical value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1070
2018-12-12 18:13:54 +01:00
Graham Dawes
6c5c9e578b wxCarioContext:Flush now draws back to the QT image
wxCairoContext::Flush was flushing back to the internal image but this
image wasn't drawn back to the QPainter until the wxCarioContext
instance was destroyed.

This fix ensure that after a call to Flush, anything drawn by Cario is
drawn back to the QImage.

Closes https://github.com/wxWidgets/wxWidgets/pull/1068
2018-12-12 18:12:36 +01:00
Liam Treacy
e7260cffe0 Fix wxRadioBox::Show() behaviour in wxQt
If a QGroupBox is not visible, then you cannot set any of items to be
visible. Update the implementation to match that expected by wx.

Closes https://github.com/wxWidgets/wxWidgets/pull/1065
2018-12-12 03:23:24 +01:00
Liam Treacy
418a1b747e Select first item of wxRadioBox by default in wxQt too
Follow the other ports and select the first radio box item when it's
created, to ensure that it always has selection.

See https://github.com/wxWidgets/wxWidgets/pull/1065
2018-12-12 03:21:17 +01:00
Liam Treacy
2a64b65149 Fix enabling radiobox buttons in wxQt
If a QGroupBox is disabled, then you cannot set any of its items to be
enabled without first enabling it. Enabling/disabling it will set that
value (true/false) on all of its items, although setting the QGroupBox
to an enabled state which it already has does not result in this
behaviour.

Fix wxQt to match the expected wxRadioBox behaviour and allow the unit
test to pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1064
2018-12-10 19:52:22 +01:00
Liam Treacy
91a87e765b Don't omit "int" in wxQt wxRadioBox::GetCount() signature
No real changes, just use "unsigned int" instead of just "unsigned".

See https://github.com/wxWidgets/wxWidgets/pull/1064
2018-12-10 19:51:52 +01:00
Stefan Ziegler
0c2956be09 Fix wxInfoBar close button size in high DPI
Don't apply the scaling factor twice when dynamically creating the close
button bitmap.

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

Closes #18283.
2018-12-10 19:48:04 +01:00
Graham Dawes
611f678b51 Implement of wxFontEnumerator::EnumerateFacenames() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1056
2018-12-10 19:25:21 +01:00
Sebastian Walderich
ab1fd56977 Implement wxAuiNotebook::HitTest()
Check if point is on window or a certain tab.

Closes https://github.com/wxWidgets/wxWidgets/pull/1059
2018-12-09 15:52:30 +01:00
Vadim Zeitlin
089eeea3ef Fix wxMSW build with wxUSE_UXTHEME==0
Make wxUxThemeIsActive() available even in this case to fix compilation
in some places and add the unavoidable preprocessor checks in other
ones.

Closes #18207.
2018-12-08 20:24:05 +01:00
oleksii.vorobiov
fd5c62bc41 Make updating the value in wxEVT_SPINCTRL work in wxMSW
In wxMSW, the value of the control was modified after executing the
user-defined wxEVT_SPINCTRL handler which meant that any calls to
SetValue() there were effectively ignored.

Fix this and add a unit test checking for the described scenario.

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

Closes #18187.
2018-12-08 19:51:56 +01:00
Vadim Zeitlin
1cc6aabe09 Merge branch 'dvc-edit-right-click'
Stop editing when right mouse button is pressed in wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1052
2018-12-08 00:52:47 +01:00
Vadim Zeitlin
b12f391514 Merge branch 'gcdc-without-display'
Make it possible to use wxGCDC without a display.

See https://github.com/wxWidgets/wxWidgets/pull/1044
2018-12-08 00:51:33 +01:00
Graham Dawes
84f788ff89 Implement missing wxTopLevel methods for wxQt
This allows the unit test wxPersistTLW to pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1055
2018-12-08 00:50:27 +01:00
Vadim Zeitlin
b5944a0730 Fix wxAUI build with wxUSE_MDI==0
Include wx/frame.h explicitly as it's not included by wx/aui/tabmdi.h in
this case.

Closes #18291.
2018-12-08 00:47:03 +01:00
Vadim Zeitlin
0e9d190878 Fix wrong Release() call in the previous commit
The last commit had a bad bug as it called Release() on a wrong pointer.

Also use "0x" prefix for hexadecimal numbers and not "0X".

See https://github.com/wxWidgets/wxWidgets/pull/678
2018-12-07 16:19:10 +01:00
ashishmore
87bd82ab6f Fix wxMediaCtrl::SetPosition() in MSW WMP backend
Step the control one frame forward to actually show the frame at the
given position, otherwise the control only showed black screen.

Closes https://github.com/wxWidgets/wxWidgets/pull/678
2018-12-07 15:18:05 +01:00
chris2oph
3e79f903b4 Make wxListBox::SetString() actually work in wxQt
Do set the string on QListWidgetItem.

Closes https://github.com/wxWidgets/wxWidgets/pull/1047
2018-12-07 14:55:16 +01:00
jwiesemann
3d75541662 Fix bug in template selection in docview framework
Don't use the template specified by the filter in the file open dialog
if it's incapable of actually handling the current file.

This fixes a regression compared to 2.8 in docview code and allows
opening a file using the correct template for its extension even if an
incorrect (e.g. default) filter is chosen in the file open dialog.

Closes #18123.
2018-12-07 03:34:21 +01:00
Liam Treacy
effdec75bd Fix crash when changing wxQt wxScrollBar position
wxScrollBar::SetScrollbar() now blocks the signals of QScrollBar before
setting a value, which avoids behaviour where slots are called before
the QScrollBar is displayed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1050
2018-12-07 00:34:28 +01:00
Vadim Zeitlin
1ca3e264be Merge branch 'qt-listbox'
Closes https://github.com/wxWidgets/wxWidgets/pull/1049
2018-12-07 00:33:09 +01:00
Liam Treacy
10381cb94e Deselect all items in wxQt wxListBox::SetSelection(wxNOT_FOUND)
Follow wxWidgets API convention in wxQt too.
2018-12-07 00:33:01 +01:00
Liam Treacy
1f0e456620 Implement wxListBox::GetSelections() in wxQt 2018-12-07 00:32:58 +01:00
Liam Treacy
fd8248762e Add support for wxLB_SORT to wxListBox in wxQt 2018-12-07 00:32:52 +01:00
Jay Nabonne
82a66e56b2 Fix possible usage of uninitialized variable in wxQt wxDC code
Make sure rasterColourOp is always initialized, even if none of the
switch cases matches, to avoid warnings about possibly uninitialized
variable.

See https://github.com/wxWidgets/wxWidgets/pull/1048
2018-12-07 00:11:56 +01:00
Jay Nabonne
194936ab26 Fix doubly-qualified namespace in wxQt wxDC code
Avoid (almost certainly accidentally) repeating "QPainter::".

See https://github.com/wxWidgets/wxWidgets/pull/1048
2018-12-07 00:11:01 +01:00
Vadim Zeitlin
dc1aa3097c Avoid warnings on right click in GTK wxDataViewCtrl while editing
The code handling right button click used the path of the item under
mouse without checking if there was any item, resulting in GTK+ warnings
due to the use of an invalid item.

Simply add a check for the item validity: we definitely don't want to
select it if it's invalid anyhow.
2018-12-06 22:55:42 +01:00
Vadim Zeitlin
da612f02b5 Stop editing in generic wxDataViewCtrl when any button is pressed
Previously, the editor was hidden if the left mouse button was pressed,
but not for the right (or any other) button, which could result in a
confusing situation when a user could select a command from a context
menu shown from the corresponding event handler and start editing
another item while the current one was still being edited too.
2018-12-06 22:53:28 +01:00
Vadim Zeitlin
2d18aaf58a Move check for mouse button down events in wxDataViewMainWindow
No real changes, just prepare for the next commit.
2018-12-06 20:48:32 +01:00
Vadim Zeitlin
507e331eb1 Improve creating wxGCDC from an existing wxGraphicsContext
Avoid creating a default wxGraphicsContext unnecessarily, only to
immediately delete it and replace it with the provided one.

This was at best unnecessary and at worst resulted in a crash if the
default context couldn't be created, as happened on a headless system
(where wxImage-based wxGraphicsContext can still be created
successfully).
2018-12-06 03:40:49 +01:00
Vadim Zeitlin
54e9150157 Remove redundant wxDFBDCImpl::m_mm_to_pix_[xy] members
The base class already has exactly the same members, so just use them
instead.

No real changes, just avoid (or at least reduce) confusion.
2018-12-06 03:30:55 +01:00
Vadim Zeitlin
3dc16a7419 Compute wxDCImpl::m_mm_to_pix_[xy] on demand
If nothing else, this avoids 2 calls to each of wxGetDisplaySize() and
wxGetDisplaySizeMM() on each and every wxGCDC construction which are
completely unnecessary as wxGCDCImpl uses its own hardcoded resolution
of 72 DPI, as do some other classes deriving from wxDCImpl.

And even for the classes which do compute these fields using the display
resolution, it may still be unnecessary to do it as they can be never
used if neither GetSizeMM() nor SetLogicalScale() are called on the
corresponding wxDC object.

Finally, this is more than an optimization as when using Cairo-based
wxGCDC without display (which is explicitly supported), calling
wxGetDisplaySize() simply doesn't work at all.
2018-12-06 03:30:55 +01:00
Stefan Ziegler
e1a702a205 Fix removing and inserting pages in wxToolbook
Removing a page from wxToolbook could result in crashes due to
dereferencing the now invalid page index. Fix this by not assuming that
the page index is the same as its tool ID, but adding functions to
explicitly map one to the other.

Also fix inserting pages into wxToolbook, which worked as appending them
before.

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

Closes #18275.
2018-12-05 17:23:57 +01:00
Liam Treacy
729295d02f Set wxGauge initial value correctly in wxQt
The default value of QProgressBar is -1, while wxGauge initial value
must be 0, so set it explicitly to fix a unit test failure with wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1043
2018-12-05 17:19:13 +01:00
Tomay
f271cc61e8 Fall back on default margins if the theme doesn't provide them
::GetThemeMargins() may fail if the custom theme being currently used
doesn't implement the required functionality, so initialize MARGINS with
some reasonable values before calling it, if only in order to avoid
using uninitialized (and so wildly wrong) margin values in this case.

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

Closes #18278.
2018-12-05 03:12:34 +01:00
Vadim Zeitlin
ce45edcc51 Merge branch 'cmake-linux' of https://github.com/MaartenBent/wxWidgets
Various CMake checks improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1037
2018-12-05 03:09:36 +01:00
Liam Treacy
928b00ad55 Fix setting initial value of wxSpinCtrl in wxQt
When creating a QSpinBox, the range must be set before setting the
initial value as otherwise setting it would fail if it were outside of
the default [0, 99] range.

This fixes a test failure in the corresponding unit test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1041
2018-12-05 03:05:27 +01:00
Liam Treacy
94a58121f7 Fix crash on setting the accelerator table in wxQt
Check whether m_qtShortcuts is non-null before dereferencing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1040
2018-12-05 03:04:17 +01:00
Liam Treacy
5e089badc0 Fix bitmap accessor for the buttons in wxQt
Return the bitmap previously set with SetBitmap().

This fixes unit tests using GetBitmap().

Closes https://github.com/wxWidgets/wxWidgets/pull/1035
2018-12-05 03:00:49 +01:00
Liam Treacy
29f771ab82 Add support of wxFONTSTYLE_SLANT to wxFont in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1034
2018-12-05 02:57:40 +01:00
Liam Treacy
16c121d4d3 Implement [GS]etLabel() for wxStaticText and wxCheckBox in wxQt
This allows the corresponding unit tests to pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1033
2018-12-05 02:55:54 +01:00
Vadim Zeitlin
7e22ddd27c Merge branch 'qt_menubar' of https://github.com/GeoTeric/wxWidgets
Improve radio menu items support in wxQt and make the menu unit tests
pass for it, although some of them had to be disabled.

See https://github.com/wxWidgets/wxWidgets/pull/1030
2018-12-05 02:53:37 +01:00
Daniel Collins
4726819484 Rotate wxNotebook tabs label under wxGTK to match other ports
wxMSW and wxOSX/Cocoa show the labels vertically for the tabs positioned
on the left- or right-hand side of wxNotebook, but wxGTK showed them
horizontally.

Bring it in sync with the other ports by rotating the labels to draw
them vertically as the other ports do in wxGTK too.

Closes https://github.com/wxWidgets/wxWidgets/pull/1032
2018-12-05 02:48:45 +01:00
Daniel Kulp
727a100a6a Handle wxEVT_SYS_COLOUR_CHANGED in wxAUI classes
Update the colours used when the system theme changes.

This is especially important to use the colour scheme compatible with
macOS 10.14+ dark mode.

Note that this commit is best viewed with "git diff --color-moved".

Closes https://github.com/wxWidgets/wxWidgets/pull/916
2018-12-03 19:48:32 +01:00
Stefan Ziegler
974b7c0990 Add wxToolbook::EnablePage()
Add functions to enable or disable pages inside wxToolbook.

Using the new functions you can present disabled icons so that the user
can expect more functionality and you do not need to add/remove pages in
different states.

Closes https://github.com/wxWidgets/wxWidgets/pull/1038
2018-12-03 19:42:45 +01:00
Stefan Csomor
58f3dcf780 fixing macOS sound crash
make sure no completion call gets triggered after this point
2018-12-03 14:42:27 +01:00
Maarten Bent
97f64e9941 CMake: Build the webextensions plugin 2018-12-02 03:23:02 +01:00
Maarten Bent
2f78849d24 Fix build without precompiled headers 2018-11-26 23:51:40 +01:00
Maarten Bent
3bab07edcf Fix some build warnings
private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
2018-11-25 21:29:38 +01:00
Maarten Bent
bcf53d6b96 Fix extra semicolon warnings 2018-11-25 21:29:37 +01:00