Commit Graph

39762 Commits

Author SHA1 Message Date
Maarten Bent
487a3854a3 Fix building stc library with WXQT
When using MSVC compiler, wxUSE_GRAPHICS_DIRECT2D is automatically enabled in setup.h.
But it is only available with WXMSW toolkit, not WXGTK or WXQT.
2018-09-30 17:23:58 +02:00
Maarten Bent
8f017509f6 Remove wxConsoleEventLoop from WXQT
The console event loop in the wxBase library is GUI toolkit independent.
2018-09-30 17:23:58 +02:00
Maarten Bent
f5b4d707b8 Do not use variable-length array in WXQT wxRegion
This is not supported by MSVC compiler.
2018-09-30 17:23:58 +02:00
Vadim Zeitlin
c98d504b6d Implement wxDisplay::GetClientArea() for wxQt too
This is as simple as implementing GetGeometry(), so just do it.
2018-09-30 17:07:14 +02:00
Vadim Zeitlin
771e01cc73 Remove unnecessary trivial wxDisplayFactoryQt default ctor
No real changes, just remove useless lines.
2018-09-30 17:03:22 +02:00
Vadim Zeitlin
990c8bfd73 Cache wxDisplayImpl object for faster access
Avoid a heap allocation on every wxDisplay creation by caching the
wxDisplayImpl objects once they're created.

Currently we never invalidate the cache, but we should add a way to do
it in the future.

This speeds up wxDisplay::GetGeometry() benchmark by a factor of 4.
2018-09-30 00:53:59 +02:00
Vadim Zeitlin
9619950721 Use wxOVERRIDE for wxDisplay-related classes in wxQt
No real changes.
2018-09-30 00:38:27 +02:00
Vadim Zeitlin
9f37d91498 Fix wrong comment before wxDisplayFactorySingle::CreateDisplay()
This method is not static.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
77e33d9e1b Micro optimization in wxDisplay ctor
Don't check for the index validity if it's 0, which is the most common
case, as index 0 is always valid and so we can avoid calling GetCount(),
which might have a non-trivial cost, completely.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
141d7b826d Fix weird indentation in X11 display code
No real changes.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
587a510028 Remove unnecessary wxUSE_DISPLAY preprocessor checks
Most of the methods of wxDisplay are always available, they just only
support primary display when wxUSE_DISPLAY==0, so there is no need to
check for wxUSE_DISPLAY before using them as they already contain the
only possible fallback anyhow and such checks are useless.

This incidentally closes #18115, due to removing "#if wxUSE_DISPLAY"
around wx/display.h inclusion.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
bac28b95cd Move wx/display_impl.h to wx/private/display.h
This shows more clearly that this header is private to wxWidgets and
can't be included by user code.

No real changes.
2018-09-30 00:38:26 +02:00
Lauri Nurmi
829f181ccd Get preferred UI languages from the LANGUAGE variable on *nix
Obey the LANGUAGE environment variable (if set), which is GNU
gettext's primary way of determining language preference. Apparently
ignored by wx until now, even though wx attempts to be a
reimplementation of GNU gettext.

The LANGUAGE variable may contain a list of preferred languages,
so use that list to find the best translation.

GNU gettext has supported multiple preferred languages since forever
(at least 15 years), and therefore it is odd that this wasn't already
implemented in 01f953efb2. Instead,
it was implied that Unix does not support such. (Even if GNU is not
Unix, nothing stops a wxWidgets app supporting such nevertheless.)

Closes https://github.com/wxWidgets/wxWidgets/pull/948
2018-09-29 18:14:20 +02:00
Vadim Zeitlin
96ecfd8c77 Provide wxPGChoices ctor, Add(), Set() overloads taking wxStrings
Allow passing an array of wxStrings in addition to an array of wxChar*
strings.
2018-09-29 17:13:00 +02:00
Artur Wieczorek
f96c37eacc Preserve wxGraphicsContext settings while resetting the clipping
To reset the clipping there is necessary
to restore all CGContext settings so we need
to set them back to the previous values based
on the stored wxGraphicsContext attributes.
2018-09-27 22:57:41 +02:00
Artur Wieczorek
875c095e87 Normalize wxRegion rectangle if it has a negative size
For compatibility with wxMSW and wxGTK rectangle
defining wxRegion needs to be in the canonical
form with (x,y) pointing to the top-left corner
and width and height >= 0.
2018-09-27 22:57:05 +02:00
Vadim Zeitlin
713a7ab895 Move wxUSE_ENH_METAFILE check inside wx/msw/enhmeta.h itself
This is more consistent with the other headers, which are safe to
include even when the corresponding feature is turned off.

