Commit Graph

95 Commits

Author SHA1 Message Date
Václav Slavík
907f09f44b Replace wxDataViewCtrl::StartEditor() with EditItem().
This is more consistent with other wxDVC methods (taking column pointer
as its argument) and other DVC-like classes where the name EditLabel()
is used for similar purposes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-17 14:05:17 +00:00
Václav Slavík
ee1377e1fa Add wxDataViewCtrl::GetCurrentColumn().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-17 14:05:07 +00:00
Vadim Zeitlin
aadbdd1699 Remove wxHeaderColumn::SetAsSortKey() and only use SetSortOrder().
The two member functions, SetAsSortKey() and SetSortOrder(), were doing almost
the same thing but differently and the former was only used in the generic
wxDataViewCtrl implementation and not implemented in the native GTK/OS X one.

Remove SetAsSortKey() entirely and only keep UnsetAsSortKey() which is still
needed by generic/MSW wxDataViewCtrl. But only SetSortOrder() should now be
called to indicate that the column is used for sorting.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-21 15:07:46 +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
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
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
Vadim Zeitlin
b2fd3bea36 Fix assert when destroying wxDataViewCtrl being edited in wxGTK.
If wxDataViewCtrl was destroyed while showing a generic editor, an assert
occurred in wxWindowBase dtor as the event handler pushed on it by the editor.

Fix this by calling CancelEditing() when the control is destroyed and also fix
the crash in CancelEditing() in wxGTK due to recursive calls to FinishEditing().

Closes #12683.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-26 22:57:01 +00:00
Vadim Zeitlin
b3a8aa924a No changes, just get rid of wxDataViewColumn::GetConstGtkHandle().
If both const and non-const accessors are needed, it's custom to use the same
name for both but in this case we don't even need them as the const version
can always be used, so simply remove the weird and badly named (because the
returned handle is not const at all) GetConstGtkHandle().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-26 22:56:56 +00:00
Dimitri Schoolwerth
d13b34d3f2 No code changes, fixed various typos.
Applied patch by snowleopard2 fixing typos in interface/. Extended the fixes throughout trunk.

Closes #13076.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-03 20:31:32 +00:00
Robert Roebling
3f53dd3a2f Postpone EnsureVisible() to idle as this sometimes seems to be required, fixes #12480: wxDataViewCtrl::EnsureVisible does not make item visible in some
circumstances on GTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-17 19:07:02 +00:00
Robert Roebling
673810eeb8 Moved more code from wxDataViewCtrl to wxDataViewCtrlInternal.
Add new special API for wxDataViewVirtualIndexModel::Reset() as
wxDataViewModel::Clear is something different and needs a different, two
step API under GTK+, one for destroying the current view and one for
rereading the new contents.
Added ::BeforeReset() and ::AfterReset() notifications for that purpose.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-12 20:07:28 +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
62e9285aba Add name argument to wxDataViewCtrl ctor for consistency.
As all the other wxWidgets controls take the parameter in their ctor/Create()
it's unexpected that wxDataViewCtrl does not. Add the name parameter and pass
it to wxWindowBase::CreateBase() as usual.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-08 11:37:57 +00:00
Vadim Zeitlin
17d98558b3 Add wxDataViewCtrl::GTKPathToItem() function and use it.
No real changes, just refactor the code to use a function mapping GtkTreeIter
to our wxDataViewItem and use it instead of duplicating its code everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-08 11:37:37 +00:00
Vadim Zeitlin
6eec70b984 Big wxDataViewCtrl renderer classes refactoring.
This commit adds no changes in functionality but paves way for the upcoming
improvements of wxDataViewCustomRenderer.

First, introduce wxDataViewCustomRendererBase class in order to allow
implementing behaviour common to custom renderers in all ports in this class
instead of triplicating it.

This required splitting monolithic dataview.h in more parts, now we have
wx/dvrenderer.h which defines wxDataViewRendererBase and the new
wxDataViewCustomRendererBase and includes wx/port/dvrenderer.h which define
wxDataViewRenderer and wx/port/dvrenderers.h which defines all the other
renderer classes.

Also bring renderers hierarchy in the generic version closer to other ports:
all standard renderer classes now inherit from wxDataViewRenderer and not
wxDataViewCustomRenderer in for consistency with the other ports.
wxDataViewRenderer itself still does derive from wxDataViewCustomRendererBase,
unlike elsewhere, but this is unavoidable considering that all generic
renderers are custom ones.

Finally do some cleanup in OS X part of the code: correct indentation,
spacing, comment style.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:40:58 +00:00
Vadim Zeitlin
bf68a18d3c No real changes, just make wxDataViewCtrl::Init() private in wxGTK.
The usual convention is for Init() method to be private and to call it from
constructor, follow it in GTK implementation of wxDataViewCtrl too instead of
making it public and calling it from Create().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-24 21:41:30 +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
205bdf2069 Implement icon text column using native GTK renderers in wxDVC.
This has a possible advantage of a more native look and feel (although it's
hard to tell the difference between drawing the icon ourselves and how the
default GTK+ renderer does it to be honest) and a very real advantage of
allowing to edit in place cells with icons. It also reduces code duplication
in GTK implementation.

