Commit Graph

61681 Commits

Author SHA1 Message Date
Vadim Zeitlin
ffcdcc1617 Make wxTimeSpan::operator-() const
Due to an oversight, it wasn't declared as const, making it impossible to
subtract from a const wxTimeSpan object.

Fix this and add a unit test verifying that this compiles and works as
expected.

Closes #17583.
2016-06-30 19:09:04 +02:00
Artur Wieczorek
9bf97bd607 Use wxMemoryDC with selected wxBitmap to create wxGraphicsContext in the graphics test.
If there is no wxBitmap selected into wxMemoryDC which is passed to wxGraphicsContext then there is raised an assertion warning (harmless in this context but caught and reported by CppUnit). To suppress this message we need to select any bitmap into wxMemoryDC prior to creating a wxGraphicsContext.
2016-06-29 21:01:53 +02:00
Artur Wieczorek
eb7a9f85c5 Added new tests to check clipping box calculations for wxDC and wxGCDC.
See #17013
2016-06-29 21:01:36 +02:00
Vadim Zeitlin
68d235fed3 Output test name before GTK error messages in the test suite
Try to make it possible to understand where exactly do the GTK+ errors
appearing in the buildbot slaves output originate from by installing a custom
Glib log handler and prefixing the normal log messages with the name of the
test running when they're generated.

This required a small refactoring of DetailListener which is now always
installed, in order to always have access to the current test name, but still
needs to be explicitly enabled to produce output.
2016-06-29 18:49:47 +02:00
Vadim Zeitlin
8686ca62e7 Avoid asserts when destroying windows with mouse capture in tests
Destroying a window with mouse capture results in an assert, which is
translated into an exception when running the test suite. As this exception is
thrown from wxWindowBase dtor, it results in an immediate program termination
when using C++11 and can also have the same effect even when using C++98 if
this exception is thrown while already handling another exception due to a
test failure.

Try to avoid this by using a "safe" DeleteTestWindow() function instead of
deleting the window directly. Currently this function ensures that the window
doesn't have mouse capture before deleting it, but it could also be used to
check for other things later. Also, this commit only uses this function for
the two controls which do happen to be destroyed with mouse capture currently
(at least when using wxGTK), but it should probably be generalized to all
controls in the future.
2016-06-29 18:26:11 +02:00
Vadim Zeitlin
dae164b8aa Return correct main window from wxListHeaderWindow
wxListHeaderWindow is part of the composite wxGenericListCtrl, so override
GetMainWindowOfCompositeControl() in it to indicate this relationship.
2016-06-29 18:20:55 +02:00
Vadim Zeitlin
8bb4495d95 Remove mouse capture assert from wxGTK wxWindow dtor
This assert was redundant as a similar check is done in the base class dtor.
And while usually this assert is just annoying, instead of being helpful, when
running the unit test suite which installs a custom assert handler throwing an
exception, it is actively harmful as generating 2 asserts during the
destruction of a window with mouse capture results in immediate termination
(even in C++98 mode, unfortunately the whole idea of throwing from dtor is
probably unsalvageable anyhow when using C++11).
2016-06-29 17:55:17 +02:00
Vadim Zeitlin
a7d82aa776 Turn off optimizations for all gcc versions in hash unit tests
Optimizations were turned off for g++ 4.8 to work around compiler bug
resulting in generating infinite loops for the code in this function in
052e598d09, but apparently other versions of g++
suffer from it as well, so just always turn them off until we can be sure
about the version of the compiler in which this bug was really fixed.
2016-06-29 15:43:01 +02:00
Vadim Zeitlin
83489d6ca1 Fix PCH-less build after the previous commit
Include wx/textctrl.h to get wxTE_PASSWORD definition.
2016-06-28 15:38:49 +02:00
Vadim Zeitlin
3dc54df247 Ignore hints on wxTE_PASSWORD controls when not supported natively
There is no way to show the hint without native support in a control with
wxTE_PASSWORD style, so simply ignore them completely in this case.

