Commit Graph

72213 Commits

Author SHA1 Message Date
Vadim Zeitlin
74e1c444fa Don't show bogus value when there are none in wxGTK wxDVC neither
This is similar to the previous change to the generic version and simply
applies the same logic to the cells for which GetValue() returns null
value as for those for which HasValue() returns false.
2021-12-01 01:43:52 +00:00
Vadim Zeitlin
55420130b5 Don't use items without values in generic wxDVC
In particular, don't draw them, as this would reuse the value of the
previously drawn item, which would be wrong -- just leave them blank if
PrepareForItem() returned false, which happens if GetValue() returned a
null value or a value of a wrong type.
2021-12-01 01:43:52 +00:00
Vadim Zeitlin
9cb360a0aa Don't call SetValue() with null value in wxOSX wxDVC
We can't guarantee that GetValue() returns a valid value, even if
HasValue() returned true, so avoid calling SetValue() if it returned an
invalid one, as this risks triggering an assert failure and because this
function is typically called when repainting the control, there is a
good chance that we're going to reenter it while showing the assert
dialog box, resulting in an abort, which is not the best way to handle
GetValue() not returning a valid value -- especially when the generic
version doesn't do this, so the problem risks only appearing when
porting to Mac.
2021-12-01 02:22:06 +01:00
Vadim Zeitlin
1ef8d1d48f Avoid warning about not supporting setAccessoryViewDisclosed:
We call it inside the check ensuring that it is supported, so suppress
this warning (introduced in the recent e765756555 (OSX file dialog
extensions (#2592), 2021-11-26)) by casting the receiver to the generic
type, just as it's already done elsewhere in wxOSX code.
2021-12-01 00:05:35 +01:00
Vadim Zeitlin
95b7a2f183 Return false from PrepareForItem() if there is no value
This corresponds to the behaviour described in the comment and is more
useful than always returning true.
2021-11-30 23:03:28 +00:00
Vadim Zeitlin
26c6273a70 Fix crash when setting wxGTK wxNotebook image after creation
The bug was introduced in 9d86ba11e2 (Add support for wxBitmapBundle to
wxGTK wxNotebook, 2021-11-07) after which wxGtkNotebookPage::m_image
remained uninitialized if the page didn't have an image initially, so
fix it by simply initializing this pointer to NULL in this case.

It would arguably be better if wxGtkNotebookPage initialized all its
members in the ctor, but for now just fix the critical bug.

Closes #19332.
2021-11-30 18:13:21 +01:00
Paul Cornett
1c752e24f1 doc typo 2021-11-29 08:54:41 -08:00
Paul Cornett
982a030705 Remove some incorrect ifdefs from wxGenericTreeCtrl
It's clear from the change history (relevant commits listed below) that these
are leftovers from code that is long gone.

ccdbdc8936 (Added native selection rectangle drawing., 2006-11-11)
05d9753817 (Just use the already existing wxRenderer::DrawItemSelectionRect(), 2006-11-14)
a4609ab847 (Implement wxRendererMac::DrawItemSelectionRect and move the generic wxTreeCtrl to using it to draw selected items., 2006-11-19)
2021-11-29 08:53:23 -08:00
Vadim Zeitlin
a65e5f4c1d Explain better how to add data files to a sample
Also don't duplicate this information in both how-to-add-new-sample.md
and how-to-add-files-to-build-system.md, just reference the former in
the latter instead.

Also fix some Markdown markup.
2021-11-29 13:58:52 +01:00
Vadim Zeitlin
1a0eeed0a8 Ignore commit only removing white space for git blame purposes
That commit didn't really change anything, so it's annoying to have the
changes be attributed to it.
2021-11-29 13:58:52 +01:00
Vadim Zeitlin
2435ceb2bb Add a possibility to show SVG images to the image sample too
This is useful at least for demonstrating wx SVG support.
2021-11-29 12:55:22 +00:00
Vadim Zeitlin
8adfaa37f7 Add wxBitmapBundle::FromSVGFile() helper
This is just a trivial wrapper for wxBitmapBundle::FromSVG(), but it can
still be convenient to have.
2021-11-29 12:55:22 +00:00
Vadim Zeitlin
5efcaf4e59 Fix copying testdata.fc file to the tests build directory
This file was listed in test.bkl but wasn't actually copied because the
value of <files> was overwritten by another <files> just below ever
since the changes of 21fe35aff7 (add wxImage test units to test loading
from both seekable and non-seekable streams, 2009-06-01).

Fix this by splitting this wx-data into 2 different ones, to avoid this
conflict.
2021-11-28 22:16:12 +01:00
Vadim Zeitlin
d14e035580 Fix uses of wxDEPRECATED in WXWIN_COMPATIBILITY_2_8-only code
wxDEPRECATED must be used for the entire declaration to really work,
but this wasn't the case for a few functions (and one typedef) guarded
by WXWIN_COMPATIBILITY_2_8, resulting in gcc -Wattributes warning about
the attribute being ignored and the declaration not being really marked
as deprecated.

Fix this by applying the deprecation macro to the entire declaration,
which works well for gcc and should hopefully work for MSVC too.
2021-11-28 21:42:06 +01:00
Artur Wieczorek
9febbe2b30 Explicitly cast AutoHRGN to HRGN to unify types in the statement
This seems to be required by MinGW compiler.
2021-11-28 19:32:02 +01:00
Paul Cornett
03706e9fef Fix build with WXWIN_COMPATIBILITY_2_8==1
Use wxBitmapBundle to avoid wxToolBar::AddTool() ambiguity
2021-11-28 08:48:50 -08:00
Paul Cornett
9a40669aad Fix build with WXWIN_COMPATIBILITY_2_8==1
Reverts what seems to be an unintentional change from
5ae30d2fbe (Use wxBitmapBundle() instead of wxNullBitmap as default value, 2021-11-12)
2021-11-28 08:44:13 -08:00
Artur Wieczorek
fc6bfbc0bf Add tests of clipping regions with wxDC with RTL layout enabled 2021-11-28 17:05:34 +01:00
Artur Wieczorek
288b208a0a Fix setting clipping region for wxDC with RTL enabled (wxMSW)
It turns out that region being added to DC with enabled RTL layout needs
to be defined using mirrored device x-coordinates.
So if we have DC with RTL layout we need to create a temporary mirrored
region and pass it to the DC instead of the original one.

Closes #19325.
2021-11-28 17:04:26 +01:00
Paul Cornett
b04c1ace47 Avoid integer overflow when computing image data size in wxImage::Create()
See #19326

Co-Authored-By: David Costanzo <david_costanzo@yahoo.com>
2021-11-27 17:14:28 -08:00
utelle
deef116a09 Update language database and move support for it to wxUILocale
Update the language database from the canonical sources:

- It now includes most locales supported by Windows 10.
- It now also has the following attributes for each entry:
 - BCP 47-like locale tag.
 - Reference to canonical name for generic language entries.
 - Language name in this language itself.
- Also add data file with list of language script identifiers and
  aliases based on ISO 15924.
- And update genlang.py to handle all the new attributes and data.

Also move database-related methods of wxLocale to wxUILocale and
just redirect wxLocale methods to the new wxUILocale ones (they are
still preserved for compatibility).

Closes https://github.com/wxWidgets/wxWidgets/pull/2594
2021-11-27 17:44:20 +01:00
utelle
1a4a0eee48 Update German translation of internat sample
See https://github.com/wxWidgets/wxWidgets/pull/2594
2021-11-27 17:44:20 +01:00
Stefan Csomor
e765756555 OSX file dialog extensions (#2592)
Re-introduce OpenSavePanelDelegate for filtering when wildcard is provided (Spotlight search field was not working correctly, if extension was not known)
(and on macOS 10.11 allow programmatically showing the extra panel)

see http://www.github.com/wxWidgets/wxWidgets/pull/2592 and https://trac.wxwidgets.org/ticket/19324

co-authered-by: Jeff Young <jeff at rokeby dot ie>
2021-11-26 22:26:49 +01:00
Vadim Zeitlin
c5f023a829 Fix wxGTK1 build after wxBitmapBundle changes in wxStaticBitmap
This should have been done in 3abec9254f (Take wxBitmapBundle in
wxStaticBitmap::SetBitmap(), 2021-10-21) but was forgotten there.
2021-11-26 18:31:19 +01:00
Vadim Zeitlin
7ba71ecaa2 Merge branch 'size-div-double'
Add operator/(wxSize, double) and cleanup some wxSize and related tests.

See https://github.com/wxWidgets/wxWidgets/pull/2593
2021-11-25 15:16:53 +01:00
Simon Rozman
e3535d6481 Mark MSVS *.vcxproj.filters files as using CR LF as well
For consistency with *.vcxproj and *.sln and for making
check_mixed_eol.sh happy.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-24 12:13:12 +01:00
Stefan Csomor
f9234531a2 initial commit of newly generated xcode project files 2021-11-22 19:41:56 +01:00
Stefan Csomor
8cae66a897 adding bundle identifiers, needed for newer systems 2021-11-22 18:49:18 +01:00
Stefan Csomor
b4c028ec82 adding workspaces 2021-11-22 18:13:03 +01:00
Stefan Csomor
1643887948 updating gitignore, adding workspace to wxcocoa_in 2021-11-22 18:03:06 +01:00
Stefan Csomor
5377d45d48 adding workspace template files 2021-11-22 18:01:32 +01:00
Artur Wieczorek
fb5be73f6f Change accelerator key for "toggle layout" menu item
Current Ctrl-L is already used by another menu item.
2021-11-22 10:54:41 +01:00
Artur Wieczorek
acab1ec756 Add option to change layout direction to render sample 2021-11-22 10:41:40 +01:00
Artur Wieczorek
838a1a7640 Add option to change layout direction in dataview sample
See #19325.
2021-11-22 10:40:37 +01:00
Stefan Csomor
18bbfd8c38 fixing xcode scheme templates 2021-11-22 10:25:12 +01:00
Stefan Csomor
c88d5da678 making schemes shared in template already 2021-11-22 10:04:30 +01:00
Stefan Csomor
bdbece5d66 switching to python3 for creating Xcode project files from bakefile
moving fix_xcode_ids to python 3 and make it importable,
the current AppleScript dictionary from Xcode makes it impossible to use it for our purpose
2021-11-22 08:15:16 +01:00
Vadim Zeitlin
2bbe126dca Add operator/(wxSize, double)
For some reason, while both operator*(wxSize, double) and
wxSize::operator/=(double) existed, this one did not, which was
unexpected, so add it too.
2021-11-20 22:06:28 +01:00
Vadim Zeitlin
9941531efc Simplify wxSize unit test further by comparing wxSizes directly
This is shorter and more clear than comparing width and height
independently and results in just as informative messages in case of
test failure if asserthelper.h is included.
2021-11-20 22:01:31 +01:00
Vadim Zeitlin
a18e00379e Get rid of CppUnit boilerplate in wxPoint and wxRealPoint tests
Similar to the previous commit, this doesn't really change anything, but
simplifies things.
2021-11-20 21:57:35 +01:00
Vadim Zeitlin
227b5dba0a Get rid of CppUnit boilerplate in wxSize unit test
No real changes.
2021-11-20 21:52:59 +01:00
Vadim Zeitlin
7a03d5fe9b Merge branch 'mediaplayer_sample'
Add wxMC_NO_AUTORESIZE and use it in mediaplayer sample to fix it
layout.

See https://github.com/wxWidgets/wxWidgets/pull/2562
2021-11-20 21:46:29 +01:00
Vadim Zeitlin
080a236a01 Keep toolbar bitmap size in logical, not physical, pixels
As SetToolBitmapSize() takes logical pixels, GetToolBitmapSize() should
also return them for consistency.

Closes #19323.
2021-11-20 21:46:29 +01:00
Vadim Zeitlin
cffb866edf Minor additions to wxMC_NO_AUTORESIZE documentation
Mention that this flag is new in 3.1.6 and also point to it in ctor and
Create() documentation.
2021-11-20 21:41:28 +01:00
Stefan Csomor
0e4edc4f5f fixing include type
#0cd8989 was using angle includes
2021-11-20 15:26:38 +01:00
Artur Wieczorek
7fef360b0d Set proper bitmap scale for default icons in wxPropertyGridManager tool bar 2021-11-19 17:54:04 +01:00
Artur Wieczorek
87394856f5 Use wxBitmapBundle in wxPropertyGrid 2021-11-19 17:52:56 +01:00
Vadim Zeitlin
17c1bfc0f4 Suppress "Unix" spelling warnings in the samples overview
There doesn't seem to be any good way to avoid codespell warnings about
"unx", so just add the lines containing it to the exceptions file.
2021-11-18 15:47:28 +01:00
David Costanzo
0985996d01 Fix loading of RLE bitmaps in wxBMPHandler
- Fix handling of delta encoding that change vertical position
- Fix handling of end-of-line encodings that are given mid-line
- Removed unnecessary computation for linepos

Add regression tests for the bitmaps using RLE and loading which
previously didn't work correctly.

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

Closes #19318.
2021-11-18 15:37:03 +01:00
Vadim Zeitlin
94f10eba4e Merge branch 'extra_accels' of https://github.com/vadz/wxWidgets
Allow defining additional accelerators for the menu items.

See https://github.com/wxWidgets/wxWidgets/pull/2588
2021-11-18 15:29:56 +01:00