Commit Graph

62434 Commits

Author SHA1 Message Date
Artur Wieczorek
2e9e3f5c31 Copy reference images required to execute unit test
Reference images necessary to run a test (see ef46f24f37) have to be copied to the target folder.
2017-04-15 00:13:13 +02:00
Artur Wieczorek
003cb8a9ce Document recent wxMemoryDC::Blit() fix in changelog
Document changes introduced in 0ac0f4b259.
2017-04-14 18:31:26 +02:00
Artur Wieczorek
0ac0f4b259 Fix wxMemoryDC::Blit() with itself as source in wxGTK3
Drawing on the Cairo surface itself can give invalid results when source and destination regions overlap.
To avoid this problem we have to copy actual source surface to the temporary one and use this copy in drawing operations.

Closes #17666.
2017-04-14 09:33:20 +02:00
Artur Wieczorek
f171d48be4 Disable antialiasing in unit test
In order to examine real colors of pixels we need to have unmodified (aliased) edges between regions drawn with different colors.
For for wxDCs backed by wxGraphicsContext (e.g. under wxGTK3) antialiasing is enabled by default and to prevent falsifying pixel colors we have to disable it prior to drawing operations.

See #17666.
2017-04-14 09:15:04 +02:00
Artur Wieczorek
34e19a7449 Prevent unit test from crashing under wxGTK3
Under wxGTK3 default color depth for wxBitmap is 24 bpp and therefore wxAlphaPixelData cannot be used to get access to wxBitmap's internal data in this case.

