@true if this item should be enabled, @false otherwise.
@note Currently disabling items is fully implemented only for the
- native control implementation in wxOSX/Cocoa. This feature is
- only partially supported in the generic version (wxMSW) and
- currently not supported by the wxOSX/Carbon implementation.
+ native control implementation in wxOSX/Cocoa and wxGTK.
+ This feature is only partially supported in the generic
+ version (used by wxMSW) and not supported by the wxOSX/Carbon
+ implementation.
@since 2.9.2
*/
/**
Override this to indicate which wxDataViewItem representing the parent
- of @a item or an invalid wxDataViewItem if the the root item is
+ of @a item or an invalid wxDataViewItem if the root item is
the parent item.
*/
virtual wxDataViewItem GetParent(const wxDataViewItem& item) const = 0;
/**
Override this method to indicate if a container item merely acts as a
headline (or for categorisation) or if it also acts a normal item with
- entries for futher columns. By default returns @false.
+ entries for further columns. By default returns @false.
*/
virtual bool HasContainerColumns(const wxDataViewItem& item) const;
/**
Call this to inform the model that an item has changed.
- This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
event (in which the column fields will not be set) to the user.
*/
bool ItemChanged(const wxDataViewItem& item);
/**
Call this to inform the model that several items have changed.
- This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
events (in which the column fields will not be set) to the user.
*/
bool ItemsChanged(const wxDataViewItemArray& items);
This is also called from wxDataViewCtrl's internal editing code, e.g. when
editing a text field in the control.
- This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
event to the user.
*/
virtual bool ValueChanged(const wxDataViewItem& item,
unsigned int col) const;
/**
- Returns the number of items (i.e. rows) in the list.
+ Returns the number of items (or rows) in the list.
*/
unsigned int GetCount() const;
Multiple selection mode.
@style{wxDV_ROW_LINES}
Use alternating colours for rows if supported by platform and theme.
+ Currently only supported by the native GTK and OS X implementations
+ but not by the generic one.
@style{wxDV_HORIZ_RULES}
Display fine rules between row if supported.
@style{wxDV_VERT_RULES}
void SetCurrentItem(const wxDataViewItem& item);
/**
- Sets the indendation.
+ Sets the indentation.
*/
void SetIndent(int indent);
*/
virtual void SetSelections(const wxDataViewItemArray& sel);
+ /**
+ Programmatically starts editing the given item on the given column.
+ Currently not implemented on wxOSX Carbon.
+ @since 2.9.2
+ */
+
+ virtual void StartEditor(const wxDataViewItem & item, unsigned int column);
+
/**
Unselect the given item.
*/
This method only has effect if multiple selections are allowed.
*/
virtual void UnselectAll();
+
+ /**
+ Sets the row height.
+
+ This function can only be used when all rows have the same height, i.e.
+ when wxDV_VARIABLE_LINE_HEIGHT flag is not used.
+
+ Currently this is implemented in the generic and native GTK versions
+ only and nothing is done (and @false returned) when using OS X port.
+
+ Also notice that this method can only be used to increase the row
+ height compared with the default one (as determined by the return value
+ of wxDataViewRenderer::GetSize()), if it is set to a too small value
+ then the minimum required by the renderers will be used.
+
+ @return @true if the line height was changed or @false otherwise.
+
+ @since 2.9.2
+ */
+ virtual bool SetRowHeight(int rowHeight);
};
Override this to react to double clicks or ENTER.
This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
*/
- virtual bool Activate( wxRect cell,
+ virtual bool Activate( const wxRect& cell,
wxDataViewModel* model,
const wxDataViewItem & item,
unsigned int col );
}
@endcode
*/
- virtual wxControl* CreateEditorCtrl(wxWindow* parent,
- wxRect labelRect,
- const wxVariant& value);
+ virtual wxWindow* CreateEditorCtrl(wxWindow* parent,
+ wxRect labelRect,
+ const wxVariant& value);
/**
Return the attribute to be used for rendering.
}
@endcode
*/
- virtual bool GetValueFromEditorCtrl(wxControl* editor,
+ virtual bool GetValueFromEditorCtrl(wxWindow* editor,
wxVariant& value);
/**
Override this to react to a left click.
This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
*/
- virtual bool LeftClick( wxPoint cursor,
- wxRect cell,
+ virtual bool LeftClick( const wxPoint& cursor,
+ const wxRect& cell,
wxDataViewModel * model,
const wxDataViewItem & item,
unsigned int col );
/**
Override this to start a drag operation. Not yet supported.
*/
- virtual bool StartDrag(wxPoint cursor, wxRect cell,
+ virtual bool StartDrag(const wxPoint& cursor,
+ const wxRect& cell,
wxDataViewModel* model,
const wxDataViewItem & item,
unsigned int col);
/**
Sets the value in the store and update the control.
- This method assumes that the a string is stored in respective
+ This method assumes that the string is stored in respective
column.
*/
void SetTextValue( const wxString &value, unsigned int row, unsigned int col );
/**
Returns the value from the store.
- This method assumes that the a string is stored in respective
+ This method assumes that the string is stored in respective
column.
*/
wxString GetTextValue( unsigned int row, unsigned int col ) const;
/**
Sets the value in the store and update the control.
- This method assumes that the a boolean value is stored in
+ This method assumes that the boolean value is stored in
respective column.
*/
void SetToggleValue( bool value, unsigned int row, unsigned int col );
/**
Returns the value from the store.
- This method assumes that the a boolean value is stored in
+ This method assumes that the boolean value is stored in
respective column.
*/
bool GetToggleValue( unsigned int row, unsigned int col ) const;
void DeleteAllItems();
/**
- Overriden from wxDataViewModel
+ Overridden from wxDataViewModel
*/
virtual unsigned int GetColumnCount() const;
/**
- Overriden from wxDataViewModel
+ Overridden from wxDataViewModel
*/
virtual wxString GetColumnType( unsigned int col ) const;
/**
- Overriden from wxDataViewIndexListModel
+ Overridden from wxDataViewIndexListModel
*/
virtual void GetValueByRow( wxVariant &value,
unsigned int row, unsigned int col ) const;
/**
- Overriden from wxDataViewIndexListModel
+ Overridden from wxDataViewIndexListModel
*/
virtual bool SetValueByRow( const wxVariant &value,
unsigned int row, unsigned int col );
/**
@class wxDataViewTreeStore
- wxDataViewTreeStore is a specialised wxDataViewModel for stroing simple
+ wxDataViewTreeStore is a specialised wxDataViewModel for storing simple
trees very much like wxTreeCtrl does and it offers a similar API.
This class actually stores the entire tree and the values (therefore its name)
int GetChildCount(const wxDataViewItem& parent) const;
/**
- Returns the client data asoociated with the item.
+ Returns the client data associated with the item.
*/
wxClientData* GetItemData(const wxDataViewItem& item) const;
wxDataViewModel* GetModel() const;
/**
- Returns a the position of a context menu event in screen coordinates.
+ Returns the position of a context menu event in screen coordinates.
*/
wxPoint GetPosition() const;
*/
const wxVariant& GetValue() const;
+ /**
+ Can be used to determine whether the new value is going to be accepted
+ in wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE handler.
+
+ Returns @true if editing the item was cancelled or if the user tried to
+ enter an invalid value (refused by wxDataViewRenderer::Validate()). If
+ this method returns @false, it means that the value in the model is
+ about to be changed to the new one.
+
+ Notice that wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event handler can
+ call wxNotifyEvent::Veto() to prevent this from happening.
+
+ Currently support for setting this field and for vetoing the change is
+ only available in the generic version of wxDataViewCtrl, i.e. under MSW
+ but not GTK nor OS X.
+
+ @since 2.9.3
+ */
+ bool IsEditCancelled() const;
+
/**
Sets the column index associated with this event.
*/
void SetColumn(int col);
/**
- For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
+ For @c wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
*/
void SetDataViewColumn(wxDataViewColumn* col);