Commit Graph

17025 Commits

Author SHA1 Message Date
Václav Slavík
7833c65c2a Add wxGraphicsContext::CreateFromUnknownDC()
A convenience helper for writing generic code that may operate on
different kinds of DCs, all supported by wxGraphicsContext, but without
knowing its specific type.
2016-11-22 14:51:39 +01:00
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
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
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
Paul Cornett
1b0e7c17e3 Enable choosing paper size and orientation on print dialog, see #17712 2016-11-14 22:32:03 -08: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
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
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
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
fa4b077421 Remove wxDataViewTreeCtrlAccessibilty class
Since wxDataViewCtrlAccessible::GetName() calls to wxDataViewIconTextRenderer::GetAccessibleDescription() to directly retrieve the content of the renderer, there is no need to override wxDataViewCtrlAccessible::GetName() in order to get a proper content of the renderer in wxDataViewTreeCtrl.
2016-10-24 22:22:31 +02:00
Artur Wieczorek
d9fbde805b Implement wxDataViewRenderer::GetAccessibleDescription() method
The purpose of this method is to provide a textual description of the renderer's content to the class implementing accessibility framework in wxDVC (wxDataViewCtrlAccessible).
It is exposed if wxUSE_ACCESSIBILITY is set to 1.
2016-10-24 21:52:22 +02:00
Vadim Zeitlin
c9ec981a28 Fix MinGW builds by defining HDS_NOSIZING if it's not defined
Blind fix for compilation failures in MinGW builds after the changes of
92a1f643ba which started using HDS_NOSIZING
apparently not present in this compiler SDK headers.
2016-10-21 22:54:46 +02:00
Václav Slavík
a6be5bdae3 Fix wxGTK wxDataViewRenderers' alignment handling
Don't apply alignment to native controls in SetAlignment() method, where
it may not be known yet due to column-to-renderer inheritance if
wxDVR_DEFAULT_ALIGNMENT is used (the default). Move such code to
GtkUpdateAlignment() (which was made virtual) in all renderers.

This fixes unintended right-aligning of columns with GTK+ 2 when default
alignment was used.
2016-10-21 17:50:34 +02:00
Václav Slavík
7546989c44 Fix wxMarkupParserAttr's unwinding of colors
Fix the logic for restoring previous span's colors to account for the
possibility of spans that don't change the color, such as in "<i><span
color='red'>...</span></i>foo". Previously, "foo" would always be
rendered black, because unwinding the attributes stack would encounter
an invalid color (which has r=g=b=0) and set it, disregarding and
preexisting attributes.

