Commit Graph

37297 Commits

Author SHA1 Message Date
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
Maarten Bent
eb23d4735c Fix unannotated fall-through warnings 2018-11-25 21:29:37 +01:00
Maarten Bent
39ff5b90e5 Replace wxDeprecatedGUIConstants enum values 2018-11-25 21:29:32 +01:00
Maarten Bent
86c49283f5 Remove trailing spaces 2018-11-25 20:22:25 +01:00
Cătălin Răceanu
74f60d90a6 Update src/qt/menuitem.cpp
Co-Authored-By: evileye-uk <evileye@telperion.co.uk>
2018-11-22 12:38:29 +00:00
Richard Smith
902ce48189 Remove duplicated code. 2018-11-22 10:35:40 +00:00
Richard Smith
82f8fad240 Split out test which will not work on QT, and fix insertion behaviour of radio menu items. 2018-11-22 10:22:39 +00:00
Richard Smith
bfad2a5425 Fix menu first radio button state and synchronise state changes. 2018-11-21 16:02:33 +00:00
Richard Smith
6b7b43d1fe Get WxQt menu titles passing GUI tests 2018-11-21 12:58:23 +00:00
Vadim Zeitlin
1567632974 Merge branch 'msw-art-big-icons'
Add support for big icons to the MSW art provider.

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

Closes #18248.
2018-11-20 17:58:19 +01:00
oneeyeman1
1c06a62830 Implement dropdown and popup events for wxComboBox on Qt
Closes https://github.com/wxWidgets/wxWidgets/pull/1005
2018-11-20 17:38:36 +01:00
Vadim Zeitlin
ea28f00cb8 Do load SHDefExtractIcon() during run-time for old MinGW
The problem with MinGW 5.3 is not just due to the missing function
declaration in the header, but also due to the function missing from
libshell32.a import library, so we do need to load it during run-time,
contrary to what the comment in the previous commit said.

This should finally fix MinGW build.
2018-11-20 15:29:43 +01:00
Vadim Zeitlin
a1adc2efa4 Merge branch 'textctrl_qt' of https://github.com/oneeyeman1/wxWidgets
Implement support for wxTE_PASSWORD and MarkDirty()/DiscardEdits() in
wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1026
2018-11-20 14:13:45 +01:00
oneeyeman1
add8e8804b Follow up with the PR comments 2018-11-20 05:51:29 -05:00
Vadim Zeitlin
99247910b9 Declare SHDefExtractIcon() if it's missing from (MinGW) headers
At least the MinGW 5.3 used for AppVeyor builds doesn't declare this
function, so provide its declaration ourselves to fix MinGW build after
the recent changes.
2018-11-19 16:14:58 +01:00
oneeyeman1
a245c0af1e Implement modification flag on text control for wxQt 2018-11-18 23:40:05 -05:00
oneeyeman1
f790ccee6f Implement Password style for text control under wxQt 2018-11-18 23:19:45 -05:00
Vadim Zeitlin
3169524864 Don't destroy the HICON returned by SHDefExtractIcon() twice
Surprisingly, this doesn't seem to result in any ill effects, but
passing HICON to wxIcon already ensures that this HICON will be
destroyed in wxIcon dtor, so we shouldn't call ::DestroyIcon() on it
manually.
2018-11-18 23:10:07 +01:00
Vadim Zeitlin
8e740c69cd Initialize icon using InitFromHICON() instead of CreateFromHICON()
The former avoids an unnecessary call to ::GetIconInfo() done by the
latter to retrieve the icon size, as we already have the size here.
2018-11-18 23:09:01 +01:00
Vadim Zeitlin
262124ca1b Remove unnecessary bitmap size check in wxWindowsArtProvider
This "sizeNeeded" is always fully specified as we explicitly use a
fallback size if the input size wasn't, so there is no need for checking
this.
2018-11-18 22:47:29 +01:00
Vadim Zeitlin
49d8491518 Refactor the code to use a wrapper for SHDefExtractIcon()
Avoid duplicating the same code in MSWGetBitmapForPath() and
CreateBitmap().

This also incidentally fixes SHDefExtractIcon() return value check,
which was inverted, in MSWGetBitmapForPath().
2018-11-18 22:43:17 +01:00
Markus Juergens
8698d69c77 Return the best-sized icons from wxWindowsArtProvider
Use SHDefExtractIcon() to retrieve the most appropriately-sized icon
instead of always getting either the small or the large icon and then
scaling it ourselves to make it of the right size.

This results in incomparably better results for large icon sizes, e.g.
256*256, as can be seen in the artprov sample.
2018-11-18 22:34:40 +01:00
Markus Juergens
880b2b0a46 Use icons of correct sizes for wxART_FOLDER in wxMSW
Don't restrict the sizes to just small or large icons but extract the
icon closest to the requested size using SHDefExtractIcon().
2018-11-18 21:16:00 +01:00
Markus Juergens
d5cd939db7 Use native art for PRINT and XXX_FILE art IDs under MSW
These art IDs have natural native equivalents, so do use them.
2018-11-18 20:58:57 +01:00
imReker
bdca91c629 Fix i18n URL parsing problem in wxWebViewArchiveHandler
URL is encoded as UTF-8, so using c_str() may generate invalid encoded
representation in non-UTF-8 locales.

Closes https://github.com/wxWidgets/wxWidgets/pull/1022
2018-11-18 20:42:16 +01:00
Vadim Zeitlin
20b02d6169 Rename new wxTranslations method to GetAcceptableTranslations()
This name seems to be more precise than a very generic "all good" one
used previously.
2018-11-18 01:47:12 +01:00
Lauri Nurmi
2d784da2ee Load catalogs for all preferred languages, if they exist
This way the first and only fallback language isn't necessarily the
msgid language (which is English most often). This is how GNU gettext
works -- it uses multiple fallback languages when multiple preferred
languages are set.

As a side effect, fixes #18227 in one possible way.
2018-11-18 01:47:12 +01:00
Lauri Nurmi
5d08e404c7 Allow getting all usable translations languages
Add a method to return the full list of translations that can be used,
generalizing the existing GetBestTranslation().
2018-11-18 01:47:12 +01:00
Vadim Zeitlin
8dbebf9164 Merge branch 'update_submodules' of https://github.com/MaartenBent/wxWidgets
Update all 3rd party libraries to the latest versions.

See https://github.com/wxWidgets/wxWidgets/pull/1023
2018-11-18 01:00:13 +01:00
Maarten Bent
aa8ce7acb1 Include minor version in jpeg library version info 2018-11-17 19:08:42 +01:00
Maarten Bent
ec4b71afa0 Update tiff submodule
Add the new files to the build system. Disable support for webp and zstd
because we do not want to depend on external libraries.
2018-11-17 19:08:40 +01:00