Modify the sample to make the icon-text column in the list model editable to
show that it works. This required storing the values of the second column as
well, so do it in its own array and to avoid calling it "m_array2", rename the
existing m_array to m_textColValues (which accounts for most of the diff in
the sample) and call the new one m_iconColValues.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 01:29:06 +00:00
Vadim Zeitlin
b74399b982 Correct bug with items without attributes in wxGTK wxDVC.
After the change to the sample in r62390 it turned out that wxGTK version
didn't handle items without attributes in a column where other items did have
attributes neither -- they inherited the last used attribute.

Fix this by remembering whether we are using any non-default attributes or not
and resetting them if we do.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:43:57 +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
ddb44248a6 Fixed wxDataViewCtrl::Set{Foreground,Background}Colour() to work under GTK too.
Implement DoApplyWidgetStyle() in wxGTK version of wxDataViewCtrl to propagate
the main window style to the GtkTreeView which is what the user mostly sees.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-26 16:43:30 +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
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Paul Cornett
8c2654ce3d build fixes and cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-20 17:50:51 +00:00
Robert Roebling
15cac64f75 New eventb based Drag interface for wxDataViewCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-19 22:27:06 +00:00
Robert Roebling
739a839903 Added wxDataViewCtrl::IsExpanded(item)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-16 21:23:55 +00:00
Vadim Zeitlin
0c5209a808 wxDataViewColumn doesn't need to have wxRTTI
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-07 16:07:54 +00:00
Vadim Zeitlin
3cbd3136f9 removed accidentally left in in r57161 pure virtual function marker
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-07 16:04:48 +00:00
Vadim Zeitlin
e2bfe6731e - Rewrite wxHeaderCtrl to be virtual-like: even if we don't need an infinite
number of columns in it, it turns out that getting column information from
  the associated control is much easier than copying it into the control.
- Provide wxHeaderCtrlSimple derived class which can be used easily if
  callback approach of wxHeaderCtrl is not needed.
- Because of wxHeaderCtrl virtualization, port-specific implementations of
  wxHeaderColumn are not needed any more and were removed.
- Use wxHeaderCtrl in the generic wxDataViewCtrl: this means that column
  events are broken right now in it as they haven't been implemented by
  wxHeaderCtrl yet, this will be fixed a.s.a.p.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-07 14:47:55 +00:00
Vadim Zeitlin
bc0289bf5e no changes, just remove trailing whitespace
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-07 14:19:18 +00:00
Vadim Zeitlin
56873923f3 extract (and expand and clean up and document) the header window implementation used inside the generic wxDataViewCtrl in a separate wxHeaderCtrl class which could be reused in (generic) wxListCtrl and, most importantly, wxGrid later
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-03 21:53:10 +00:00
Robert Roebling
7448d67c49 Added wxChoice renderer to wxDataViewCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-10 14:08:38 +00:00
Paul Cornett
48200154f4 replace m_insertCallback with a virtual function, contrary to the old comments a virtual works just fine
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-29 15:46:48 +00:00
Robert Roebling
19723525ce Added InsertColumn( pos, col ), some reformating
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-21 08:47:21 +00:00
Robert Roebling
419a360703 Corrected/added support for column headers with icon and text
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-12 20:07:53 +00:00
Robert Roebling
f2b7492a88 By default, align renderers as column header under GTK+, too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-08 10:39:57 +00:00
Robert Roebling
0bdfa38835 Support renderer::LeftClick() in generic code, removed unsupported RightClick(), corrected docs, added test to sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-05 12:09:15 +00:00
Robert Roebling
99c75ebc5e Patch from Hartwig and me for implementing reorderable dataview columns. Works on OS X and GTK+, breaks OS X a litte
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-26 18:30:56 +00:00
Paul Cornett
901a462fd5 make access for virtuals match base
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-20 06:08:00 +00:00
Robert Roebling
33ba5a0562 Added wxDataViewListIndexModel::Reset(), clarified and corrected wxDataViewModel::Cleared(), corrected sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-17 13:56:28 +00:00
Robert Roebling
888dde65f4 DC reorganization
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 13:48:22 +00:00
Robert Roebling
0e9cfa5109 remove warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-15 20:11:30 +00:00
Robert Roebling
4264606eed Add wxDataViewTextRendererAttr, blind noop under wxMac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-08 22:51:58 +00:00
Robert Roebling
f69c03def9 Use a private GtkCellRendererText for rendering text in a wxDataViewCustomRenderer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-22 11:26:04 +00:00
Robert Roebling
52e750fc75 Added wxDataViewCustomRenderer::RenderText() for renderer simple text in platform dependent way, added wxDataViewSpinRenderer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-20 20:09:10 +00:00
Robert Roebling
736fe67c66 Added PrependColumn methods and short cuts. Added test for DeleteColumn to sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-18 20:56:38 +00:00
Václav Slavík
d350fbec22 compilation fixed for wxDataViewCtrl: almost no class was properly exported in wxGTK version
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-10 19:44:26 +00:00
Robert Roebling
aed836f372 Implement and test wxDataViewCtrl::GetColumnPosition() for GTK+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-14 20:30:05 +00:00
Robert Roebling
453091c269 Add wxDataViewCtrl::GetColumnPosition() stubs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-13 13:29:19 +00:00
Robert Roebling
21f47fb900 Add wxDataViewCtrl::GetSortingColumn() stubs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-13 12:57:40 +00:00