Commit Graph

67720 Commits

Author SHA1 Message Date
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
Artur Wieczorek
f3eea70870 Refactor: Remove duplicated line of code 2019-12-04 23:35:41 +01:00
Artur Wieczorek
64ae98e671 Create CGFont when a new font is set
CTFont and CGFont are used in parallel so both
need to be stored when a new font is set.

Closes #18610.
2019-12-04 23:35:19 +01:00
Paul Kulchenko
8cb9272458 Make wxAuiGenericTabArt text readable on dark background
Select the appropriate text colour depending on the background to ensure
that it remains readable even when using themes/modes using dark
background colours -- which wasn't at all the case before.

Closes #18601.
2019-12-04 19:26:45 +01:00
Vadim Zeitlin
462e7b7732 Avoid using invalid index in wxDisplayFactory under Mac
Partially work around currently unimplemented cache invalidation in
wxMac and do it on the fly if an invalid index is passed to
GetDisplay() to at least avoid crashing, even if this doesn't fully
solve the problem, e.g. we still can use stale information.

Closes #18607.
2019-12-04 19:22:07 +01:00
Vadim Zeitlin
90d547feb6 Don't redraw current cell when the grid is frozen
Don't update the grid appearance when inside a sequence of batch
operations, it will be updated at the end of it anyhow and doing it in
the middle only results in extra flicker.
2019-12-03 02:56:46 +01:00
Vadim Zeitlin
e0b8ef85f2 Don't use invalid grid cell coordinates when deleting grid rows
Since the changes of dda6aa6bdc wxGrid
code could ask the grid table for the data of an invalid cell due to
redrawing the old, and now possibly invalid, current cell from inside
SetCurrentCell() called from wxGrid::Redimension().

Fix this by explicitly resetting the old current cell to an invalid
value when changing it in UpdateCurrentCellOnRedim().

Also avoid calling SetCurrentCell() entirely if the current cell doesn't
change, as this is just completely unnecessary and results in a possible
unexpected wxEVT_GRID_SELECT_CELL event.

See https://github.com/wxWidgets/wxWidgets/pull/1546
2019-12-03 02:47:08 +01:00
Vadim Zeitlin
7b36d72b44 Merge branch 'vc-pmdpi' of https://github.com/MaartenBent/wxWidgets
Add DPI Awareness option to nmake makefiles and MSVC projects.

See https://github.com/wxWidgets/wxWidgets/pull/1664
2019-12-03 02:29:25 +01:00
Vadim Zeitlin
7849d231d9 Merge branch 'build-option-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous build options fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1661
2019-12-03 02:27:52 +01:00
Vadim Zeitlin
811be7ced7 Fix wxGridCellAttr::GetNonDefaultAlignment() for invalid inputs
The recent change of 19844d27ac fixed this
function for valid values of input/output parameters on input, but broke
it if the parameters had invalid value: in this case, we still need to
fill them even if this attribute doesn't have any specific alignment of
its own.

Account for this case too now, explain the logic of this function in the
comments inside it and extend the unit test to check for this case too.

Now the function should really conform to its documented (and expected,
including by the existing code in various grid renderers) behaviour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1665
2019-12-03 02:26:49 +01:00
Vadim Zeitlin
00a56a28b6 Merge branch 'sock-event-fix'
Fix unwanted (and sometimes fatal) socket events for blocking sockets
under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1658
2019-12-03 02:25:18 +01:00
Vadim Zeitlin
14cfc2c2b2 Avoid clang -Wnon-virtual-dtor without triggering MSVC warnings
The change of 4990515aba resulted in
(disabled by default, but which may be enabled when building
applications using wxWidgets) MSVS 2017 warning C4265 ('class' : class
has virtual functions, but destructor is not virtual), so test for clang
explicitly instead of just testing for non-gcc.
2019-12-02 22:35:36 +01:00
Artur Wieczorek
7143ff46b0 Ensure bitmap image exists while querying for a row stride
Obtaining bytes per row makes sense only for bitmap image representation
so we have to ensure that the bitmap represenation exists before querying
for its row stride length. NSImage per se cannot provide this information.