Closes #17078.
2016-06-28 14:40:52 +02:00
Vadim Zeitlin
967bdbf994 Use equally-sized buttons in wxMSW horizontal toolbars
Only use TBSTYLE_AUTOSIZE, adjusting each button to the size it really needs,
for the toolbars with wxTB_HORZ_LAYOUT style as they don't have any uniform
button size anyhow.
2016-06-26 18:51:50 +02:00
Vadim Zeitlin
98bb2b265a Merge branch 'strip-cjk-mnemonics'
Strip mnemonics correctly from the translations including them in parentheses
after the translated menu text, as is apparently common when using CJK.

Closes #16736.
2016-06-26 18:37:50 +02:00
Vadim Zeitlin
68b2e06f70 Improve translated mnemonics unit test
Don't switch locale to Japanese, which might not be supported, but just use
wxTranslations directly because we only need translations, not full locale
support.

Also rename the test method to a more descriptive name.
2016-06-26 18:36:14 +02:00
David Hart
13068d3603 Strip mnemonics from CJK translations of menu items too
Chinese, Japanese etc translations use a special style for the menu mnemonics
and append them to the translated menu label in brackets, e.g. the menu label
could have the form of "<translation-of-file> (&F)".

Check for this style of mnemonics in wxStripMenuCodes() too and strip them as
well.
2016-06-26 18:36:11 +02:00
Vadim Zeitlin
423ad59b00 Replace AddCatalog() overload with defaulted argument
There is no need to have 2 overloads of this function when we could have just
a single one with a default parameter value.
2016-06-26 18:30:32 +02:00
Artur Wieczorek
8d87ebfe47 Updated wxGraphicsContext and wxGraphicsRenderer documentation.
Added some notes regarding Direct2D and Cairo renderers to reflect latest changes.

Closes #17575
2016-06-25 18:20:24 +02:00
Artur Wieczorek
2ea7ff3160 Updated documentation for wxPropertyGridInterface.
Updated documentation and removed doxygen-style comments from propgridiface.h header file.
2016-06-25 18:17:57 +02:00
Vadim Zeitlin
bbe0ba46e2 Fix heading of transformation matrix section in wxDC docs
The first word of the section title was misinterpreted as an anchor, add a
real anchor to prevent this from happening.
2016-06-24 23:10:56 +02:00
Vadim Zeitlin
fe1e8e46c3 Fix the documented type of wxSecretValue ctor from string
It should be wxString, not wxSecretValue.
2016-06-24 14:21:46 +02:00
Vadim Zeitlin
aa84e6379a Document wxDateTime::GetValue()
It was referred to in GetTicks() description but not documented itself, add it
now.
2016-06-24 14:20:34 +02:00
Artur Wieczorek
47791737db Revert code commented out by mistake in f06bfe37.
We need to restore HDC after Cairo operations.
2016-06-23 22:23:05 +02:00
Artur Wieczorek
9bee5e1e2b Updated documentation for several wxPG components.
Updated wxPropertyGrid, wxPropertyGridEvent, wxPropertyGridPopulator documentation and removed doxygen-style comments from propgrid.h header file.
2016-06-23 22:23:03 +02:00
Vadim Zeitlin
093a955fcc Don't make wxBU_EXACTFIT buttons too tall in wxMSW
Fix regression introduced by bd388e9827: bitmap
buttons could now be made significantly taller than the text control height if
their bitmap was big enough. Only make buttons taller if they wouldn't be tall
enough on their own, instead of always increasing their height, even if it's
already big enough.

Closes #17576.
2016-06-23 22:16:26 +02:00
Vadim Zeitlin
ff5981230a Fix crash when resetting wxGrid table with editor control shown
This resulted in a crash in GetDefaultEditorForCell() later when GetEditor()
was called from HideCellEditControl() which is itself always called from
wxGrid dtor because GetDefaultEditorForCell() dereferenced m_table without
checking if it was not null any more.

Add the missing check to this function and GetDefaultRendererForCell() too,
for consistency.

In addition, dismiss the cell editor immediately when changing table instead
of doing it at some later time, as it just doesn't make sense to continue
showing it any more as the data it was started to edit doesn't belong to us
any longer.
2016-06-22 01:11:20 +02:00
Vadim Zeitlin
4b98cd4012 Fix compilation with libsecret 0.16 from Ubuntu 14.04 LTS
This version of the library requires predefining a special symbol to obtain
API declarations we need.

