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.
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.
Change the animation delay from ridiculously long (half a second) to
somewhat more reasonable 200ms to bring it in line with Windows per the
comment in this code. Feels more similar to native macOS animations now
too.
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.
Don't use custom color attributes or color markup for rendering of
selected items' text in wxOSX's wxDataViewCtrl and use the selection
text color instead. This is consistent with the other ports and should
be done to improve readability (in absence of selection-specific
attributes).
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.
Native Windows header control doesn't have the ability to show
per-column resizing cursor and it's only possible to enable or disable
it for the entire control, so we can't fully support the wxHeaderColumn
API. But we can at least hide the resizing cursor if none of the columns
are resizable.
By default double dashes are converted to en-dashes in the output (and triple
ones -- to em-dashes), but this is undesirable when double dashes are used not
as a punctuation mark but in command line options or as C++ decrement
operator, so escape them to avoid such conversion in this case.
Fix numerous focus-handling bugs in wxOSX in combination with
NSScrollView (which cannot get focus by itself and which was already
treated specially in many, but not all, places), including
- inability to set the focus
- loss of wxEVT_SET_FOCUS events
- loss of wxWindow<->NSView association after clearing wxDVC columns
In both the generic and GTK+ implementations, setting the value of a
bitmap column to wxNullVariant resulted in the bitmap, if set for some
rows, being repeated on the rows with null value.
QTKit has been removed from OS X 10.12 SDK.
QTKit has been superseded by AVFoundation since OS X 10.7.
Since wxWidgets >= 3.1 requires 10.7 anyway there is no reason to support the old API.
Additionally the AVFoundation implementation may use AVKit (available since 10.9). It will be used when available and the deployment target is met.
Closes https://github.com/wxWidgets/wxWidgets/pull/337
Since OS X Sierra 10.12 QTKit has been removed. wxMediaCtrl for OS X already had a fallback to AVFoundation implemented. This makes sure this will be used and the correct media Frameworks are used for linking.
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.
This reverts ill-advised commits
c07523734f and
8d42890df4 that disabled native OS X
behavior of substituting dashes and quotes with typographically correct
characters if the user has this feature enabled.
This was a bad idea for two reasons:
1. It made wx applications behave non-natively, and thus be worse, in a
highly noticeable area.
2. It made it impossible for applications that want to behave correctly
to restore the native behavior, because once
setAutomaticDashSubstitutionEnabled or
setAutomaticQuoteSubstitutionEnabled is called (as wxTextCtrl
constructor does), it's no longer possible to obtain its original,
default setting.
It's not better to disable native functionality by default, it's better to
be native and make customizations possible. wxWindow API exposes access
to the native control and if an application desires to disable
substitution behavior, it can easily do so from user code.
See also #186 and #241.
Return corresponding states (wxACC_STATE_SYSTEM_UNAVAILABLE, wxACC_STATE_SYSTEM_INVISIBLE, wxACC_STATE_SYSTEM_OFFSCREEN) for objects which are disabled, hidden or invisible (out of screen).
If entire client area is filled with displayed rows, the last visible row is the row occupying the line at the bottom of the client area (at y = dimY-1).
Because last displayed row can be partially visible in the client area, it cannot be determined as previous row to the row virtually displayed below the client area (at y = dimY), like it is currently implemented.
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.
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.
In native OS X apps, focus ring is not shown around NSTableView controls
(focus is indicated differently, with selection's color). For some
reason, NSTableView shows the focus ring by default when used in wxDVC,
so we need to explicitly disable it.
Don't set Cocoa autoresizing mask on the control, because it causes it
to be, well, automatically resized, causing wx code to miss the size
change and omit wxEVT_SIZE events. As wx handles all of the sizing and
positioning itself, it almost never makes sense to use
setAutoresizingMask:
wxDataViewCtrl were always reorderable in wxOSX, regardless of the
presence of wxCOL_REORDERABLE. Fix in the code to respect per-column
flag in a somewhat hacky, but recommended by Apple, way of making this
setting, which is normally global for the entire control, apply to
individual columns.
Child ID passed to the wxIAccessible methods can be only a VARIANT of type VT_I4 which value is greater or equal to 0 (CHILDID_SELF = 0 and child objects indexed from 1).
wxIAccessible should return a NULL BSTR to the accessibility framework if strings returned from wxIAccessible::get_accName() and get_accValue() are empty because this convention is already applied to the other methods returning string values, like get_accHelp(), get_accDescription().
Because query for item rectangle is executed in the context of wxDataViewCtrl so coordinates of retrieved rectangle should be specified in wxDataViewCtrl client coordinates (not in wxDataViewMainWindow coordinates).
To return correct coordinates it is necessary to convert rectangle coordinates retrieved by wxDataViewMainWindow::GetItemRect() from wxDataViewMainWindow client coordinates to wxDataViewCtrl client coordinates (they can different due to the presence of the header in wxDataViewCtrl client area).
Point coordinates passed from wxDataViewCtrl::HitTest() to wxDataViewMainWindow::HitTest()
should be converted from wxDataViewCtrl client coordinates to wxDataViewMainWindow client coordinates because they can different due to the presence of the header in wxDataViewCtrl client area.