Closes #18606.
2019-12-01 22:58:18 +01:00
Artur Wieczorek
a1cc2056bc Update NSImage with changes made to bitmap pixel data
In order to get access to wxBitmap's pixel data we actually have to work
with CGBitmapContext data and this context is created from NSImage by call
to wxBitmapRefData::EnsureBitmapExists() when we prepare to get access
to the data in wxBitmapRefData::GetRawAccess().
So, when we finish updating bitmap data we should update original NSImage
with actual CGBitmapContext data in wxBitmapRefData::EndRawAccess().

See #18606.
2019-12-01 22:39:38 +01:00
Maarten Bent
e36cdaddfd Specify CPU parameter for AppVeyor nmake builds
Don't use DPI aware manifest with VC9.
Build minimal samples with msbuild and nmake.
2019-12-01 00:06:44 +01:00
Maarten Bent
7fd0b744a8 Update wxrc sln and vcxproj files
Specify all configuration types, add dependent projects.
Based on the minimal sample solutions and project file.
2019-11-30 23:26:15 +01:00
Maarten Bent
0f2308e3eb Update test sln and vcxproj files
Remove old configurations, add dpi manifest.
2019-11-30 23:24:54 +01:00
Maarten Bent
067c192112 Add DPI aware manifest to minimal.vcxproj 2019-11-30 23:11:04 +01:00
Maarten Bent
bed8cd7b52 Rebake after adding DPI awareness option 2019-11-30 22:52:48 +01:00
Vadim Zeitlin
36546b6f3f Merge branch 'grid-editors-placement'
Fix positions of the checkboxes drawn by wxGridCellBoolRenderer and
shown by wxGridCellBoolEditor so that there is no jump when starting or
stopping to edit grid cells with boolean values.

See https://github.com/wxWidgets/wxWidgets/pull/1662
2019-11-29 16:24:07 +01:00
Vadim Zeitlin
56bf5282d7 Merge branch 'gtk-fractional-font-scaling'
Apply system's fractional font scaling parameter when displaying text in
wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/1650
2019-11-29 05:04:56 +01:00
Vadim Zeitlin
abc8841f0b Use default wxCheckBox size in wxGridCellBoolEditor
Using wxRendererNative::GetCheckBoxSize() as the size of wxCheckBox just
doesn't work with GTK 3, as the control has additional padding between
its actual contents and the focus rectangle, which means that its actual
size must be greater than the size to be passed to DrawCheckBox() in
order to draw a checkbox of the same size.

However it isn't really necessary to resize wxCheckBox at all, it's
enough for DrawCheckBox() to produce a check mark of the same size as
that shown in a default-sized wxCheckBox and this does work in wxGTK.

So keep the default size of wxCheckBox to make everything work.