See https://github.com/wxWidgets/wxWidgets/pull/290
2016-06-18 18:36:13 +02:00
jonkraber
96ef6ea293 Fix preserving selection when changing selection mode in wxGrid
The loop over the existing selection was buggy and took into account only one
corner of the block instead of the entire block and also skipped some blocks
entirely.

Closes #17572.
2016-06-18 18:12:52 +02:00
Artur Wieczorek
9c2076b79f Implemented wxToolBarTool::SetLabel (GTK)
Labels can be changed only for button tools because control tools with labels are not implemented under wxGTK.

Closes #17567
2016-06-17 23:18:10 +02:00
Artur Wieczorek
1373241f21 Fixed implementation of wxToolBarTool::SetLabel (MSW).
Because label is implemented in the control tool as a separate wxStaticText object which exists only if label is non-empty so we need to handle appropriately also the cases when non-empty label is set to empty and vice versa.
Setting a new label for the button tool with TB_SETBUTTONINFO would require to do some additional actions for other items in the toolbar (manual re-positioning items in the control tools, updating stretchable spacers) so it is easier just to re-create the toolbar with Realize().

See #17567
2016-06-17 23:17:40 +02:00
Lauri Nurmi
e45a9543d6 Fix unit test when char is unsigned by default
Skip test relying on char being signed if it isn't by default, as is the case
with gcc on some ARM platforms, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/299
2016-06-17 14:49:21 +02:00
Artur Wieczorek
2ea41cca8d Updated documentation for several wxPG components.
Updated documentation and removed doxygen-style comments from property.h header file.

wxPGPaintData
wxPGProperty
wxPGCell
wxPGAttributeStorage
wxPGChoices
wxPGChoiceEntry
wxPGRootProperty
wxPropertyCategory
2016-06-16 23:55:37 +02:00
Vadim Zeitlin
f792ba45f6 Merge branch 'dvc-markup'
Add support for using markup in wxDataViewCtrl items.
2016-06-16 17:49:54 +02:00
Vadim Zeitlin
857a8a1ba1 Don't assert in wxRenderer::GetHeaderButtonMargin()
Even if we don't have any way to determine the real margin, don't assert in
this method implementation in wxGTK and wxOSX, but just return 0 instead.

This fixes asserts when trying to fit a column of wxDataViewCtrl, by double
clicking a separator after it, to its contents.

See #13685.
2016-06-16 17:26:38 +02:00
Paul Cornett
e9fdda8638 Avoid clearing selection for mouse button up event which is not over an item, see #17547 2016-06-16 07:23:34 -07:00
Vadim Zeitlin
74c0462c84 Add wxDataViewTextRenderer::EnableMarkup()
Implement the new method to all the implementations (generic, GTK, OS X), show
it in the sample and update the documentation.
2016-06-16 00:06:23 +02:00
Vadim Zeitlin
b6a75ff0b2 Don't pass nor use wxCONTROL_FOCUSED in wxRenderer::DrawItemText()
It doesn't make much sense to always use wxCONTROL_FOCUSED in wxDataViewCtrl
code whenever wxDATAVIEW_CELL_SELECTED state bit is set, wxCONTROL_SELECTED
seems to be enough and is with the native MSW wxRenderer implementation which
doesn't even test for wxCONTROL_FOCUSED anyhow, while the generic one did and
didn't use the correct colour unless it was set.

No real changes, but this will make upcoming commits more straightforward and
already simplifies the code a little bit.
2016-06-16 00:02:09 +02:00
Vadim Zeitlin
acd77439f9 Add wxMarkupText::RenderItemText()
Add new method allowing to use wxRendererNative::DrawItemText() for actually
rendering the text instead of wxDC::DrawLabel().

This will be used for markup support in (generic) wxDataViewCtrl.
2016-06-16 00:02:02 +02:00
Dimitri Schoolwerth
3c4e29e0da Fix accidental changes made to menu sample
Only German translations were supposed to be updated according to
8437c6a443 but it also made test changes
to samples/menu/menu.cpp, revert those.
2016-06-15 02:38:10 +02:00
Vadim Zeitlin
42fe8f889e Return more attributes from wxGTK wxTextCtrl::GetStyle()
Set "underlined" and "strikethrough" style attributes to correspond to the
ones really used too.