See #17666.
2017-04-14 09:13:36 +02:00
Dimitri Schoolwerth
5a7570bf7d Fix failing unit test in MarkupTestCase
One of the wxMarkupParser tests expects "&" to map to "&&" however
this, purposefully, is not the case any longer since
60bd6842e4. Fix by changing the expected
result to contain a single ampersand instead of double.
2017-04-13 00:27:41 +04:00
Václav Slavík
c7a6cb9c2e Fix missing virtual dtor warning for wxMarkupText
Changes from 60bd6842 introduced a warning about not having a virtual
destructor despite having virtual methods.
2017-04-11 15:34:50 +02:00
Artur Wieczorek
d0a07b665f Fix MSVC14 warnings about shadowed variables in wxSTC
Just to suppress harmless warnings.
2017-04-09 21:29:31 +02:00
Artur Wieczorek
ee4ab34686 Fix building tests with wxUSE_GRAPHICS_CONTEXT==0
Don't execute code which depends on graphics context functions if wxUSE_GRAPHICS_CONTEXT==0.
2017-04-09 21:29:14 +02:00
Václav Slavík
2132ff0291 Fix wxTextWrapper::Wrap with widthMax=-1
Fix regression introduced in cb2474f where Wrap() stopped treating
negative widthMax as documented, i.e. not doing any wrapping at all and
only respecting newlines.
2017-04-09 14:14:49 +02:00
Maarten
3afc2790b8 Target latest Windows API in wxMSW
Update WINVER and similar definitions to use the latest 0x0a00 value
corresponding to Windows 10 instead of the old Windows 8.1 values.
2017-04-08 21:48:47 +02:00
Dimitri Schoolwerth
3ae438b9ac Fix wrong variable name
The typo resulted in, depending on compiler used, an error ("undeclared
identifier") or warning. Fix by using the intended name.

Regression since 5552351393.
2017-04-08 11:44:02 +04:00
Kevin B. McCarty
69110bd470 Fix spurious scrolling with deeply nested control
The original ticket #9563 about children inside a wxScrolledWindow being
scrolled, instead of just handling the mouse click (e.g. by toggling the
checkbox), was fixed some time ago when the child was a direct child of
wxPanel. However the same problem still existed when the child was inside
another window which was itself a child of wxPanel.

Generalize the fix by ignoring the child focus event if any of the window
ancestors passes our check instead of checking only the window itself.

Closes #17154.
2017-04-07 19:08:18 +02:00
Václav Slavík
60bd6842e4 Fix handling of ampersands in wxDataViewCtrl markup
Handle "&" in exactly the same way as "&" in wxMarkupParser, i.e. do not
map the former to "&&" to prevent it from being interpreted as a mnemonic as
this is incompatible with using markup for anything but the control labels,
e.g. for wxDataViewCtrl items text, in which mnemonics are not recognized.
And even when using markup for control labels, it was a questionable decision
as it's really not clear at all why should the XML entity and the raw
character itself be handled differently.

Also split wxMarkupText into two classes, wxMarkupText that handles
mnemonics in the markup (which is typically a label) and a very
similar, but not derived, wxItemMarkupText that handles mnemonics-less
markup for list etc. items, uses DrawItemText() and supports
ellipsizing.

Illustrate the use of ampersands in the dataview sample.
2017-04-07 18:45:39 +02:00
Vadim Zeitlin
0e2f6f6ec0 No changes, just fix a typo in a comment in wxMarkupText code
Also remove a couple of trailing spaces.
2017-04-07 18:45:39 +02:00
Václav Slavík
a145d759ea Fix building wxOSX with MacOSX10.11 SDK
Fixes #17838.
2017-04-06 15:05:19 +02:00
Václav Slavík
166f5c0abb Fix "unknown keyboard accel" with 1-char translations
wxAcceleratorEntry::ParseAccel() incorrectly assumes that every
single-character accelerator must be a direct character code. But
that's not true, a human-friendly name for a key (e.g. "Down") may be
translated with a single character in some languages (or because a
translator decides to use a Unicode arrow…).

Amend the test to check if the character is a 7bit ASCII one. That
would be extremely unlikely to be a translation.
2017-04-05 13:52:36 +02:00
Vadim Zeitlin
200ea47519 Fix harmless recently introduced warning in wxOSX
Add an explicit cast to suppress "NSString may not respond to 'string'"
warning from clang given since d1c5f107a1.
2017-04-04 06:54:56 -07:00
Vadim Zeitlin
2b026e02e8 Only declare wxTextCtrl::MSWCreateContextMenu() if wxUSE_RICHEDIT==1
This method is only used, and defined, when using rich edit controls, so don't
declare it if wxUSE_RICHEDIT==0.

This should fix a link error in this build variant.

Closes https://github.com/wxWidgets/wxWidgets/pull/452
2017-04-04 15:27:05 +02:00
Václav Slavík
1fb0b9c01f wxOSX: Don't tighten truncated markup in wxDataViewCtrl
Starting with OS X 10.10, rich text is automatically tightened if it
doesn't fit and needs to be ellipsized, in an effort to fit more text
on screen. This is not desirable in wxDataViewCtrl where the cells may
display texts of varying lengths, some tightened and some not.
Explicitly disable this functionality to have consistent appearance.
2017-04-04 14:30:33 +02:00
Václav Slavík
e01510f6c0 Add MAC_OS_X_VERSION_10_{11,12} to platform.h 2017-04-04 14:06:36 +02:00
Vadim Zeitlin
404f0f8587 Hide wxChoice before destroying it with GTK+ 3
This works around GTK+ critical error messages that we get otherwise with GTK+
since the change done in its commit 7401794de6b084fea469af297b7c144724b8492c
which appeared in 3.22.8 release and is still present in the latest version.

These messages happen because gtk_combo_box_popdown() ends up being called
during the widget destruction if it's still shown, so just hide the combobox
before destroying it to avoid them.

Closes https://github.com/wxWidgets/wxWidgets/pull/449
2017-04-02 22:48:19 +02:00
Vadim Zeitlin
e9ce55e000 Fix wxRmdir() with non-ASCII paths
Don't apply at best unnecessary, and actually harmful, as it uses a wrong
conversion, fn_str() when calling wxRmDir() which takes wxString.

Update unit tests to check that wxRmdir() now works with non-ASCII filenames
too.

Closes #17644.
2017-04-01 19:12:27 +02:00
Vadim Zeitlin
d145ef7205 Get rid of ugly "pUnitMsg" in the file functions unit test
No real changes, just simplify the code passing the message shown when a test
fails to CppUnit a bit.
2017-04-01 19:07:26 +02:00
jprotopopov
5552351393 Add unit tests for more file-related functions
Test wxDirExists(), wxIsAbsolutePath(), wxMkdir() and wxRmdir() too.

Closes #17830.
2017-04-01 18:47:16 +02:00
jprotopopov
9b1afaa7a6 Don't crash in wxFFile::Eof() and Error() if file is closed
Assert and return false instead, this is more developer-friendly.

Add unit tests to check that these functions really work as expected when
called on a closed file.

Closes #17828.
2017-04-01 18:43:13 +02:00
Vadim Zeitlin
a05b1f39f5 Merge branch 'svg-sample'
Improve the UI and code of this sample.

Closes #14663.
2017-04-01 18:28:10 +02:00
Vadim Zeitlin
4325472e97 Use symbolic constants instead of hardcoded numbers in svn sample
It would arguably be even better to use different derived classes for
different operations instead of doing everything inside a single class with a
big "switch", but this would require more time, so for now at least make the
code slightly more understandable and maintainable.

This also results in using useful names for the files being saved by default
instead of just "SVG Test #" used before.
2017-04-01 18:26:16 +02:00
Vadim Zeitlin
5fb77c4c78 Credit Prashant Kumar Nirmal as svg sample author 2017-04-01 18:26:06 +02:00
Vadim Zeitlin
672cf7d199 Don't hardcode wxSpinCtrl size in the aui sample
This makes it too small when using GTK+ 3.22, resulting in GTK+ debug messages
about not having enough space for it -- and is, of course, wrong anyhow, as we
should always let controls determine their own best size.
2017-04-01 15:48:53 +02:00
Václav Slavík
d1c5f107a1 Fix crash with Vietnamese input method on macOS 2017-03-31 19:08:57 +02:00
Vadim Zeitlin
b7822ff511 Get rid of unnecessary helper function in the svg sample
No real changes, just remove the trivial CreateNewPage() function which made
the code less clear without any real gain.
2017-03-31 17:15:03 +02:00
Vadim Zeitlin
3745f2c771 Remove unnecessary check for null notebook page
A non-empty notebook always has a non-null current page.
2017-03-31 17:13:44 +02:00
Vadim Zeitlin
9eb62000f9 Simplify layout of the svg sample
Get rid of the panel and the sizer, neither of them are necessary when we have
a single control (wxNotebook in this case) taking up the entire frame client
area.
2017-03-31 17:12:39 +02:00
Vadim Zeitlin
fe562d8bcd Avoid ugly cast in the svg sample
Just use wxLogStatus() instead of manually setting the status text, as this
also allows to get rid of wxUSE_STATUSBAR checks (wxLogStatus() is always
declared and just does nothing in this case).
2017-03-31 17:11:27 +02:00
Vadim Zeitlin
367cf2da5c Fix a few whitespace problems in the svg sample
No real changes, just consistently use spaces after "//" and on both sides of
the assignment operator.
2017-03-31 17:07:12 +02:00
Vadim Zeitlin
70e01a6849 Use quotes, not angle brackets, for wx header in svg sample
Samples are part of wxWidgets and use quotes for including wx headers to
indicate that they're part of the same tree and not global headers, so just
follow the same convention here.
2017-03-31 17:04:56 +02:00
Vadim Zeitlin
331ba71d4e Remove unnecessary wx/vector.h inclusion from the svg sample
Nothing uses wxVector<> here.
2017-03-31 17:03:33 +02:00
Vadim Zeitlin
4b7d3561d9 Use standard menu IDs in the "svg" sample
Don't define our own ID_XXX when the standard ones will do.

Use wxID_SAVE instead of wxID_SAVEAS just because the former has a standard
accelerator (Ctrl-S) while the latter does not, at least under MSW, and it's
convenient to have one.
2017-03-31 17:01:10 +02:00
Vadim Zeitlin
4aa2a84ac5 Remove the now unused icons from the svg sample
Since these bitmaps are not used in the sample toolbar any more, they're not
needed at all now.
2017-03-31 16:58:19 +02:00
Prashant Kumar Nirmal
e2fbfb693f Improve "svg" sample UI to make using it less troublesome
The sample forced the user to use the menu "Open" command several (up to 8!)
times to get to a particular page which was inconvenient and confusing,
especially because more than 8 windows could be opened.

Fix both problems by just creating a notebook with 8 pages, each corresponding
to a particular test.
2017-03-31 16:55:23 +02:00
orbitcowboy
15ae00d7a2 Declare a local variable in filefn.cpp as const
No real changes, just make a variable which is set only once const.
2017-03-31 14:09:58 +02:00
Artur Wieczorek
72e67d0c52 Fix layout and size of vertical wxSlider (wxMSW)
Correct positioning of min/max labels to prevent them to be drawn outside the control.
Use size of enabled labels to adjust the size of the slider control.

Closes #17829.
2017-03-29 20:42:24 +02:00
Artur Wieczorek
113cec4ab2 Update wxPropertyGrid documentation
Completed documentation for topics marked as uncompleted.
2017-03-27 18:54:16 +02:00
Catalin
e118c918ce Redefine MAPVK_VK_TO_CHAR, missing from XP 64-bit and tdm32-gcc-5.1.0 2017-03-27 18:39:20 +02:00
Prince David
f375293704 Fix wxSVGFileDC build with wxUSE_MARKUP==0
Just add the missing wxUSE_MARKUP checks.
2017-03-27 00:27:09 +02:00
Artur Wieczorek
716f42b416 Fix drawing sample compilation when wxUSE_GRAPHICS_CONTEXT==0
'File_ShowGraphics' constant is not defined in this case so it cannot be referred to.
2017-03-25 21:00:51 +01:00
Takeshi Abe
1f20b73c11 Remove wrong MSW notes from wx*ChoiceDialog documentation
Both wxCENTRE flag and dialog position are supported under MSW, so don't say
that they are not.
2017-03-25 03:22:17 +01:00
Paul Cornett
493643477c Fix typo: CFStringref --> CFStringRef 2017-03-24 08:33:01 -07:00
Václav Slavík
dd3dec42e5 wxrc: extract translatable strings from <hint> 2017-03-24 12:32:39 +01:00