Also remove the now redundant wxUSE_ENH_METAFILE checks in the source
code including this header.

See https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:47:45 +02:00
imReker
2ed7ed6f39 Fix wxMSW build error when wxUSE_ENH_METAFILE=0
Don't include wx/msw/enhmeta.h when wxUSE_ENH_METAFILE is set to 0.

Closes https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:43:54 +02:00
Stefan Csomor
bc2c58bd39 fixing include statement 2018-09-25 16:47:51 +02:00
Stefan Csomor
19c4d8cf3e macOS, iOS native implementation for wxStaticBitmap
templated native images are not drawing correctly using the low-level drawing calls, therefore use the native Image Views
2018-09-25 15:22:56 +02:00
Vadim Zeitlin
a02ed536e6 Add support for more than 4 joystick buttons under MSW
Use polling thread instead of relying on MM_JOYXXX events to allow
receiving events from all the supported buttons.

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

Closes #1142.
2018-09-25 01:03:58 +02:00
Paul Cornett
7872b9fd38 Deprecate Set{Height,Width,Depth} for other platforms as well
Fixes GTK build with --disable-compat30
See https://github.com/wxWidgets/wxWidgets/pull/925
2018-09-23 20:02:21 -07:00
Stefan Csomor
9bfa4c6da3 further cleanup 2018-09-24 00:12:33 +02:00
Stefan Csomor
f29faa0217 optimize handling of high-res native images 2018-09-24 00:12:33 +02:00
Stefan Csomor
7254515c54 emoving non-native bitmap code, using common code for iOS and macOS
second part, sources were missing
2018-09-24 00:12:33 +02:00
Stefan Csomor
266f32493e Removing non-native bitmap code, using common code for iOS and macOS 2018-09-24 00:11:31 +02:00
Stefan Csomor
bca583234e use direct NSImage drawing commands 2018-09-24 00:11:31 +02:00
Stefan Csomor
34716b18a6 new ICNS Handler 2018-09-24 00:11:31 +02:00
Stefan Csomor
3370b76318 Direct NSImage drawing 2018-09-24 00:11:31 +02:00
Stefan Csomor
ee8132fea9 using NSImage as first-class native representation
If given an NSImage this will be used, unless raw bitmap data access is needed, lazily converting to a CGBitmapContext at that moment
2018-09-24 00:11:31 +02:00
Stefan Csomor
3e6d927eab using newer API 2018-09-24 00:11:31 +02:00
Stefan Csomor
88a15bea48 fixing graphics state stack error 2018-09-24 00:11:31 +02:00
Stefan Csomor
148732993a only use native NSImage dimension 2018-09-24 00:11:31 +02:00
Stefan Csomor
84f68aa764 Fixes and Cleanup 2018-09-24 00:11:31 +02:00
Stefan Csomor
e7d21f6638 Initial Commit of full native bitmap macOS implementation
Right now, to better test regressions, with dual implementation
2018-09-24 00:11:31 +02:00
Stefan Csomor
87e9b3963e Fixing creation from CGContextRef
Our native buffer must be updated as well, otherwise RawAccess will fail
2018-09-24 00:11:31 +02:00
wxBen
efb52e7078 Fix ribbon panel size after calling Realize() again
Reset m_smallest_unminimised_size variable in Realize() before calling
GetPanelSizerMinSize() to prevent the latter from using the old value of
that variable, which could result in panel elements being cut off.