See #17523.
2016-06-14 21:43:38 +02:00
Tobias Taschner
ac5a362d8d Include OSX 10.12 name and branding in wxGetOsDescription()
Starting with 10.12 OSX will be renamed to macOS. The name for version 10.12
is Sierra.

Closes https://github.com/wxWidgets/wxWidgets/pull/297
2016-06-14 16:09:47 +02:00
Jouk
ce4070fc16 Enabling wxUSE_GRAPHICS_CONTEXT on OpenVMS 2016-06-14 14:11:38 +02:00
Artur Wieczorek
1f696b6110 Updated wxPGDefaultRenderer and wxPGCellRenderer documentation.
Removed doxygen-style comments from the header file, too.

Closes #14788
2016-06-13 18:40:42 +02:00
Jouk
98284d8f35 Update of OpenVMS makefiles 2016-06-13 16:44:49 +02:00
Jouk
7b1fbff128 re-insert != operator that disappeared during last update 2016-06-13 16:39:38 +02:00
Vadim Zeitlin
2297578cb4 Merge branch 'wxsvgfiledc-improvements' of https://github.com/MaartenBent/wxWidgets
Many improvements in wxSVGFileDC to improve its support of wxDC API including:

- Enabled usage of clipping regions.
- Correctly draw polypolygons.
- Draw lines as one long line instead of many short lines.
- Drawing text improvements (position, multi-line, underlined, strike-through).
- Support more brush and pen styles.
- Add Saving as SVG to drawing sample.
- Implemented Clear().
- Set the SVG title.
- Produce valid svg/xml.
- Correctly draw ellipses and arcs.

See https://github.com/wxWidgets/wxWidgets/pull/215
2016-06-13 15:25:30 +02:00
Vadim Zeitlin
6c7b8c5368 Don't document obsolete wxHelpController::Initialize() overload
There are no help controllers using the TCP port number passed to this
Initialize() overload anyhow, so don't document it neither.

It would be even better to get rid of it entirely, but this would require
slightly more effort.

See #17566.
2016-06-13 15:16:22 +02:00
Vadim Zeitlin
8760e4fb70 Clarify that wxTextCtrl style apply to user-entered text too
The wording was unclear and seemed to imply that the style was only taken into
account for the text added programmatically, which wasn't the intention.

See #17523.
2016-06-12 19:20:53 +02:00
Andreas Falkenhahn
e4473fa193 Apply wxTextCtrl::SetDefaultStyle() to user-entered text in wxGTK
Apply the appropriate style to any text being inserted, not just the text
added by the program. This not only fixes the bug with default style not being
used for the text entered by user, but also makes the code simpler.

Closes #17523.
2016-06-12 19:18:27 +02:00
Maarten Bent
97c7ac4289 Code cleanup in wxSVGFileDC.
Consistent white-space usage.
Use wxS macros for strings.
Check if output stream is OK when writing.
Removed unnecessary Borland pragmas.
2016-06-12 18:40:12 +02:00
Maarten Bent
1e0719ad81 Fixed drawing elliptic arcs in wxSVGFileDC.
For some combinations of start and end angles, the wrong large-arc-flag was calculated. Fixed by correctly converting the wxDC angles to SVG angles (shift -90 degrees, and invert to clockwise direction).
Arcs with the same start and end point (circles) where not drawn because the angle becomes 0 degrees. Fixed by drawing two half circles.
Elliptic arcs with a non-transparent brush had an extra line from the center to the start point of the arc. Fixed by first drawing the arc without border, then only the border.
Arcs with small angles would become invisible because the start and end point map to the same (integer) coordinate. Very large arcs would be distorted because the start and end point coordinates did not line up. Using floating point values resolves this.
See issue #17557.
2016-06-12 18:40:12 +02:00
Maarten Bent
2dcaa43f0b Fixed drawing ellipses and arcs in wxSVGFileDC.
Ellipses with the same start and end point (circles) where not drawn because the angle becomes 0 degrees. Fixed by drawing two half circles.
Do not close ellipses if a transparent brush is used (to match wxDC behavior).
See issue #17557.
2016-06-12 18:40:12 +02:00