Commit Graph

67518 Commits

Author SHA1 Message Date
Lauri Nurmi
84f7e925e5 Fix wxThread::SetPriority() documentation
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
2019-12-28 00:06:28 +01:00
Vadim Zeitlin
2c4f42608b Avoid spurious error from wxThread::SetPriority() in wxMSW
Just skip calling ::SetThreadPriority() if the thread hadn't been
created yet: this was useless and just resulted in an error message.
2019-12-28 00:06:27 +01:00
Artur Wieczorek
9689bd124e Use optimized function to draw horizontal/vertical lines only with wxCOPY raster operation mode
Optimized function to draw H/V lines is based on ExtTextOut() API and therefore raster operations modes other than wxCOPY are not applicable.

Closes #18635.
2019-12-19 22:36:59 +01:00
Vadim Zeitlin
00d113c341 Fix wxSocketImplUnix compilation under OpenVMS
Don't pass "const void*" pointer to ioctl(), it seems to be declared as
taking "void*" on this platform and so doesn't accept it.
2019-12-19 18:36:22 +01:00
Jouk
d90953d8c6 wxGTK1 : change type of wxMask.GetBitmap() from GdkBitmap* to wxBitmap 2019-12-19 09:20:36 +01:00
Jouk
c06e50f389 Add wxUSE_NATIVE_DATAVIEWCTRL to setup on OpenVMS 2019-12-19 09:08:13 +01:00
Vadim Zeitlin
ff66848b05 Merge branch 'oss-fuzz'
Add script used by OSS-fuzz service to the main repository itself
instead of having it in a separate one.
2019-12-17 02:08:06 +01:00
Vadim Zeitlin
7ecb687f24 Merge branch 'mac-dvc-check-icons'
Add back support for icons to Mac wxDataViewCheckIconTextRenderer OSX.

See https://github.com/wxWidgets/wxWidgets/pull/1680
2019-12-17 02:07:33 +01:00
Vadim Zeitlin
854b61cd05 Merge branch 'generic-dvc'
Add option for using generic wxDataViewCtrl and fixes to make it work
under GTK and Mac.

See https://github.com/wxWidgets/wxWidgets/pull/1680
2019-12-17 02:06:15 +01:00
Vadim Zeitlin
5de964cecc Add the script run by OSS-Fuzz
This script used to live in oss-fuzz repository itself (under
projects/wxwidgets), but it seems better to have it in the main
repository, as this will make modifying it, e.g. to add new fuzzers,
simpler.
2019-12-16 18:07:38 +01:00
Vadim Zeitlin
312960436f Add OSS-Fuzz badge to the README
The project asks to do it and it only seems right to do so.
2019-12-16 17:33:22 +01:00
Stefan Csomor
df6304caa6 add baselineOffset override to better align icons
Cocoa by default aligns the cell on the text baseline, which is not suitable for our needs, solved by subclassing NSTextAttachmentCell
2019-12-16 16:28:08 +01:00
Vadim Zeitlin
20269a58c0 Avoid spurious assert failures in wxGenericStaticBitmap
Don't trigger a confusing assertion failure about unknown scale mode if
a 0-sized window is being repainted.

It's not clear why should an empty window get repaint events in the
first place, but this does happen, at least under MSW, so guard against
it.
2019-12-16 15:08:35 +01:00
Vadim Zeitlin
b16a1453af Fix the build of Expat library with 32 bit TDM-gcc 5.1
Update to the version of Expat submodule which avoids the use of
rand_s() when using this old (but otherwise still supported) compiler.

Closes #18631.

Closes https://github.com/wxWidgets/wxWidgets/pull/1679
2019-12-16 15:04:55 +01:00
Vadim Zeitlin
7fa1afafc2 Re-add support for icons to Mac wxDataViewCheckIconTextRenderer
Icons were not supported any longer since the switch to the native
implementation in 235e61c311.

Restore them now by using text attachments (thanks to Scott B for the
idea). The vertical alignment is still not right, but it's better than
nothing.

See #17473.
2019-12-15 19:27:58 +01:00
Vadim Zeitlin
334ff40716 Show wxDataViewCheckIconTextRenderer in the sample
Instead of using separate check and icon+text columns in the list model
page, use the combined check+icon+text column to verify that it works
(which is not the case current in the native Mac version).
2019-12-15 19:27:58 +01:00
Vadim Zeitlin
2e71e14dc4 Fix format specifier in an error message in dataview sample
Use "%zu" for a size_t value to avoid assert failures under LP64 (i.e.
all 64-bit Unix) systems.
2019-12-15 19:26:18 +01:00
Vadim Zeitlin
50ba73cbf4 Fix using unknown selector in Mac wxDataViewCtrl code
Don't call -[NSCell setTextColor:] unless it really handles it: testing
for "colText" validity was insufficient, as it could be set as a
fallback.

