Commit Graph

62118 Commits

Author SHA1 Message Date
Vadim Zeitlin
28f96bdff0 Fix wxTreeListCtrl under wxOSX
Postpone resetting indent in wxOSX wxDataViewCtrl to avoid always removing,
and hence never showing the expanders at all, for wxTreeListCtrl whose model
starts its life as a list but becomes a tree as soon as any items with
children are added to it.

By postponing the call to IsListModel() until the next resize, we give the
model the time it needs to decide what it's going to be, while still removing
the unnecessary indent if there is no need for it.

Closes #17409.
2016-11-22 01:42:28 +01:00
Václav Slavík
cbc386b2fb Add stock accelerator for wxID_SELECTALL
Ctrl+A (or Cmd+A) is used on all three major platforms.
2016-11-21 18:44:32 +01:00
Lauri Nurmi
bdb3f6fea7 Use more descriptive argument names for wxCopyFile() and others
Use more clear "src" and "dest" names for wxConcatFiles, wxCopyFile, and
wxRenameFile functions arguments instead of non-self-descriptive file1, file2,
etc used before.

No real changes.
2016-11-21 18:22:22 +01:00
Lauri Nurmi
902130f64e Use the new wxSysErrorMsgStr() instead of wxSysErrorMsg() 2016-11-21 19:15:20 +02:00
Lauri Nurmi
343318d73e Add a thread-safe wxSysErrorMsgStr()
Implement wxSysErrorMsg's functionality without using static buffers;
have the caller provide the buffer. When the caller uses the original
API and does not provide a buffer, a static buffer is still used.
wxSysErrorMsgStr() returns a wxString.

Also use strerror_r() instead of strerror() on platforms other than MSW.
2016-11-21 19:15:19 +02:00
Tim Kosse
b99ad85b6f Weight pixels by their respective alpha value in wxImage::ResampleBox
Without this weighting, even the color value of invisible pixels with a zero
alpha would influence the result.

Closes #17724.
2016-11-21 18:09:07 +01:00
Lauri Nurmi
3926538fea Don't de-capitalize system error messages on MSW
The returned string being capitalized is not 'bad' as the ancient comment
from the 90s suggested.

At least on Windows 7+, system error messages are full sentences beginning
with a capital letter, ending in a full stop; there is no point in
lowercasing the first letter.
2016-11-21 18:07:55 +02:00
Lauri Nurmi
de70fa5b2f Fix a possible out-of-bounds access to an array 2016-11-21 18:07:55 +02:00
TcT2k
7684f92083 Fix wxMediaCtrl linking on OS X 10.7 and 10.8
The changes in 065135adcc caused AVKit to be linked even when the deployment target was set to 10.7 or 10.8 which would not be available on the target machine. The deployment target is now checked before using AVKit.
2016-11-21 14:36:44 +01:00
Vadim Zeitlin
0bfc8c4d63 Use fabs() instead of abs() for non-integer variables in SVG DC
::abs() truncates floating point values to ints, so use fabs() instead. This
could have been also corrected by using std::abs(), which is overloaded for
multiple types, but use fabs() for consistency with the existing code.

This fixes a problem introduced in 1e0719ad81.

