Commit Graph

84 Commits

Author SHA1 Message Date
Václav Slavík
63e55c0ae6 Document wxDataViewModelNotifier callbacks return values.
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
2011-10-21 16:51:00 +00:00
Václav Slavík
dc73d7f5d4 Cleanup of wxDataViewCtrl cell activation code.
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
2011-10-19 16:20:17 +00:00
Robin Dunn
ea8fa3c4e6 More interface updates for Phoenix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-27 03:34:29 +00:00
Vadim Zeitlin
7ed24cb652 Send EVT_DATAVIEW_ITEM_CONTEXT_MENU events even when not clicking on an item.
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
2011-09-21 15:07:56 +00:00
Robin Dunn
e932127792 fixes for missing or broken interface items for Phoenix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-16 17:03:01 +00:00
Vadim Zeitlin
fa93d732e2 Harmonize wxDataViewCtrl::GetSelection() behaviour in all ports.
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
2011-08-22 12:41:19 +00:00
Václav Slavík
d5c4a81f2e Make the wxDataViewItem(void*) constructor explicit.
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
2011-08-10 15:21:22 +00:00
Vadim Zeitlin
47e2f88166 Avoid unwanted line break in wxDataViewListModel::GetCount() docs.
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
2011-08-04 13:19:57 +00:00
Vadim Zeitlin
2a648479df Add wxDataViewEvent::IsEditCancelled() and support for vetoing edit events.
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
2011-07-19 22:35:53 +00:00
Vadim Zeitlin
0f4a54a655 Implement wxDataViewCtrl::SetRowHeight() for wxGTK.
Also document that this method can only be used to increase the row height
compared to the default, not to make it smaller.