Also move the fallback assignments inside the branches where they're
really used.

This fixes a bug introduced in 540fed9216,
see https://github.com/wxWidgets/wxWidgets/pull/1673
2019-12-15 19:26:18 +01:00
Vadim Zeitlin
24042b2a2a Fix build with generic wxDataViewCtrl under Mac
Generic wxDataViewCheckIconTextRenderer is needed under Mac too if the
generic version of wxDVC is used.

Closes #18632.
2019-12-15 16:44:42 +01:00
Vadim Zeitlin
4203104d54 Fix using wxTreeListCtrl with generic wxDataViewCtrl in wxGTK
Restrict GTK workaround in wxTreeListModel::IsContainer() to the native
version, it does have a drawback when using the generic one as it
resulted in all items having the expander button.

See #18632.
2019-12-15 16:26:18 +01:00
Vadim Zeitlin
028afa194a Add wxUSE_NATIVE_DATAVIEWCTRL build option
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
2019-12-15 16:23:47 +01:00
Vadim Zeitlin
f3217573d7 Merge branch 'rc-manifest' of https://github.com/MaartenBent/wxWidgets
Fix using manifest from rc file with VC compiler.

See https://github.com/wxWidgets/wxWidgets/pull/1678
2019-12-15 03:44:39 +01:00
Vadim Zeitlin
55f148a2ea Avoid asserts when moving mouse in empty wxGridColLabelWindow too
The changes of the previous commit were insufficient, as we could also
use an invalid column index when handling mouse event in an empty grid.

Fix this by checking for the line validity in PosToEdgeOfLine() instead
of adding another ad hoc check to wxGridColLabelWindow itself, as it
seems reasonable for this function to verify that it uses valid indices.

See #18629.
2019-12-14 00:03:01 +01:00
Maarten Bent
cd1d15351c Fix concatenating manifest name in resource file 2019-12-13 22:21:40 +01:00
Maarten Bent
083f4b3c32 Rename manifests to use underscores 2019-12-13 21:44:26 +01:00
Vadim Zeitlin
9c1e8fde8f Avoid asserts when painting empty wxGridColLabelWindow
When the grid is empty, XToCol() has no choice but to return invalid
index (because there are no valid ones) when it's called from the
drawing code and passing such indices to GetColPos() results in an
assert, which is fatal inside wxEVT_PAINT handler.

Just short-circuit all this code by not doing anything in the case of
empty grid. This is sloppy, but simpler and more robust than any
alternatives.

Closes #18629.
2019-12-13 16:19:47 +01:00
Artur Wieczorek
395a30002e Always draw text with wxCOPY raster operation mode on wxGCDC
It is said in the wxDC::DrawText() documentation that current logical function is ignored by this function (e928566f). This should apply also to wxGCDC implementation for the sake of consistency and text drawing should be always done with wxCOPY mode regardless of the current mode set.
2019-12-12 13:50:19 +01:00
Robin Dunn
09c4033f43 OSXEnableAutomaticTabbing does not return a value 2019-12-11 12:07:43 -08:00
Artur Wieczorek
1d744026f2 Demonstrate drawing text with tab characters 2019-12-10 23:14:49 +01:00
Vadim Zeitlin
7b8cdd441d Return (0, 0) from wxMDIChildFrame::GetPosition() in wxGTK
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.

Closes #18548.

Closes https://github.com/wxWidgets/wxWidgets/pull/1670
2019-12-10 22:42:00 +01:00
Ian McInerney
b17aa08c26 Allow automatic OS-provided tabbing to be disabled in wxOSX
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1674
2019-12-09 22:46:04 +01:00
Vadim Zeitlin
7ecd55f02b Mention that changelog shouldn't be modified directly
Explain that the changes are stored in git notes and the changelog is
only updated before a release now.
2019-12-09 22:45:06 +01:00
Ian McInerney
540fed9216 Implement background color attribute for wxDataViewCtrl in wxOSX
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.

Closes https://github.com/wxWidgets/wxWidgets/pull/1673
2019-12-09 22:45:06 +01:00
Václav Slavík
c4af8be615 wxIsPlatform64Bit: don't launch uname needlessly
Don't execute uname in Unix version of  wxIsPlatform64Bit () to
determine if the current platform is 64-bit capable if the binary is
already a 64bit one.

This is consistent with how MSW implementation behaves and avoids a
pointless invocation when running 64-bit binaries.

As an added benefit, this prevents user harassment by macOS 10.15 if
they launch a wx application from a "protected" location like ~/Desktop
or ~/Downloads - apparently stat()ing CWD is considered evil and
privacy-invading these days.
2019-12-08 19:44:49 +01:00
Paul Kulchenko
1c754fe71c Make wxAuiNotebook wxAuiTabCtrl-related methods public
Allow retrieving the active tab control or tab at the given position.