Because there's code in there that checks whether the attributes are
valid, we need to keep track of both the actually specified attributes
and the currently effective ones, and use the latter for restoration.
2016-10-21 17:36:32 +02:00
Václav Slavík
5e5ffad0b8 Respect item font when rendering markup (wxOSX)
Respect per-item attributes and namely the font (which may differ from
the control's font) when rendering markup items in wxDataViewCtrl.
2016-10-21 17:36:32 +02:00
Václav Slavík
58fc33d7c2 Support ellipsizing of markup text in wxDVC
Fix wxDataViewTextRenderer to at least partially respect ellipsize mode
when using markup text. Generic implementation only supports
wxELLIPSIZE_END and wxELLIPSIZE_NONE at the moment, but the wxOSX and
wxGTK ones have full support.
2016-10-21 17:36:32 +02:00
Václav Slavík
ec45fc5ae0 Return IAccessible from GetIAccessibleStd()
There's no reason to return an untyped void* pointer when we can
forward-declare IAccessible.
2016-10-19 10:36:07 +02:00
Artur Wieczorek
cfe0eaa7f2 Create wxAccessible object on demand in wxDVC
Create wxAccessible objects only in response to calls to GetOrCreateAccessible() to save resources.
2016-10-16 23:48:27 +02:00
Václav Slavík
90e1769569 Add API to control OS X wxTextCtrl’s smart behavior
Allow the user to customize smart quotes and dashes substutions on OS X
and also provide the OSXDisableAllSmartSubstitutions() method for
disabling them all at once.
2016-10-16 16:49:18 +02:00
Artur Wieczorek
d8b2da0334 Remove wxUSE_VARIANT guards
wxDataViewCtrl requires wxVariant so these guards are not necessary.
2016-10-15 21:02:05 +02:00
Artur Wieczorek
9c3c6074eb Add accessibility support for wxDataViewCtrl and wxDataViewTreeCtrl
Implemented wxDataViewCtrlAccessible and wxDataViewTreeCtrlAccessible classes.
2016-10-09 21:13:00 +02:00
Václav Slavík
29d310c6f0 Implement wxDataViewCtrl::SetFont() on OS X
wxDataViewCtrl now behaves consistently with other ports on OS X:
calling SetFont() sets the default font used by renderers and adjusts
row height to fit.
2016-10-09 16:10:31 +02:00
Václav Slavík
8a6a20b1e3 Implement wxDataViewCtrl::SetRowHeight() on OS X 2016-10-09 16:10:30 +02:00
Václav Slavík
8e70ef3aec OS X: Fix wxDataViewBitmapRenderer autosizing
wxDataViewCtrl code expects, quite reasonably, that NSCell's cellSize:
will behave as documented and return the minimal size for image cells
too. Unfortunately, that's not the case.

A cell created as NSImageCell, which seems to exists for exactly this
purpose, will always return the size as (0,0), regardless of whether it
has any image set or not an regardless of its size.

On the other hand, a cell created with NSCell.imageCell constructor
sizes itself correctly, but is not a NSImageCell instance and somehow
interferes with other wxDataViewCtrl rendering, presumably due to its
special status.

The simplest fix to make the sizing work correctly therefore seems to be
to specialize NSImageCell and implement its (trivial) cellSize: method.
2016-10-08 18:29:22 +02:00
Václav Slavík
7d03ed608b Fix compilation warning in wx/osx/dataview.h 2016-10-08 16:58:53 +02:00
Artur Wieczorek
fb5f6c4720 Add wxACC_INVALID_ARG error code to wxAccStatus enum
Since accessibility framework supports signaling E_INVALIDARG error, it would be good to have a corresponding flag indicating this error in wxAccessible functions.
In response to wxACC_INVALID_ARG returned by wxAccessible functions, wxIAccessible should return E_INVALIDARG to the framework.
2016-10-03 20:43:00 +02:00
Maarten
977a826639 use more wxOVERRIDE (#329) 2016-09-25 13:21:28 -07:00
Paul Cornett
9b19a6e529 use wxOVERRIDE in wxMSW sources 2016-09-23 07:59:11 -07:00
Artur Wieczorek
b5a740a85f Remove unused member variables from wxGCDCImpl 2016-09-20 21:32:09 +02:00
Artur Wieczorek
41a2b3e371 Fix applying affine transformation matrix in wxGCDC
In wxGCDCImpl::ComputeScaleAndOrigin() current affine transformation matrix (applied with SetTransformMatrix, ResetTransformMatrix) has to be concatenated with current basic transformations (applied with SetDeviceOrigin, SetLogicalScale, etc.).

Closes #17674.
2016-09-20 21:31:56 +02:00
Artur Wieczorek
277f9c58a1 Fix retrieving bounding box coordinates
Bounding box coordinates have to be calculated and stored internally in device units to be independent on changes of logical coordinates between calls to wxDC::CalcBoundingBox.
These stored coordinates are converted to the logical units on demand when they are retrieved with call to wxDC::MinX, MinY, MaxX or MaxY.

Closes #17667.
2016-09-16 22:04:54 +02:00
Vadim Zeitlin
4f0701c82c Merge branch 'clean-up-pre-c++98-compatibility-macro' of https://github.com/minoki/wxWidgets
Don't bother with checking for some really obsolete compilers and just assume
that C++98 keywords "explicit", "{static,const,dynamic}_cast" and support for
partial template specialization is always available.

Closes #17655.
2016-09-16 01:41:19 +02:00
New Pagodi
b06e63dbd2 Add new wxStyledTextCtrl wxEVT_STC_AUTOCOMP_COMPLETED event
This is the translation of Scintilla SCN_AUTOCCOMPLETED notification.

Closes #17664.
2016-09-16 01:38:27 +02:00
Vadim Zeitlin
6ad64a5d69 Make wxTreeEvent::GetToolTip() const
This is not very important because this function is only used by wxWidgets
itself but it's still wrong to have a non-const trivial accessor like this.

See #17661.
2016-09-16 01:34:32 +02:00
ARATA Mizuki
affbcfa6c4 Remove HAVE_PARTIAL_SPECIALIZATION and HAVE_TEMPLATE_OVERLOAD_RESOLUTION macros
See #17655.
2016-09-14 18:45:12 +09:00
ARATA Mizuki
32666e8d4f Remove feature test for HAVE_EXPLICIT 2016-09-14 18:45:12 +09:00
ARATA Mizuki
8cfc74491a Replace wxEXPLICIT with the 'explicit' keyword
See #17655.
2016-09-14 18:45:12 +09:00
ARATA Mizuki
1e6251d592 Replace wx_static_cast/wx_const_cast/wx_reinterpret_cast with the function-style casts
See #17655.
2016-09-14 18:45:12 +09:00
New Pagodi
b99d28bb46 Add wxStyledTextEvent::GetListCompletionMethod()
Provide access to Scintilla "listCompletionMethod" field of SCR_AUTOCSELECTION
event.

Closes #17648.
2016-09-13 13:05:25 +02:00
Artur Wieczorek
49000defcf Add support for affine transformation matrix in wxGCDC
Graphics renderers (exposed through wxGraphicsContext) support arbitrary affine transformations so it is possible to add support for affine transformations in wxGCDC by implementing all wxGCDC::*TransformMatrix() functions with calls to respective wxGraphicsContext functions.
Additionally, this implementation adds support for affine transformations in wxDC under wxGTK3 because in this port wxDC is equivalent to wxGCDC.
2016-09-08 19:34:43 +02:00
Paul Cornett
0bf38e11a3 Cleanup of ad84d9f (r77846)
Remove the unnecessary 'CodePair' struct from a header, make the huge
keySymTab array const, and don't compile it for platforms that don't
use it, it's only used by wxX11
2016-09-07 22:02:05 -07:00
HasheeLeo
ef85c41d0c Pass wxFont by const reference to wxStyledTextCtrl::StyleSetFont()
Since wxStyledTextCtrl::StyleSetFont does not change its 'font' parameter, it
should be a constant reference so we can pass in temporary wxFont objects.

Closes https://github.com/wxWidgets/wxWidgets/pull/321
2016-09-08 01:13:39 +02:00
Kolya Kosenko
897ffb58b0 Use native MIME and display classes in wxGTK/Win32 build
Use Windows file associations when running under this OS, even when using
wxGTK, because this is the right thing to do.

Also use native wxDisplay implementation because it works better than the GTK+
one under this platform.

Closes #17651.
2016-09-08 00:48:41 +02:00
Artur Wieczorek
ba4b8d5670 Fix retrieving clipping box after changing wxDC coordinates (GTK)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated by recalculating extents of the clipping region in new coordinates at nearest call to GetClippingBox().

Closes #17646.
2016-09-01 21:42:13 +02:00
Artur Wieczorek
98714ea452 Fix retrieving clipping box after changing wxGCDC coordinates (MSW, GTK)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().

See #17646.
2016-09-01 21:41:18 +02:00
Artur Wieczorek
dfc966bf1e Fix retrieving clipping box after changing wxDC coordinates (MSW)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing HDC is associated with wxDC using SetHDC() or when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated using GetClipBox() Win API at nearest call to GetClippingBox().

See #17646.
2016-09-01 21:39:48 +02:00
Lauri Nurmi
84969ba00d Prevent assignment to wxString::const_iterator from compiling
Make const_reference const and dereference const_iterator into a
const_reference to ensure that the code trying to assign to a (dereferenced)
const_iterator doesn't compile.

Closes https://github.com/wxWidgets/wxWidgets/pull/316
2016-08-27 17:51:37 +02:00
arata, mizuki
23527a5f81 Fix wxCHECK_VISUALC_VERSION macro to correctly detect VC14 2016-08-27 17:45:12 +02:00
Lauri Nurmi
394ce5f631 Add C++11-style cbegin, cend, etc. to wxString's iterator interface
These c-prefixed functions always return a const_iterator.
The full list of functions added: cbegin(), cend(), crbegin(), crend().

Closes https://github.com/wxWidgets/wxWidgets/pull/314
2016-08-25 18:54:05 +02:00