It doesn't make sense to return anything other than true here, as
failure from one of several notifiers cannot be handled sanely, so just
document that.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix confusion of what cell activation is and inconsistence with native
handling in GTK+. Document the distinction between activating (~
editing) a cell and activating (double-clicking) the whole item.
Deprecate wxDataViewCustomRenderer::LeftClick() and Activate() methods,
replace them with single ActivateCell() that is called for both kinds of
activation.
Fix implementations so that ActivateCell() is not called on
double-click, when it shouldn't, and vice versa: don't send
wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED for cell activation.
Partially reverts r67099 -- restores old 2.9 signatures of compatibility
LeftClick() and Activate() methods.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Always send this event, even if the user right clicked outside of the client
area. This is useful for showing item-independent commands in the context
menu.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxDataViewCtrl::GetSelection() now always returns invalid item if more than
a single item is selected in a multi-selection control.
Also add HasSelection() and GetSelectedItemsCount() to allow checking if any
items are selected.
Updated the documentation, all ports and added a test for all these functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not having this as an implicit one made it possible to create
wxDataViewItem from any pointer without realizing it, leading to hard to
debug crashes later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using "i.e." in the brief Doxygen comment makes it end it after the second
period and results in truncated brief description and an unwanted line break
in the full description.
Just avoid using periods for now inside the brief description. Maybe a better
solution could be found in the future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Currently this is only implemented in the generic wxDataViewCtrl, the native
GTK/OSX ports should be modified to support this later.
Closes#13323.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow changing the (fixed) row height without using wxDV_VARIABLE_LINE_HEIGHT
which may slow down the control display too much.
The new method is not implemented for the native GTK and OS X implementations
yet but should be simple to implement there.
See #12749.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There's no reason to limit custom editor controls to wxControl, which
would rule out e.g. composite controls or any custom widgets.
Make appropriate changes to related functions and code too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of passing them by value, use const reference. This change
is safe to do, because these methods' signatures were different in 2.8
anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add new wxDataViewModel::IsEnabled() and wxDataViewListStore::IsEnabledByRow()
methods and implement support for actually disabling the items in wxOSX/Cocoa
native implementation of wxDataViewCtrl and limited support for it in the
generic version.
We need to implement this in wxGTK using GtkCellRenderer "sensitive" propriety
later.
Closes#12686.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Current item is the same as the selected item in single selection mode but in
multiple selection mode there was no way to neither get this item nor change
it before so add the new functions to allow doing this now.
The new methods are implemented for the generic, GTK and OS X/Cocoa versions
but only stubs are provided for OS X/Carbon.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calling Select() for an item should not deselect the other selected items in
multiple selection mode. This is consistent with the GTK and generic versions
behaviour and also just makes more sense but also document that this is indeed
the desired behaviour just in case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These are convenience functions for work working with indexes, for
consistency with other wxDataViewListCtrl methods.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These are commonly needed when using wxDataViewListCtrl, yet they were
only available in wxDataViewIndexListModel.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use "wxWindows licence" and not "wxWidgets licence" (the latter doesn't
exist) and consistently spell "licence" using British spelling.
See #12165.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set up the DC passed to wxDataViewCustomRenderer::Render() to use the font and
colour defined by the item attribute by default so that any calls to
RenderText() from it will use them automatically.
Also added public wxDataViewCustomRenderer::GetAttr() to allow retrieving the
attribute explicitly in Render().
The column using custom renderer in the dataview sample now works as expected
in the generic version; the native ones will be corrected in the upcoming
commits.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method is useful for getting the number of items in the control and
should be part of the public API instead of being marked as internal.
Closes#11380.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is an incompatible change but having to use a non-const model pointer to
call a clearly logically const version was simply too ugly so change it while
we still can.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Old code created the tree model and its unique built-in column only in
wxDataViewTreeCtrl ctor but not in Create(), meaning that the behaviour was
very different depending on whether you used base class ctor call or Create()
in a derived class. This was confusing and completely inconsistent with wx API
in which using the default ctor and Create() is supposed to always have
exactly the same effect as using non-default ctor so change this to create the
model in Create() so that it's always done.
Slightly update the documentation and also add wxDataViewTreeCtrl::Init() for
consistency.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to simply test whether we have a value at the given row and
column or not (as it happens for container items unless they too have columns).
Currently this method is not virtual and is not used by the implementations
yet but it might make sense to make it virtual and allow overriding it in the
future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ChangeValue() is a trivial wrapper calling both SetValue() and ValueChanged().
It allows to replace many calls to SetValue() immediately followed by
ValueChanged() with a single function call which is significantly shorter and
less error-prone (e.g. most of the existing code didn't test SetValue() return
code at all).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa
versions but it currently doesn't work well in GTK as it changes the item
alignment unconditionally, this will need to be fixed later.
The behaviour for the columns is currently inconsistent between ports too:
under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE
and under OS X the same ellipsization mode as the column contents, i.e.
wxELLIPSIZE_MIDDLE by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There is no reason to have a separate class for rendering the text honouring
the attributes defined for it, wxDataViewTextRenderer itself already does this
perfectly well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775