See #17557.
2016-11-20 22:09:32 +01:00
Paul Cornett
cb19499c90 Fix layout of drawing sample System colours screen for colors with non-opaque alpha 2016-11-20 09:59:33 -08:00
Václav Slavík
39bc670409 Don't include wx/except.h twice 2016-11-20 18:20:59 +01:00
Václav Slavík
fb27932e4c Support #rrggbbaa, #rgb and #rgba colors syntax
Add support for alpha channel in the #rrggbbaa format to
wxColour::GetAsString() and FromString(). This syntax is introduced in
CSS4 spec draft (see https://drafts.csswg.org/css-color/#hex-notation)
and already used by Pango for markup as well.

Also recognize #rgb and #rgba shorter variants in FromString().
2016-11-20 18:15:54 +01:00
Václav Slavík
4aacaa88b7 Compilation fix for droptgt.cpp's use of wxTRY 2016-11-20 18:15:54 +01:00
Václav Slavík
7dab555f71 Don't create wxWindowAccessible by default
Don't unconditionally use wxWidgets' implementation of IAccessible for
all windows when wxUSE_ACCESSIBILITY is 1, because it is inferior to the
system provided one: it often lacks appropriate labels, doesn't fully
support navigation and wxIAccessible isn't fully implemented.

The approach, when using MSAA, recommended by Microsoft documentation is
to customize accessibility for custom controls only, by proxying to the
standard and overriding what is necessary. By making this change, user
code is still allowed to customize accessibility if needed, without
negatively impacting standard controls that don't need any custom code.

See also https://github.com/wxWidgets/wxWidgets/pull/340
2016-11-20 17:35:32 +01:00
Vadim Zeitlin
9c1689b850 Add mailmap file to normalize author names in git log
Avoid having entries differing just by name or email address (or, in the case
of Václav, by the use of composed vs decomposed form!) in "git shortlog"
output.

Closes https://github.com/wxWidgets/wxWidgets/pull/326
2016-11-19 19:02:29 +01:00
Paul Cornett
d24fbc7808 Implement wxLB_NO_SB style
See https://github.com/wxWidgets/wxWidgets/pull/346
2016-11-19 08:36:26 -08:00
Mikko P
2326ca72f1 Fix owner drawn dropdown row height.
While m_combo->GetFont(); sets the proper font, the size of that font did not affect the character height.
2016-11-17 14:45:01 +01:00
Vadim Zeitlin
5ffb8de44d Mention that wxOSX doesn't implement SetLayoutDirection()
At least avoid wasting people time with debugging why it doesn't work.
2016-11-17 02:02:06 +01:00
Vadim Zeitlin
3404d55be0 Merge branch 'helloworld-doc'
Modernize "Hello world" page: Bind(), C++11 etc.

Closes https://github.com/wxWidgets/wxWidgets/pull/317
2016-11-16 18:02:28 +01:00
Vadim Zeitlin
8072481f86 Show using C++11 lambda in the "Hello world" example
This is so useful, that it should be mentioned even on this introductory page.
2016-11-16 18:01:47 +01:00
Vadim Zeitlin
2d56fb5298 Use Bind() instead of event tables on the "Hello World" page
Let the new users know that Bind() is the preferred way to handle events in
modern wxWidgets.
2016-11-16 18:01:46 +01:00
Paul Cornett
1b0e7c17e3 Enable choosing paper size and orientation on print dialog, see #17712 2016-11-14 22:32:03 -08:00
Vadim Zeitlin
b06c909385 Avoid assertions if user-defined OnDrop() throws in wxMSW
Ensure that m_pIDataObject is reset to avoid assertions from DragEnter()
during the next drag-and-drop operation after the one which resulted in an
exception being thrown.
2016-11-15 01:15:22 +01:00
Vadim Zeitlin
da6faacd70 Use wxCOMPtr<> for wxIDropTarget::m_pIDataObject
Replace code manually calling AddRef/Release() on this pointer with a smart
pointer, this makes it shorter and safer.
2016-11-15 01:14:23 +01:00
Vadim Zeitlin
32ebf86ea1 Handle exceptions in user drop targets code in wxMSW
All exceptions thrown by wxDropTarget::OnXXX() must be caught and handled in
the same way as we already do it for the exceptions in the event handlers as
we can't let the exceptions escape into system/kernel code: while it can work
in some cases, it doesn't work in general, e.g. exceptions simply disappear
when they happen in 32 bit programs under 64 bit Windows 7.
2016-11-15 01:00:05 +01:00
Vadim Zeitlin
239469457d Factor out exception handling code in a new WXConsumeException()
This will allow using this code from other places and not only when executing
user-defined event handlers.

No changes in this commit yet.
2016-11-15 00:59:40 +01:00
Václav Slavík
fd9e71afb7 Fix rendering artifacts in wxSplitterWindow sash
SizeWindows() optimized rendering calls to DrawSash() too aggressively
and wouldn't repaint e.g. slowly moving sash with wxSP_LIVE_UPDATE
enabled, even though child windows were repositioned.

Fix by always painting the sash from SizeWindows().
2016-11-14 20:07:27 +01:00
Paul Cornett
d3497d32ec Size text sample to it's contents, rather than using fixed arbitrary size 2016-11-14 10:43:56 -08:00
Paul Cornett
5fb89cb86e Support setting initial position for TLW with GTK3 2016-11-14 10:39:58 -08:00
Paul Cornett
27d218a1f3 Set a minimal size for GtkEntry preferred size
This overrides the default minimum size of 150+ pixels, avoiding swarms of
GTK3 debug warnings about "attempt to underallocate wxPizza's child GtkEntry"
2016-11-14 10:38:46 -08:00
Paul Cornett
9bb5d0435a Fix non-default window background color with GTK+ >= 3.20
GTK+ no longer automatically paints non-default window background. See #17586
2016-11-09 20:06:26 -08:00
Václav Slavík
b1a19e6b6c Improve wxChoice::GetBestSize on macOS
Better match native sizing to fit the content by reducing the extra spacing.
2016-11-07 17:52:44 +01:00
Paul Cornett
b47319d515 Avoid calling ScreenToClient() on invisible window while processing wxSetCursorEvent 2016-11-05 19:44:45 -07:00
Paul Cornett
9c3900e40d Cleaner fix for using deleted widget in idle callback
Use a slightly higher idle priority so callback runs before TLW is deleted,
and ref the widget just to make sure it doesn't disappear. Avoids accessing
de-allocated memory.
2016-11-05 17:27:57 -07:00
Paul Cornett
e3f117c4f3 Avoid assert dialog in ClientToScreen()/ScreenToClient(), it's just too annoying 2016-11-03 09:38:39 -07:00
Paul Cornett
ebfa5a4128 Make sure all pointers to destructed window are removed from size revalidate list 2016-11-03 09:22:34 -07:00
Paul Cornett
bca7313499 Fix paint clipping region with GTK+ >= 3.20
Apparently the clip is no longer set properly. Fixes wxDC::Clear() overwriting
areas outside the window. Problem can be seen in the Audacity toolbars.
2016-11-03 09:14:30 -07:00
Václav Slavík
095c958525 Fix ~wxDataViewCtrl assert when running under JAWS
Accessible object must be destroyed as soon as possible, because
otherwise a screen reader may try to query it before wxWindow destructor
removed it, but after ~wxDataViewCtrl destructor finished. The
wxACC_EVENT_OBJECT_DESTROY notification causes exactly that under JAWS.
2016-11-03 16:27:28 +01:00
Paul Cornett
101c43d0aa Partial workaround for stale styling information with GTK3
We can trigger size events when we know the style cache has been updated.
See #16088
2016-11-01 23:18:26 -07:00
Paul Cornett
3b4ee5a031 Fix some sizing problems with GTK3
A change in size-allocate handling with GTK+ 3.20 exposed a flaw in our method for
deferring queue-resize requests. Using an idle callback to process the requests
did not work well with the GdkFrameClock-based system used since GTK+ 3.8. Using
the "check-resize" signal works better. Also with GTK+ >= 3.20, it seems necessary
to manually work the queue-resize up to the TLW, as otherwise the resized widgets
don't get updated without an external size-allocate event.
See #17585
2016-10-31 11:12:37 -07:00
Paul Cornett
83012dc082 avoid uninitialized result from size_request with Ubuntu, see #17707 2016-10-31 09:32:20 -07:00
Václav Slavík
c146103c64 Make wxStatusBar look (more) native on macOS
Significantly improve the appearance of wxStatusBar on macOS, both the
modern flat look since 10.10 and older versions. Increase the size to
match native bottom bars, center the text inside it, use appropriate
background and border colors and the same gray for the text as Finder
uses, correctly change the appearance for inactive windows.

This is still far from ideal - that would be using
setContentBorderThickness:forEdge: and rendering the text atop it. But
that seems to be much easier said than done due to interference from
other parts of wx. This is much better than the previous state.
2016-10-31 14:31:11 +01:00
Lauri Nurmi
9a90816f0b Remove false information about static arrays and wxTRANSLATE
It is not forbidden to have function calls in static initializers, and
such code compiles fine, contrary to claims made by the text. Explain the
real reason why wxTRANSLATE is necessary.
2016-10-31 09:34:41 +01:00
Lauri Nurmi
49137ba1e1 Use a better example for wxTRANSLATE
Since even the text itself acknowledged the example is bad, use another
example that is not bad.
2016-10-31 09:34:41 +01:00
Václav Slavík
d3924b7d41 Report value as percent in wxDataViewProgressRenderer
GetAccessibleDescription() should return the value as percents, not a
raw number, because that's what m_value means.
2016-10-31 09:29:21 +01:00
Paul Cornett
240f826185 Fix a sizing problem with GTK3 when wxPizza is the child of a native GTK widget
See #17704
2016-10-30 17:33:28 -07:00
Artur Wieczorek
9b8f46df36 Implement wxDataViewCustomRenderer::GetAccessibleDescription()
This is a default description of the renderer content (for accessibility purposes).
Thanks to this implementation there is not necessary to override GetAccessibleDescription() in the renderers derived from wxDataViewCustomRenderer.
2016-10-30 20:59:51 +01:00
Artur Wieczorek
fb219aaf35 Add accessibility event notifications to wxDVC 2016-10-30 20:49:56 +01:00
Artur Wieczorek
eeaa613705 Fix wxDataViewCtrlAccessible::DoDefaultAction
Calling wxDataViewTreeNode::ToggleOpen() is not sufficient to actually expand/collapse the item.
Calls to wxDataViewMainWindow::Expand()/Collapse() are necessary to do so.
2016-10-30 20:41:08 +01:00