Closes #18226.
2018-09-23 16:04:58 +02:00
Stefan Csomor
e768046774 fixing iOS builds with new SKDs 2018-09-22 17:30:37 +02:00
Vadim Zeitlin
6c1b2b23cf Fix field widths in wxStatusBar showing a size grip in wxGTK
Account for the size grip in DoUpdateFieldWidths(), otherwise the last
field overlapped it.
2018-09-22 16:36:05 +02:00
Maarten Bent
a3eeb4d0be Revert wxAuiDefaultDockArt::DrawIcon API change
Mark the function as deprecated. It should not be part of the public API. It
cannot be overridden and manually calling it has no lasting effect because
DrawCaption calls it as well.

Closes https://github.com/wxWidgets/wxWidgets/pull/943
2018-09-22 14:44:00 +02:00
Václav Slavík
1cf981e243 Parse legacy weight in string font descriptions
Preserve compatiblity font descriptions serialized using
wxNativeFontInfo::ToString() in older versions of wxWidgets and load
them correctly, instead of asserting.

aedf89b098 originally did this, then
d355af3420 reversed it as "not needed".
Turns out it is, for old serializations.

Reverse d355af3420 and implement the same
backward compatible logic in wxOSX. wxMSW uses win32-native description
and doesn't need this.
2018-09-21 17:38:13 +02:00
Václav Slavík
ac6766c2fc Use numeric weight in wxFontBase::operator== 2018-09-21 17:38:13 +02:00
Vadim Zeitlin
fa1af3405c Don't truncate addresses under Win64 in wxDebugReport
Avoid casting addresses to "long", as it can be smaller than pointer
size on some platforms and notably is under Win64.

Use wxUIntPtr instead, which is guaranteed to be large enough.

See https://github.com/wxWidgets/wxWidgets/pull/940
2018-09-20 23:23:53 +02:00
Thomas Pointhuber
d173ccdb96 Add additional informations stack in wxDebugReport
Always add offset and address of a stack element, even if there is no
symbolic function name, as this can still be helpful. If possible add
module as well.

Closes https://github.com/wxWidgets/wxWidgets/pull/940
2018-09-20 23:23:53 +02:00
Maarten Bent
7a8e314736 Fix clicking on drop down button in wxAuiToolBar on wxMSW
The code handling the mouse events assumed the drop down button with was
10px, but wxAuiMSWToolBarArt uses a different width (14px). So clicking
on the left-most 4 pixels was not registered as a drop down click.

Allow the get (and set) the width of the drop down button of the
ToolBarArt.

Increase the detection area for drop down events, because the drop down
button is drawn 1 pixel larger than the actual size.

Rename some variables where dropdown was used instead of overflow.

Closes https://github.com/wxWidgets/wxWidgets/pull/939
2018-09-20 23:23:53 +02:00
Mick Phillips
8a2dd7f18e Check for success of registry operations in wxJoystick code
Avoid reading wrong registry keys of REGSTR_VAL_JOYOEMNAME is not
available.

Closes https://github.com/wxWidgets/wxWidgets/pull/938
2018-09-20 23:23:53 +02:00
Václav Slavík
81ef669c6d Fix wxPreferencesPage rendering in macOS dark mode
In 10.14's dark mode, all views are layer-backed and the assumption that child
windows are redrawn with their parent may not be correct. Change Refresh() to
explicitly refresh child windows too.

Also explicitly refresh the page before showing it in wxPreferences, because
otherwise generic windows wouldn't be drawn correctly.
2018-09-20 19:19:15 +02:00
Václav Slavík
398e8744bd Fix TLW appearance in macOS 10.14's dark mode
Set toplevel window's background colour to the correct value of
NSColor.windowBackgroundColor (i.e. wxSYS_COLOUR_APPWORKSPACE). Without this,
the window's frame would be rendered slightly incorrectly, because of the way
the dark mode blends colors - even when no part of the window's interior, where
the background color would be used, is visible.
2018-09-20 19:19:15 +02:00
Václav Slavík
7564d7ff27 Add M_COLDATA access asserts to wxOSX
Similarly to wxGTK, check the color for validity before deferencing its ref data.
2018-09-20 19:19:15 +02:00
Václav Slavík
d3e35b6bb1 Fix wxUnknownControlContainer background handling
Don't set invalid background color. Don't set debugging magenta background
color, because it did more harm than good, particularly after
d255dc6706.
2018-09-20 19:19:15 +02:00