This means wxGetGridCheckBoxRect() is not useful any more, so replace it
with wxGetContentRect() which just positions a rectangle of the given
size inside another one (this should probably be moved somewhere else,
as it's more general than wxGrid).
2019-11-29 04:57:59 +01:00
Vadim Zeitlin
eadee05729 Don't change CSS for wxCheckNox with wxNO_BORDER in wxGTK 3
This makes the checkbox look ugly as it's clearly not supposed to be
rendered without the border at all, so it's better to do nothing than
mangle its CSS.

It could be better to add some virtual GTKTurnOffBorder() method that
could be overridden to do nothing in wxCheckBox and we should consider
doing this if there are other classes for which wxNO_BORDER breaks their
appearance, but for now, as long as it's the only case in which we need
to do this, just turn wxNO_BORDER off when calling PostCreation().
2019-11-29 04:31:14 +01:00
Maarten Bent
0833c8b861 Disable webview in GTK3 build on TravisCI
It does not pass the tests.
2019-11-29 01:11:37 +01:00
Maarten Bent
51254a148e Make wxSVGFileDC an abstract class 2019-11-29 01:10:43 +01:00
Maarten Bent
c6ce2a77bf Fix wxEditorDialogProperty type declaration 2019-11-29 00:23:26 +01:00
Maarten Bent
38c38e2274 CMake: private includes before public includes
This way, build-in headers (for example png headers) will always be included
before system headers.
2019-11-29 00:21:26 +01:00
Maarten Bent
4d72739714 CMake: fix using cotire with clang on Windows 2019-11-29 00:21:26 +01:00
Maarten Bent
147dab61b3 Check for more webkit packages on TravisCI 2019-11-29 00:21:26 +01:00
Maarten Bent
a45afd2f98 Add uninstall icon to installer script 2019-11-29 00:21:25 +01:00
Maarten Bent
a6bfd845b4 CMake: find PangoFT2 when wxUSE_PRIVATE_FONTS is enabled in GTK
Rewrite and simplify FindFontconfig.
2019-11-29 00:21:25 +01:00
Maarten Bent
016f00777e Fix 'declaration hides previous local declaration' warnings 2019-11-29 00:21:01 +01:00
Vadim Zeitlin
edd0d9b68f Ensure DrawCheckBox() fits inside the rectangle passed to it
This results in rather ugly checkboxes when the rectangle is too small,
and even "critical" GTK warnings with wxGTK 3, but is still arguably
better than drawing outside of the provided rectangle.
2019-11-28 23:57:15 +01:00
Stepan Hrbek
4340841565 Fix uninitialized thread pointer in wxMSW wxJoystick
Initialize m_thread to null to ensure we don't dereference an invalid
pointer later if no joystick with the specified index was found.

Closes https://github.com/wxWidgets/wxWidgets/pull/1663
2019-11-28 22:49:42 +01:00
Maarten Bent
a96a55be77 Add DPI Awareness option to .vc and msvc files
The default DPI awareness is set to per-monitor.
2019-11-28 22:43:23 +01:00
Maarten Bent
7daabeb98b Rebake event sample 2019-11-28 22:05:00 +01:00
Paul Cornett
632363775d Fix -Wclass-memaccess warning from previous change 2019-11-28 09:12:48 -08:00
Paul Cornett
9c5ec2f959 Restore resetting of wxMiniFrame cached decor size
This was inadvertently lost in 8cdd20667f, apparently causing wxRESIZE_BORDER
functionality to stop working on some platforms. See #18591
2019-11-28 09:03:38 -08:00
Vadim Zeitlin
2eb312b5f9 Avoid changing checkbox background in wxGrid under non-MSW
Doing this makes the checkbox unusable with the default GTK 3 theme as
the default grid background colour (white) is the same as the colour of
the check mark -- so changing the checkbox background to it makes it
invisible.

Work around this by adding a new SetTransparentPartColour() method that
can be used by wxGrid (and, in the future, user code if we decide that
this is really the best solution to this problem that we can provide) to
make the checkbox blend in with its background without actually changing
its appearance.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
e2bb8b05bf Factor out common checkbox-related code into CheckBoxInfo
No real changes, just extract the same code used in both GTK 2 and GTK 3
implementations of GetCheckBoxSize() and DrawCheckBox() in a helper
class which is now just used from both places.

This makes the code more clear and hopefully easier to maintain in the
future.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
9ae808dc86 Synchronize structure of DrawCheckBox() and GetCheckBoxSize()
Put GTK 3 version first in both functions instead of putting it in the
middle (!) of GTK 2 code in the former one for some reason.

No real changes, the code was just moved around (this commit is best
viewed with "git diff --color-moved").
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
ab02d36e10 Account for vertical alignment in wxGetGridCheckBoxRect() too
Do it if only for consistency with the horizontal alignment.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
6b63016fb2 Use helper wxRect::CentreIn()
No real changes, just make the code a bit more concise and clear.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
57f89c626c Fix the code which tried to account for too small cell rect
It didn't actually manage to do it as it used wrong comparison.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
4f6b29fb0c Remove "X" suffix from GRID_CELL_CHECKBOX_MARGIN_X
The same margin will be used in the vertical direction too.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
04b6fc2f90 Add another cell with boolean renderer/editor to the sample
No real changes, just test the boolean cells appearance with the default
white background too.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
851d11ba2c Determine the checkbox size in wxGetGridCheckBoxRect() itself
It doesn't make much sense to pass the size to the function supposed to
compute it, so call wxRendererNative::GetCheckBoxSize() from the
function itself instead of forcing its callers to do it.

No real changes.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
f4756eaa2f Centre checkboxes in wxGrid vertically by default
Make the alignment used by default in wxGridCellBoolRenderer and
wxGridCellBoolEditor consistent and centre the checkbox vertically in
both of them: previously only the editor tried to do it, but failed,
because the code wrongly overwrote the default alignment as it used
GetAlignment() instead of GetNonDefaultAlignment(), while the renderer
didn't even try.
2019-11-28 02:14:50 +01:00
Ilya Sinitsyn
dacf25ac99 Support wxNO_BORDER for wxCheckBox under GTK2 2019-11-28 02:14:50 +01:00