See #12749.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-06-11 23:56:44 +00:00
Vadim Zeitlin
bbfd454841 Add wxDataViewCtrl::SetRowHeight() and provide its generic implementation.
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
2011-06-07 22:49:56 +00:00
Robin Dunn
eeea3b039e Virtualize StartEditor and add implementations for the ports that can do it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67817 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-31 19:36:47 +00:00
Václav Slavík
64c70359a7 Return wxWindow* from wxDataViewCustomRenderer::CreateEditorCtrl().
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
2011-04-22 18:25:32 +00:00
Bryan Petty
57ab6f2314 Extensive documentation typo patch (closes #13063).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-22 14:08:30 +00:00
Václav Slavík
548fa9c1eb Pass wxRect/wxPoint arguments to wxDataViewCustomRenderer by reference.
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
2011-03-01 12:16:49 +00:00
Steve Lamerton
3a194bda7b Add missing code tag before lots of wxEventTypes in the documentation. Although most of the documentation did this quite a few were missing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-06 19:52:14 +00:00
Vadim Zeitlin
cc72cde0ea Mention that wxDV_ROW_LINES is not implemented in the generic version.
wxDV_ROW_LINES is currently only supported by the native implementations of
wxDataViewCtrl.

See #12834.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-04 11:30:40 +00:00
Robert Roebling
e97f9fbd63 Better wording in docs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-20 19:15:15 +00:00
Robert Roebling
9c09addd35 Correction to: Support diabling items in GTK+, see #12686: Allow disabling of wxDVC items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-20 19:13:13 +00:00
Vadim Zeitlin
98f8e6666b Add the possibility to disable invisible wxDataViewCtrl items.
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
2010-12-19 15:02:56 +00:00
Robert Roebling
b955766e88 Document wxDataViewListModel as common abstract base class for
wxDataViewIndexListModel and wxDataViewVirtualListModel.

Add wxDataViewListModel::GetCount() as both have it.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-13 20:12:57 +00:00
Robert Roebling
8eb99915f2 Document recetnyl added name parameter in wxDataViewCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-18 21:40:24 +00:00
Vadim Zeitlin
80ce465c64 Add wxDataViewCtrl::{Set,Get}CurrentItem().
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
2010-08-10 12:53:03 +00:00
Vadim Zeitlin
1e18430004 Don't lose selection in wxDataViewCtrl::Select() under Mac.
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
2010-08-09 21:17:51 +00:00
Václav Slavík
fa629adae4 Add index-based selection functions to wxDataViewListCtrl.
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
2010-07-27 21:45:50 +00:00
Václav Slavík
17de95e4e0 Add item<->row mapping helpers to wxDataViewListCtrl.
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
2010-07-27 21:45:45 +00:00
Robert Roebling
a36bceb633 Tried to make wxDataViewModel docs clearer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-25 19:27:07 +00:00
Robert Roebling
9ca2afd1db Make calls wxDataViewModel::ItemDeleted() etc. non-virtual as they are not supposed to be overridden
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-24 15:30:03 +00:00
Vadim Zeitlin
526954c596 Globally use "wxWindows licence" consistently.
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
2010-07-13 13:29:13 +00:00
Robert Roebling
f4fcd64832 Part II of: Add GetChoice() and GetChoices() getters to all choice renderers and actually mention it in the docs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-16 15:29:35 +00:00
Francesco Montorsi
d86f721af3 Fix various doxygen warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-19 22:35:30 +00:00
Bryan Petty
4d68a949df Fixed typo in wxDataViewIconTextRenderer docs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-02-24 22:09:52 +00:00
Vadim Zeitlin
b5123fb66f Document wxDV_NO_HEADER style.
Closes #11559.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 11:59:55 +00:00
Robert Roebling
fe45d6ffd5 Typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 11:03:17 +00:00
Robert Roebling
8ddda15ba5 Implement and document wxDataViewTreeCtrl::IsContainer(), use it in the sample to not add items to non-containers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-13 14:14:44 +00:00
Vadim Zeitlin
62265c2c67 Allow custom wxDataViewCtrl renderers to easily use attributes.
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
2009-11-10 17:41:11 +00:00
Vadim Zeitlin
80093617fe No changes, just correct a recurring typo in "Override".
Two "r"s should be enough for anybody.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:42 +00:00
Vadim Zeitlin
74d9b8fbd6 Make public and document wxDataView{Index,Virtual}ListModel::GetCount().
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
2009-10-31 15:58:19 +00:00
Vadim Zeitlin
7fadac8872 Make wxDataViewModel::GetAttr() and GetAttrByRow() const.
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
2009-10-24 21:42:04 +00:00
Vadim Zeitlin
43c64cc6c9 Create model and column in wxDataViewTreeCtrl::Create(), not ctor.
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
2009-10-24 21:41:44 +00:00
Vadim Zeitlin
b372f20e7e Add wxDataViewModel::HasValue().
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
2009-10-24 01:03:24 +00:00
Vadim Zeitlin
795dac4c86 Add wxDataViewModel::ChangeValue() and use it in wxDVC implementation.
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
2009-10-23 23:49:16 +00:00
Vadim Zeitlin
c937bcac0f Add ellipsization support to wxDataViewCtrl.
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
2009-10-16 21:35:26 +00:00
Vadim Zeitlin
2d0d781336 Remove wxDataViewTextRendererAttr by merging it with wxDataViewTextRenderer.
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
2009-10-12 13:59:25 +00:00
Vadim Zeitlin
47a8b1e1ff added EVT_DATAVIEW_CACHE_HINT event (closes #9891)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-05 15:21:52 +00:00
Robert Roebling
e4e83d3ad6 Make wxDataViewModel derive from wxRefCounter
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-06-14 14:11:07 +00:00
Robert Roebling
862de7b3d9 Make wxDataViewModel::Compare() const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-10 13:37:26 +00:00
Robert Roebling
3e978cf7b2 Add wxDataViewEvent for vetoing label editing (see also #10495)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-09 20:48:04 +00:00
Francesco Montorsi
c9c59db7d6 wxDataViewColumn derives from wxSettableHeaderColumn, not from wxHeaderColumn
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-06 22:57:03 +00:00
Robert Roebling
220bfe1596 Make all instances of HasEditorCtrl() const, not just a few
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-06 19:07:40 +00:00