Closes #16262.
2019-12-07 15:13:06 +01:00
Vadim Zeitlin
0425050ad8 Use native wxDragImage by default in the sample
There doesn't seem to be any reason to default to the generic version.

Closes https://github.com/wxWidgets/wxWidgets/pull/1671
2019-12-07 14:53:49 +01:00
catalinr
392e119bbe Fix dragimag sample compilation with modern compiler under MSW
Don't "override" UpdateBackingFromWindow() method of the base class
unless it really exists, which is only the case for the generic
wxDragImage implementation but not the native MSW one.

See https://github.com/wxWidgets/wxWidgets/pull/1671
2019-12-07 14:52:41 +01:00
Vadim Zeitlin
155885a3dd Reformat splitter sample to follow wx style guidelines
Put "{" and "}" on their own lines. Also use spaces around "if"
condition and omit unnecessary comparisons with NULL.

No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/1672
2019-12-07 14:47:51 +01:00
Xiaofeng Wang
1222ac3d7f Fix crash in the splitter sample due to replacing null window
The sample could crash after the following sequence of actions:

1. Resize splitter to hide the right/left window.
2. Activate replace menu action.

Fix this by checking if the window being replaced is non-null.

Closes https://github.com/wxWidgets/wxWidgets/pull/1672
2019-12-07 14:45:38 +01:00
Artur Wieczorek
9fbf97ae97 Check __WXOSX_COCOA__ instead of wxOSX_USE_COCOA
wxOSX_USE_COCOA is available only in wxOSX files.
2019-12-06 21:09:36 +01:00
Artur Wieczorek
1d45886c8f Don't attempt to get RGB components of invalid colour 2019-12-06 20:44:18 +01:00
Artur Wieczorek
67b64ee70f Add support for creating Cairo pen from wxPen with non-solid colour
Cairo colour patterns support only RGBA colours and therefore it is not
possible to create a colour pattern from wxPen with non-RGB colour
(non-solid colour). As a workaround under wxOSX for solid wxPen with
non-solid colour we can convert it to Cairo surface pattern (stiple)
because under wxOSX non-solid colour is actually represented by a pattern
image.
2019-12-06 20:40:57 +01:00
Artur Wieczorek
55478d95a5 Add support for creating Cairo brush from wxBrush with non-solid colour
Cairo colour patterns support only RGBA colours and therefore it is not
possible to create a colour pattern from wxBrush with non-RGB colour
(non-solid colour). However under wxOSX, when we have a solid wxBrush with
non-solid colour, we can convert it to Cairo surface pattern (stiple)
because under wxOSX non-solid colour is actually represented by a pattern
image.
2019-12-06 20:34:57 +01:00
Artur Wieczorek
389944a116 wxOSX: Implement function to retrieve pattern image for non-solid colour
Under wxOSX non-solid wxColour with NSColor backend is represented by
pattern image and it would be useful to have ability to get it e.g. to help
dealing with non-solid wxColours by frameworks not supporting such colours,
like e.g. Cairo.
2019-12-06 20:33:35 +01:00
Artur Wieczorek
994971e2df Draw horizontal/vertical lines with optimized function only on non-scaled DCs
It turned out that drawing horizontal/vertical lines with optimized function based on ExtTextOut() Win API works as expected only for non-scaled DC. Therefore we can use this optimized way of drawing only for non-rotated and non-scaled DCs.
On not-scaled DCs we can use optimized function to draw also 0-pixel width lines (as a 1-pixel wide lines for compatibility with Win API).

Closes #18612.
2019-12-06 00:08:15 +01:00
Stefan Csomor
31c7073571 macOS: silence warning in non-ARC build
see f1aa3c1c9a
2019-12-05 20:36:29 +01:00
Paul Cornett
bba090e3a4 Fix wxOSX build with wxUSE_DRAG_AND_DROP==0 2019-12-05 08:59:55 -08:00
Vadim Zeitlin
6f95676f3e Merge branch 'grid-delete-rows-crash-fix'
Don't use invalid grid cell coordinates when deleting grid rows.

See https://github.com/wxWidgets/wxWidgets/pull/1669
2019-12-05 17:35:05 +01:00
Dummy
edc5474a73 Add @since annotation to a couple of wxPGProperty methods
Document that these methods have been added in 3.1.0.

Closes #18613.
2019-12-05 17:33:27 +01:00
Paul Kulchenko
e8b917e7a4 Use system colours if the contrast is sufficient in AUI tabs
Improve colour selection in AUI tab art code: prefer to use the system
colours and only fall back on the replacement ones if the contrast is
too small for the text using system colours to be readable.

Closes #18601.
2019-12-05 17:30:19 +01:00