Merge branch 'dvc': miscellaneous wxDataViewCtrl-related fixes
This commit is contained in:
@@ -69,10 +69,12 @@ All (GUI):
|
||||
- Add support for wxAuiManager and wxAuiPaneInfo to XRC (Andrea Zanellato).
|
||||
- Add support for wxSL_MIN_MAX_LABELS and wxSL_VALUE_LABEL to XRC (ousnius).
|
||||
- Update Scintilla to v3.6.3 (Paul Kulchenko).
|
||||
- Make wxDataViewCtrl::Expand() expand ancestors in native ports too.
|
||||
|
||||
wxGTK:
|
||||
|
||||
- Implement setting link colours in wxHyperlinkCtrl for GTK+3 (Hanmac).
|
||||
- Support background colour in wxDataViewCtrl attributes.
|
||||
|
||||
wxMSW:
|
||||
|
||||
@@ -87,6 +89,8 @@ wxOSX:
|
||||
- Remove extra borders around wxFilePickerCtrl (John Roberts).
|
||||
- Set up extensions filter correctly in wxFileDialog (nick863).
|
||||
- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2).
|
||||
- Implement wxDataViewChoiceByIndexRenderer (wanup).
|
||||
- Fix unnecessary indentation in list-like wxDataViewCtrl (Andreas Falkenhahn).
|
||||
|
||||
Unix:
|
||||
|
||||
|
@@ -662,6 +662,9 @@ public:
|
||||
return !allow;
|
||||
}
|
||||
|
||||
// Return true if multi column sort is currently allowed.
|
||||
virtual bool IsMultiColumnSortAllowed() const { return false; }
|
||||
|
||||
// This should also be overridden to actually use the specified column for
|
||||
// sorting if using multiple columns is supported.
|
||||
virtual void ToggleSortByColumn(int WXUNUSED(column)) { }
|
||||
@@ -702,8 +705,8 @@ public:
|
||||
virtual void SelectAll() = 0;
|
||||
virtual void UnselectAll() = 0;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item ) = 0;
|
||||
virtual void ExpandAncestors( const wxDataViewItem & item );
|
||||
void Expand( const wxDataViewItem & item );
|
||||
void ExpandAncestors( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item ) = 0;
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
|
||||
|
||||
@@ -744,6 +747,10 @@ protected:
|
||||
virtual void DoSetExpanderColumn() = 0 ;
|
||||
virtual void DoSetIndent() = 0;
|
||||
|
||||
// Just expand this item assuming it is already shown, i.e. its parent has
|
||||
// been already expanded using ExpandAncestors().
|
||||
virtual void DoExpand(const wxDataViewItem & item) = 0;
|
||||
|
||||
private:
|
||||
// Implementation of the public Set/GetCurrentItem() methods which are only
|
||||
// called in multi selection case (for single selection controls their
|
||||
@@ -766,25 +773,32 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxDataViewEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
|
||||
: wxNotifyEvent(commandType, winid),
|
||||
m_item(0),
|
||||
m_col(-1),
|
||||
m_model(NULL),
|
||||
m_value(wxNullVariant),
|
||||
m_column(NULL),
|
||||
m_pos(-1,-1),
|
||||
m_cacheFrom(0),
|
||||
m_cacheTo(0),
|
||||
m_editCancelled(false)
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
, m_dataObject(NULL),
|
||||
m_dataBuffer(NULL),
|
||||
m_dataSize(0),
|
||||
m_dragFlags(0),
|
||||
m_dropEffect(wxDragNone)
|
||||
#endif
|
||||
{ }
|
||||
// Default ctor, normally shouldn't be used and mostly exists only for
|
||||
// backwards compatibility.
|
||||
wxDataViewEvent()
|
||||
: wxNotifyEvent()
|
||||
{
|
||||
Init(NULL, NULL, wxDataViewItem());
|
||||
}
|
||||
|
||||
// Constructor for the events affecting columns (and possibly also items).
|
||||
wxDataViewEvent(wxEventType evtType,
|
||||
wxDataViewCtrlBase* dvc,
|
||||
wxDataViewColumn* column,
|
||||
const wxDataViewItem& item = wxDataViewItem())
|
||||
: wxNotifyEvent(evtType, dvc->GetId())
|
||||
{
|
||||
Init(dvc, column, item);
|
||||
}
|
||||
|
||||
// Constructor for the events affecting only the items.
|
||||
wxDataViewEvent(wxEventType evtType,
|
||||
wxDataViewCtrlBase* dvc,
|
||||
const wxDataViewItem& item)
|
||||
: wxNotifyEvent(evtType, dvc->GetId())
|
||||
{
|
||||
Init(dvc, NULL, item);
|
||||
}
|
||||
|
||||
wxDataViewEvent(const wxDataViewEvent& event)
|
||||
: wxNotifyEvent(event),
|
||||
@@ -808,13 +822,8 @@ public:
|
||||
{ }
|
||||
|
||||
wxDataViewItem GetItem() const { return m_item; }
|
||||
void SetItem( const wxDataViewItem &item ) { m_item = item; }
|
||||
|
||||
int GetColumn() const { return m_col; }
|
||||
void SetColumn( int col ) { m_col = col; }
|
||||
|
||||
wxDataViewModel* GetModel() const { return m_model; }
|
||||
void SetModel( wxDataViewModel *model ) { m_model = model; }
|
||||
|
||||
const wxVariant &GetValue() const { return m_value; }
|
||||
void SetValue( const wxVariant &value ) { m_value = value; }
|
||||
@@ -824,7 +833,6 @@ public:
|
||||
void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; }
|
||||
|
||||
// for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
|
||||
void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; }
|
||||
wxDataViewColumn *GetDataViewColumn() const { return m_column; }
|
||||
|
||||
// for wxEVT_DATAVIEW_CONTEXT_MENU only
|
||||
@@ -857,6 +865,20 @@ public:
|
||||
|
||||
virtual wxEvent *Clone() const wxOVERRIDE { return new wxDataViewEvent(*this); }
|
||||
|
||||
// These methods shouldn't be used outside of wxWidgets and wxWidgets
|
||||
// itself doesn't use them any longer neither as it constructs the events
|
||||
// with the appropriate ctors directly.
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
|
||||
void SetModel( wxDataViewModel *model ) { m_model = model; }
|
||||
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
|
||||
void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; }
|
||||
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
|
||||
void SetColumn( int col ) { m_col = col; }
|
||||
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
|
||||
void SetItem( const wxDataViewItem &item ) { m_item = item; }
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
protected:
|
||||
wxDataViewItem m_item;
|
||||
int m_col;
|
||||
@@ -880,6 +902,11 @@ protected:
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
private:
|
||||
// Common part of non-copy ctors.
|
||||
void Init(wxDataViewCtrlBase* dvc,
|
||||
wxDataViewColumn* column,
|
||||
const wxDataViewItem& item);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent);
|
||||
};
|
||||
|
||||
|
@@ -52,37 +52,97 @@ public:
|
||||
}
|
||||
|
||||
// implement wxHeaderColumnBase methods
|
||||
virtual void SetTitle(const wxString& title) { m_title = title; UpdateDisplay(); }
|
||||
virtual wxString GetTitle() const { return m_title; }
|
||||
virtual void SetTitle(const wxString& title) wxOVERRIDE
|
||||
{
|
||||
m_title = title;
|
||||
UpdateWidth();
|
||||
}
|
||||
virtual wxString GetTitle() const wxOVERRIDE
|
||||
{
|
||||
return m_title;
|
||||
}
|
||||
|
||||
virtual void SetWidth(int width) { m_width = width; UpdateDisplay(); }
|
||||
virtual int GetWidth() const;
|
||||
virtual void SetWidth(int width) wxOVERRIDE
|
||||
{
|
||||
// As a small optimization, use this method to avoid calling
|
||||
// UpdateWidth() if the width didn't really change, even if we don't
|
||||
// care about its return value.
|
||||
(void)WXUpdateWidth(width);
|
||||
}
|
||||
virtual int GetWidth() const wxOVERRIDE;
|
||||
|
||||
virtual void SetMinWidth(int minWidth) { m_minWidth = minWidth; UpdateDisplay(); }
|
||||
virtual int GetMinWidth() const { return m_minWidth; }
|
||||
virtual void SetMinWidth(int minWidth) wxOVERRIDE
|
||||
{
|
||||
m_minWidth = minWidth;
|
||||
UpdateWidth();
|
||||
}
|
||||
virtual int GetMinWidth() const wxOVERRIDE
|
||||
{
|
||||
return m_minWidth;
|
||||
}
|
||||
|
||||
virtual void SetAlignment(wxAlignment align) { m_align = align; UpdateDisplay(); }
|
||||
virtual wxAlignment GetAlignment() const { return m_align; }
|
||||
virtual void SetAlignment(wxAlignment align) wxOVERRIDE
|
||||
{
|
||||
m_align = align;
|
||||
UpdateDisplay();
|
||||
}
|
||||
virtual wxAlignment GetAlignment() const wxOVERRIDE
|
||||
{
|
||||
return m_align;
|
||||
}
|
||||
|
||||
virtual void SetFlags(int flags) { m_flags = flags; UpdateDisplay(); }
|
||||
virtual int GetFlags() const { return m_flags; }
|
||||
virtual void SetFlags(int flags) wxOVERRIDE
|
||||
{
|
||||
m_flags = flags;
|
||||
UpdateDisplay();
|
||||
}
|
||||
virtual int GetFlags() const wxOVERRIDE
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
virtual bool IsSortKey() const { return m_sort; }
|
||||
virtual bool IsSortKey() const wxOVERRIDE
|
||||
{
|
||||
return m_sort;
|
||||
}
|
||||
|
||||
virtual void UnsetAsSortKey();
|
||||
virtual void UnsetAsSortKey() wxOVERRIDE;
|
||||
|
||||
virtual void SetSortOrder(bool ascending);
|
||||
virtual void SetSortOrder(bool ascending) wxOVERRIDE;
|
||||
|
||||
virtual bool IsSortOrderAscending() const { return m_sortAscending; }
|
||||
virtual bool IsSortOrderAscending() const wxOVERRIDE
|
||||
{
|
||||
return m_sortAscending;
|
||||
}
|
||||
|
||||
virtual void SetBitmap( const wxBitmap& bitmap ) { wxDataViewColumnBase::SetBitmap(bitmap); UpdateDisplay(); }
|
||||
virtual void SetBitmap( const wxBitmap& bitmap ) wxOVERRIDE
|
||||
{
|
||||
wxDataViewColumnBase::SetBitmap(bitmap);
|
||||
UpdateWidth();
|
||||
}
|
||||
|
||||
// This method is specific to the generic implementation and is used only
|
||||
// by wxWidgets itself.
|
||||
bool WXUpdateWidth(int width)
|
||||
{
|
||||
if ( width == m_width )
|
||||
return false;
|
||||
|
||||
m_width = width;
|
||||
UpdateWidth();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init(int width, wxAlignment align, int flags);
|
||||
|
||||
// These methods forward to wxDataViewCtrl::OnColumnChange() and
|
||||
// OnColumnWidthChange() respectively, i.e. the latter is stronger than the
|
||||
// former.
|
||||
void UpdateDisplay();
|
||||
void UpdateWidth();
|
||||
|
||||
wxString m_title;
|
||||
int m_width,
|
||||
@@ -139,63 +199,62 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDataViewCtrlNameStr);
|
||||
|
||||
virtual bool AssociateModel( wxDataViewModel *model );
|
||||
virtual bool AssociateModel( wxDataViewModel *model ) wxOVERRIDE;
|
||||
|
||||
virtual bool AppendColumn( wxDataViewColumn *col );
|
||||
virtual bool PrependColumn( wxDataViewColumn *col );
|
||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||
virtual bool AppendColumn( wxDataViewColumn *col ) wxOVERRIDE;
|
||||
virtual bool PrependColumn( wxDataViewColumn *col ) wxOVERRIDE;
|
||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ) wxOVERRIDE;
|
||||
|
||||
virtual void DoSetExpanderColumn();
|
||||
virtual void DoSetIndent();
|
||||
virtual void DoSetExpanderColumn() wxOVERRIDE;
|
||||
virtual void DoSetIndent() wxOVERRIDE;
|
||||
|
||||
virtual unsigned int GetColumnCount() const;
|
||||
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const;
|
||||
virtual bool DeleteColumn( wxDataViewColumn *column );
|
||||
virtual bool ClearColumns();
|
||||
virtual int GetColumnPosition( const wxDataViewColumn *column ) const;
|
||||
virtual unsigned int GetColumnCount() const wxOVERRIDE;
|
||||
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const wxOVERRIDE;
|
||||
virtual bool DeleteColumn( wxDataViewColumn *column ) wxOVERRIDE;
|
||||
virtual bool ClearColumns() wxOVERRIDE;
|
||||
virtual int GetColumnPosition( const wxDataViewColumn *column ) const wxOVERRIDE;
|
||||
|
||||
virtual wxDataViewColumn *GetSortingColumn() const;
|
||||
virtual wxVector<wxDataViewColumn *> GetSortingColumns() const;
|
||||
virtual wxDataViewColumn *GetSortingColumn() const wxOVERRIDE;
|
||||
virtual wxVector<wxDataViewColumn *> GetSortingColumns() const wxOVERRIDE;
|
||||
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel );
|
||||
virtual void Select( const wxDataViewItem & item );
|
||||
virtual void Unselect( const wxDataViewItem & item );
|
||||
virtual bool IsSelected( const wxDataViewItem & item ) const;
|
||||
virtual int GetSelectedItemsCount() const wxOVERRIDE;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const wxOVERRIDE;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel ) wxOVERRIDE;
|
||||
virtual void Select( const wxDataViewItem & item ) wxOVERRIDE;
|
||||
virtual void Unselect( const wxDataViewItem & item ) wxOVERRIDE;
|
||||
virtual bool IsSelected( const wxDataViewItem & item ) const wxOVERRIDE;
|
||||
|
||||
virtual void SelectAll();
|
||||
virtual void UnselectAll();
|
||||
virtual void SelectAll() wxOVERRIDE;
|
||||
virtual void UnselectAll() wxOVERRIDE;
|
||||
|
||||
virtual void EnsureVisible( const wxDataViewItem & item,
|
||||
const wxDataViewColumn *column = NULL );
|
||||
const wxDataViewColumn *column = NULL ) wxOVERRIDE;
|
||||
virtual void HitTest( const wxPoint & point, wxDataViewItem & item,
|
||||
wxDataViewColumn* &column ) const;
|
||||
wxDataViewColumn* &column ) const wxOVERRIDE;
|
||||
virtual wxRect GetItemRect( const wxDataViewItem & item,
|
||||
const wxDataViewColumn *column = NULL ) const;
|
||||
const wxDataViewColumn *column = NULL ) const wxOVERRIDE;
|
||||
|
||||
virtual bool SetRowHeight( int rowHeight );
|
||||
virtual bool SetRowHeight( int rowHeight ) wxOVERRIDE;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item );
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const;
|
||||
virtual void Collapse( const wxDataViewItem & item ) wxOVERRIDE;
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const wxOVERRIDE;
|
||||
|
||||
virtual void SetFocus();
|
||||
virtual void SetFocus() wxOVERRIDE;
|
||||
|
||||
virtual bool SetFont(const wxFont & font);
|
||||
virtual bool SetFont(const wxFont & font) wxOVERRIDE;
|
||||
|
||||
virtual bool AllowMultiColumnSort(bool allow);
|
||||
virtual bool IsMultiColumnSortAllowed() { return m_allowMultiColumnSort; }
|
||||
virtual void ToggleSortByColumn(int column);
|
||||
virtual bool AllowMultiColumnSort(bool allow) wxOVERRIDE;
|
||||
virtual bool IsMultiColumnSortAllowed() const wxOVERRIDE { return m_allowMultiColumnSort; }
|
||||
virtual void ToggleSortByColumn(int column) wxOVERRIDE;
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual bool EnableDragSource( const wxDataFormat &format );
|
||||
virtual bool EnableDropTarget( const wxDataFormat &format );
|
||||
virtual bool EnableDragSource( const wxDataFormat &format ) wxOVERRIDE;
|
||||
virtual bool EnableDropTarget( const wxDataFormat &format ) wxOVERRIDE;
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
virtual wxBorder GetDefaultBorder() const wxOVERRIDE;
|
||||
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) wxOVERRIDE;
|
||||
|
||||
// These methods are specific to generic wxDataViewCtrl implementation and
|
||||
// should not be used in portable code.
|
||||
@@ -203,12 +262,12 @@ public:
|
||||
void SetAlternateRowColour(const wxColour& colour);
|
||||
|
||||
protected:
|
||||
virtual void EnsureVisible( int row, int column );
|
||||
void EnsureVisibleRowCol( int row, int column );
|
||||
|
||||
// Notice that row here may be invalid (i.e. >= GetRowCount()), this is not
|
||||
// an error and this function simply returns an invalid item in this case.
|
||||
virtual wxDataViewItem GetItemByRow( unsigned int row ) const;
|
||||
virtual int GetRowByItem( const wxDataViewItem & item ) const;
|
||||
wxDataViewItem GetItemByRow( unsigned int row ) const;
|
||||
int GetRowByItem( const wxDataViewItem & item ) const;
|
||||
|
||||
// Mark the column as being used or not for sorting.
|
||||
void UseColumnForSorting(int idx);
|
||||
@@ -233,6 +292,9 @@ public: // utility functions not part of the API
|
||||
// update the display after a change to an individual column
|
||||
void OnColumnChange(unsigned int idx);
|
||||
|
||||
// update after the column width changes, also calls OnColumnChange()
|
||||
void OnColumnWidthChange(unsigned int idx);
|
||||
|
||||
// update after a change to the number of columns
|
||||
void OnColumnsCountChanged();
|
||||
|
||||
@@ -247,13 +309,15 @@ public: // utility functions not part of the API
|
||||
// return the column displayed at the given position in the control
|
||||
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
|
||||
|
||||
virtual wxDataViewColumn *GetCurrentColumn() const;
|
||||
virtual wxDataViewColumn *GetCurrentColumn() const wxOVERRIDE;
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
virtual void OnInternalIdle() wxOVERRIDE;
|
||||
|
||||
private:
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
virtual wxDataViewItem DoGetCurrentItem() const wxOVERRIDE;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item) wxOVERRIDE;
|
||||
|
||||
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
|
||||
|
||||
void InvalidateColBestWidths();
|
||||
void InvalidateColBestWidth(int idx);
|
||||
@@ -289,12 +353,12 @@ private:
|
||||
|
||||
private:
|
||||
void OnSize( wxSizeEvent &event );
|
||||
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size);
|
||||
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size) wxOVERRIDE;
|
||||
|
||||
// we need to return a special WM_GETDLGCODE value to process just the
|
||||
// arrows but let the other navigation characters through
|
||||
#ifdef __WXMSW__
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
|
||||
#endif // __WXMSW__
|
||||
|
||||
WX_FORWARD_TO_SCROLL_HELPER()
|
||||
|
@@ -161,7 +161,6 @@ public:
|
||||
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) wxOVERRIDE;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item ) wxOVERRIDE;
|
||||
virtual void Collapse( const wxDataViewItem & item ) wxOVERRIDE;
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const wxOVERRIDE;
|
||||
|
||||
@@ -190,6 +189,8 @@ protected:
|
||||
virtual void DoSetExpanderColumn() wxOVERRIDE;
|
||||
virtual void DoSetIndent() wxOVERRIDE;
|
||||
|
||||
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
|
||||
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
|
||||
|
||||
private:
|
||||
|
@@ -447,7 +447,6 @@ public:
|
||||
virtual void Collapse(const wxDataViewItem& item);
|
||||
virtual void EnsureVisible(const wxDataViewItem& item,
|
||||
wxDataViewColumn const* columnPtr);
|
||||
virtual void Expand(const wxDataViewItem& item);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxRect GetRectangle(const wxDataViewItem& item,
|
||||
wxDataViewColumn const* columnPtr);
|
||||
@@ -490,6 +489,9 @@ public:
|
||||
// other methods (inherited from wxDataViewWidgetImpl)
|
||||
//
|
||||
virtual void DoSetIndent(int indent);
|
||||
|
||||
virtual void DoExpand(const wxDataViewItem& item);
|
||||
|
||||
virtual void HitTest(const wxPoint& point,
|
||||
wxDataViewItem& item,
|
||||
wxDataViewColumn*& columnPtr) const;
|
||||
|
@@ -62,7 +62,6 @@ public:
|
||||
virtual bool Add (wxDataViewItem const& parent, wxDataViewItemArray const& itesm) = 0; // adds a items to the native control
|
||||
virtual void Collapse (wxDataViewItem const& item) = 0; // collapses the passed item in the native control
|
||||
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // ensures that the passed item's value in the passed column is visible (column pointer can be NULL)
|
||||
virtual void Expand (wxDataViewItem const& item) = 0; // expands the passed item in the native control
|
||||
virtual unsigned int GetCount (void) const = 0; // returns the number of items in the native control
|
||||
virtual wxRect GetRectangle (wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // returns the rectangle that is used by the passed item and column in the native control
|
||||
virtual bool IsExpanded (wxDataViewItem const& item) const = 0; // checks if the passed item is expanded in the native control
|
||||
@@ -104,6 +103,8 @@ public:
|
||||
// other methods
|
||||
//
|
||||
virtual void DoSetIndent (int indent) = 0; // sets the indention in the native control
|
||||
virtual void DoExpand (wxDataViewItem const& item) = 0; // expands the passed item in the native control
|
||||
|
||||
virtual void HitTest (wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const = 0; // return the item and column pointer that contains with the passed point
|
||||
virtual void SetRowHeight(wxDataViewItem const& item, unsigned int height) = 0; // sets the height of the row containg the passed item in the native control
|
||||
virtual void OnSize (void) = 0; // updates the layout of the native control after a size event
|
||||
|
@@ -169,7 +169,6 @@ public:
|
||||
|
||||
virtual void Collapse( const wxDataViewItem& item) wxOVERRIDE;
|
||||
virtual void EnsureVisible(const wxDataViewItem& item, const wxDataViewColumn* columnPtr=NULL) wxOVERRIDE;
|
||||
virtual void Expand(const wxDataViewItem& item) wxOVERRIDE;
|
||||
virtual bool IsExpanded(const wxDataViewItem & item) const wxOVERRIDE;
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
@@ -271,6 +270,8 @@ protected:
|
||||
virtual void DoSetExpanderColumn() wxOVERRIDE;
|
||||
virtual void DoSetIndent() wxOVERRIDE;
|
||||
|
||||
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
|
||||
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
|
||||
// event handling
|
||||
|
@@ -57,11 +57,9 @@ public:
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer);
|
||||
@@ -86,8 +84,6 @@ private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer);
|
||||
};
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
|
||||
// -------------------------------------
|
||||
// wxDataViewChoiceRenderer
|
||||
// -------------------------------------
|
||||
@@ -104,11 +100,9 @@ public:
|
||||
wxString GetChoice(size_t index) const { return m_choices[index]; }
|
||||
const wxArrayString& GetChoices() const { return m_choices; }
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxArrayString m_choices;
|
||||
@@ -116,7 +110,24 @@ private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewChoiceRenderer);
|
||||
};
|
||||
|
||||
#endif // wxOSX_USE_COCOA
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataViewChoiceByIndexRenderer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewChoiceByIndexRenderer: public wxDataViewChoiceRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewChoiceByIndexRenderer(const wxArrayString& choices,
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
|
||||
int alignment = wxDVR_DEFAULT_ALIGNMENT);
|
||||
|
||||
virtual bool SetValue(const wxVariant& value) wxOVERRIDE;
|
||||
virtual bool GetValue(wxVariant& value) const wxOVERRIDE;
|
||||
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col) wxOVERRIDE;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewIconTextRenderer
|
||||
@@ -132,11 +143,9 @@ public:
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer);
|
||||
@@ -157,11 +166,9 @@ public:
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer);
|
||||
@@ -183,11 +190,9 @@ public:
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer);
|
||||
@@ -208,11 +213,9 @@ public:
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col);
|
||||
#endif // Cocoa
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer);
|
||||
|
@@ -1299,7 +1299,7 @@ public:
|
||||
ensures that the item itself as well as all ancestor
|
||||
items have been read from the model by the control.
|
||||
*/
|
||||
virtual void ExpandAncestors( const wxDataViewItem & item );
|
||||
void ExpandAncestors( const wxDataViewItem & item );
|
||||
|
||||
/**
|
||||
Returns pointer to the column. @a pos refers to the position in the
|
||||
|
@@ -739,14 +739,14 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l
|
||||
ilist->Add( wxIcon(wx_small_xpm) );
|
||||
tc->AssignImageList( ilist );
|
||||
|
||||
wxDataViewItem parent =
|
||||
const wxDataViewItem root =
|
||||
tc->AppendContainer( wxDataViewItem(0), "The Root", 0 );
|
||||
tc->AppendItem( parent, "Child 1", 0 );
|
||||
tc->AppendItem( parent, "Child 2", 0 );
|
||||
tc->AppendItem( parent, "Child 3, very long, long, long, long", 0 );
|
||||
tc->AppendItem( root, "Child 1", 0 );
|
||||
tc->AppendItem( root, "Child 2", 0 );
|
||||
tc->AppendItem( root, "Child 3, very long, long, long, long", 0 );
|
||||
|
||||
wxDataViewItem cont =
|
||||
tc->AppendContainer( parent, "Container child", 0 );
|
||||
tc->AppendContainer( root, "Container child", 0 );
|
||||
tc->AppendItem( cont, "Child 4", 0 );
|
||||
tc->AppendItem( cont, "Child 5", 0 );
|
||||
|
||||
|
@@ -470,7 +470,8 @@ bool MyListModel::GetAttrByRow( unsigned int row, unsigned int col,
|
||||
case Col_IconText:
|
||||
if ( !(row % 2) )
|
||||
return false;
|
||||
attr.SetColour(*wxLIGHT_GREY);
|
||||
attr.SetColour(*wxYELLOW);
|
||||
attr.SetBackgroundColour(*wxLIGHT_GREY);
|
||||
break;
|
||||
|
||||
case Col_TextWithAttr:
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include "wx/datectrl.h"
|
||||
#include "wx/except.h"
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/choice.h"
|
||||
#include "wx/imaglist.h"
|
||||
@@ -669,18 +670,18 @@ wxDataViewCtrl* wxDataViewRendererBase::GetView() const
|
||||
|
||||
bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect labelRect )
|
||||
{
|
||||
wxDataViewCtrl* dv_ctrl = GetOwner()->GetOwner();
|
||||
wxDataViewColumn* const column = GetOwner();
|
||||
wxDataViewCtrl* const dv_ctrl = column->GetOwner();
|
||||
|
||||
// Before doing anything we send an event asking if editing of this item is really wanted.
|
||||
wxDataViewEvent start_event( wxEVT_DATAVIEW_ITEM_START_EDITING, dv_ctrl->GetId() );
|
||||
start_event.SetDataViewColumn( GetOwner() );
|
||||
start_event.SetModel( dv_ctrl->GetModel() );
|
||||
start_event.SetItem( item );
|
||||
start_event.SetEventObject( dv_ctrl );
|
||||
dv_ctrl->GetEventHandler()->ProcessEvent( start_event );
|
||||
if( !start_event.IsAllowed() )
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_START_EDITING, dv_ctrl, column, item);
|
||||
dv_ctrl->GetEventHandler()->ProcessEvent( event );
|
||||
if( !event.IsAllowed() )
|
||||
return false;
|
||||
|
||||
// Remember the item being edited for use in FinishEditing() later.
|
||||
m_item = item;
|
||||
|
||||
unsigned int col = GetOwner()->GetModelColumn();
|
||||
const wxVariant& value = CheckedGetValue(dv_ctrl->GetModel(), item, col);
|
||||
|
||||
@@ -688,7 +689,10 @@ bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect la
|
||||
|
||||
// there might be no editor control for the given item
|
||||
if(!m_editorCtrl)
|
||||
{
|
||||
m_item = wxDataViewItem();
|
||||
return false;
|
||||
}
|
||||
|
||||
wxDataViewEditorCtrlEvtHandler *handler =
|
||||
new wxDataViewEditorCtrlEvtHandler( m_editorCtrl, (wxDataViewRenderer*) this );
|
||||
@@ -706,17 +710,10 @@ bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect la
|
||||
|
||||
void wxDataViewRendererBase::NotifyEditingStarted(const wxDataViewItem& item)
|
||||
{
|
||||
// Remember the item being edited for use in FinishEditing() later.
|
||||
m_item = item;
|
||||
|
||||
wxDataViewColumn* const column = GetOwner();
|
||||
wxDataViewCtrl* const dv_ctrl = column->GetOwner();
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_EDITING_STARTED, dv_ctrl->GetId() );
|
||||
event.SetDataViewColumn( column );
|
||||
event.SetModel( dv_ctrl->GetModel() );
|
||||
event.SetItem( item );
|
||||
event.SetEventObject( dv_ctrl );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EDITING_STARTED, dv_ctrl, column, item);
|
||||
dv_ctrl->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
@@ -756,7 +753,8 @@ bool wxDataViewRendererBase::FinishEditing()
|
||||
wxVariant value;
|
||||
const bool gotValue = GetValueFromEditorCtrl(m_editorCtrl, value);
|
||||
|
||||
wxDataViewCtrl* dv_ctrl = GetOwner()->GetOwner();
|
||||
wxDataViewColumn* const column = GetOwner();
|
||||
wxDataViewCtrl* const dv_ctrl = column->GetOwner();
|
||||
|
||||
DestroyEditControl();
|
||||
|
||||
@@ -769,14 +767,9 @@ bool wxDataViewRendererBase::FinishEditing()
|
||||
unsigned int col = GetOwner()->GetModelColumn();
|
||||
|
||||
// Now we should send Editing Done event
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_EDITING_DONE, dv_ctrl->GetId() );
|
||||
event.SetDataViewColumn( GetOwner() );
|
||||
event.SetModel( dv_ctrl->GetModel() );
|
||||
event.SetItem( m_item );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EDITING_DONE, dv_ctrl, column, m_item);
|
||||
event.SetValue( value );
|
||||
event.SetColumn( col );
|
||||
event.SetEditCanceled( !isValid );
|
||||
event.SetEventObject( dv_ctrl );
|
||||
dv_ctrl->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
bool accepted = false;
|
||||
@@ -826,6 +819,11 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned column)
|
||||
{
|
||||
// This method is called by the native control, so we shouldn't allow
|
||||
// exceptions to escape from it.
|
||||
wxTRY
|
||||
{
|
||||
|
||||
// Now check if we have a value and remember it for rendering it later.
|
||||
// Notice that we do it even if it's null, as the cell should be empty then
|
||||
// and not show the last used value.
|
||||
@@ -857,6 +855,15 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
|
||||
|
||||
SetEnabled(enabled);
|
||||
|
||||
}
|
||||
wxCATCH_ALL
|
||||
(
|
||||
// There is not much we can do about it here, just log it and don't
|
||||
// show anything in this cell.
|
||||
wxLogDebug("Retrieving the value from the model threw an exception");
|
||||
SetValue(wxVariant());
|
||||
)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1002,12 +1009,17 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text,
|
||||
if ( !GetOwner()->GetOwner()->IsEnabled() )
|
||||
flags |= wxCONTROL_DISABLED;
|
||||
|
||||
// Notice that we intentionally don't use any alignment here: it is not
|
||||
// necessary because the cell rectangle had been already adjusted to
|
||||
// account for the alignment in WXCallRender() and using the alignment here
|
||||
// results in problems with ellipsization when using native MSW renderer,
|
||||
// see http://trac.wxwidgets.org/ticket/17363, so just don't do it.
|
||||
wxRendererNative::Get().DrawItemText(
|
||||
GetOwner()->GetOwner(),
|
||||
*dc,
|
||||
text,
|
||||
rectText,
|
||||
GetEffectiveAlignment(),
|
||||
wxALIGN_NOT,
|
||||
flags,
|
||||
GetEllipsizeMode());
|
||||
}
|
||||
@@ -1154,6 +1166,13 @@ const wxDataViewModel* wxDataViewCtrlBase::GetModel() const
|
||||
return m_model;
|
||||
}
|
||||
|
||||
void wxDataViewCtrlBase::Expand(const wxDataViewItem& item)
|
||||
{
|
||||
ExpandAncestors(item);
|
||||
|
||||
DoExpand(item);
|
||||
}
|
||||
|
||||
void wxDataViewCtrlBase::ExpandAncestors( const wxDataViewItem & item )
|
||||
{
|
||||
if (!m_model) return;
|
||||
@@ -1173,7 +1192,7 @@ void wxDataViewCtrlBase::ExpandAncestors( const wxDataViewItem & item )
|
||||
// then we expand the parents, starting at the root
|
||||
while (!parentChain.empty())
|
||||
{
|
||||
Expand(parentChain.back());
|
||||
DoExpand(parentChain.back());
|
||||
parentChain.pop_back();
|
||||
}
|
||||
}
|
||||
@@ -1586,6 +1605,29 @@ wxDEFINE_EVENT( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, wxDataViewEvent );
|
||||
wxDEFINE_EVENT( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, wxDataViewEvent );
|
||||
wxDEFINE_EVENT( wxEVT_DATAVIEW_ITEM_DROP, wxDataViewEvent );
|
||||
|
||||
// Common part of non-copy ctors.
|
||||
void wxDataViewEvent::Init(wxDataViewCtrlBase* dvc,
|
||||
wxDataViewColumn* column,
|
||||
const wxDataViewItem& item)
|
||||
{
|
||||
m_item = item;
|
||||
m_col = column ? column->GetModelColumn() : -1;
|
||||
m_model = dvc->GetModel();
|
||||
m_column = column;
|
||||
m_pos = wxDefaultPosition;
|
||||
m_cacheFrom = 0;
|
||||
m_cacheTo = 0;
|
||||
m_editCancelled = false;
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
m_dataObject = NULL;
|
||||
m_dataBuffer = NULL;
|
||||
m_dataSize = 0;
|
||||
m_dragFlags = 0;
|
||||
m_dropEffect = wxDragNone;
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
SetEventObject(dvc);
|
||||
}
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
|
||||
|
@@ -186,6 +186,15 @@ void wxDataViewColumn::UpdateDisplay()
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewColumn::UpdateWidth()
|
||||
{
|
||||
if (m_owner)
|
||||
{
|
||||
int idx = m_owner->GetColumnIndex( this );
|
||||
m_owner->OnColumnWidthChange( idx );
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewColumn::UnsetAsSortKey()
|
||||
{
|
||||
m_sort = false;
|
||||
@@ -284,12 +293,7 @@ private:
|
||||
bool SendEvent(wxEventType type, unsigned int n)
|
||||
{
|
||||
wxDataViewCtrl * const owner = GetOwner();
|
||||
wxDataViewEvent event(type, owner->GetId());
|
||||
|
||||
event.SetEventObject(owner);
|
||||
event.SetColumn(n);
|
||||
event.SetDataViewColumn(owner->GetColumn(n));
|
||||
event.SetModel(owner->GetModel());
|
||||
wxDataViewEvent event(type, owner, owner->GetColumn(n));
|
||||
|
||||
// for events created by wxDataViewHeaderWindow the
|
||||
// row / value fields are not valid
|
||||
@@ -1649,12 +1653,7 @@ wxDragResult wxDataViewMainWindow::OnDragOver( wxDataFormat format, wxCoord x,
|
||||
if ( row < GetRowCount() && xx <= GetEndOfLastCol() )
|
||||
item = GetItemByRow( row );
|
||||
|
||||
wxDataViewModel *model = GetModel();
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner, item);
|
||||
event.SetDataFormat( format );
|
||||
event.SetDropEffect( def );
|
||||
if ( !m_owner->HandleWindowEvent( event ) || !event.IsAllowed() )
|
||||
@@ -1693,12 +1692,7 @@ bool wxDataViewMainWindow::OnDrop( wxDataFormat format, wxCoord x, wxCoord y )
|
||||
if ( row < GetRowCount() && xx <= GetEndOfLastCol())
|
||||
item = GetItemByRow( row );
|
||||
|
||||
wxDataViewModel *model = GetModel();
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner, item);
|
||||
event.SetDataFormat( format );
|
||||
if (!m_owner->HandleWindowEvent( event ) || !event.IsAllowed())
|
||||
return false;
|
||||
@@ -1719,14 +1713,9 @@ wxDragResult wxDataViewMainWindow::OnData( wxDataFormat format, wxCoord x, wxCoo
|
||||
if ( row < GetRowCount() && xx <= GetEndOfLastCol() )
|
||||
item = GetItemByRow( row );
|
||||
|
||||
wxDataViewModel *model = GetModel();
|
||||
|
||||
wxCustomDataObject *obj = (wxCustomDataObject *) GetDropTarget()->GetDataObject();
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_DROP, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP, m_owner, item);
|
||||
event.SetDataFormat( format );
|
||||
event.SetDataSize( obj->GetSize() );
|
||||
event.SetDataBuffer( obj->GetData() );
|
||||
@@ -1842,11 +1831,9 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
unsigned int item_last = item_start + item_count;
|
||||
|
||||
// Send the event to wxDataViewCtrl itself.
|
||||
wxWindow * const parent = GetParent();
|
||||
wxDataViewEvent cache_event(wxEVT_DATAVIEW_CACHE_HINT, parent->GetId());
|
||||
cache_event.SetEventObject(parent);
|
||||
wxDataViewEvent cache_event(wxEVT_DATAVIEW_CACHE_HINT, m_owner, NULL);
|
||||
cache_event.SetCache(item_start, item_last - 1);
|
||||
parent->ProcessWindowEvent(cache_event);
|
||||
m_owner->ProcessWindowEvent(cache_event);
|
||||
|
||||
// compute which columns needs to be redrawn
|
||||
unsigned int cols = GetOwner()->GetColumnCount();
|
||||
@@ -2528,12 +2515,8 @@ bool wxDataViewMainWindow::ItemChanged(const wxDataViewItem & item)
|
||||
GetOwner()->InvalidateColBestWidths();
|
||||
|
||||
// Send event
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
le.SetItem(item);
|
||||
parent->ProcessWindowEvent(le);
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner, item);
|
||||
m_owner->ProcessWindowEvent(le);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2559,14 +2542,9 @@ bool wxDataViewMainWindow::ValueChanged( const wxDataViewItem & item, unsigned i
|
||||
GetOwner()->InvalidateColBestWidth(view_column);
|
||||
|
||||
// Send event
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
le.SetItem(item);
|
||||
le.SetColumn(view_column);
|
||||
le.SetDataViewColumn(GetOwner()->GetColumn(view_column));
|
||||
parent->ProcessWindowEvent(le);
|
||||
wxDataViewColumn* const column = m_owner->GetColumn(view_column);
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner, column, item);
|
||||
m_owner->ProcessWindowEvent(le);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2815,14 +2793,8 @@ bool wxDataViewMainWindow::IsRowSelected( unsigned int row )
|
||||
|
||||
void wxDataViewMainWindow::SendSelectionChangedEvent( const wxDataViewItem& item)
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_SELECTION_CHANGED, parent->GetId());
|
||||
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
le.SetItem( item );
|
||||
|
||||
parent->ProcessWindowEvent(le);
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_SELECTION_CHANGED, m_owner, item);
|
||||
m_owner->ProcessWindowEvent(le);
|
||||
}
|
||||
|
||||
void wxDataViewMainWindow::RefreshRow( unsigned int row )
|
||||
@@ -3113,14 +3085,8 @@ bool
|
||||
wxDataViewMainWindow::SendExpanderEvent(wxEventType type,
|
||||
const wxDataViewItem& item)
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(type, parent->GetId());
|
||||
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
le.SetItem( item );
|
||||
|
||||
return !parent->ProcessWindowEvent(le) || le.IsAllowed();
|
||||
wxDataViewEvent le(type, m_owner, item);
|
||||
return !m_owner->ProcessWindowEvent(le) || le.IsAllowed();
|
||||
}
|
||||
|
||||
bool wxDataViewMainWindow::IsExpanded( unsigned int row ) const
|
||||
@@ -3700,13 +3666,8 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
|
||||
|
||||
const wxDataViewItem item = GetItemByRow(m_currentRow);
|
||||
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_ACTIVATED,
|
||||
parent->GetId());
|
||||
le.SetItem(item);
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
|
||||
if ( parent->ProcessWindowEvent(le) )
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_ACTIVATED, m_owner, item);
|
||||
if ( m_owner->ProcessWindowEvent(le) )
|
||||
break;
|
||||
// else: fall through to WXK_SPACE handling
|
||||
}
|
||||
@@ -3884,7 +3845,7 @@ void wxDataViewMainWindow::OnVerticalNavigation(const wxKeyEvent& event, int del
|
||||
RefreshRow( m_currentRow );
|
||||
}
|
||||
|
||||
GetOwner()->EnsureVisible( m_currentRow, -1 );
|
||||
GetOwner()->EnsureVisibleRowCol( m_currentRow, -1 );
|
||||
}
|
||||
|
||||
void wxDataViewMainWindow::OnLeftKey(wxKeyEvent& event)
|
||||
@@ -3932,7 +3893,7 @@ void wxDataViewMainWindow::OnLeftKey(wxKeyEvent& event)
|
||||
SelectRow( row, false);
|
||||
SelectRow( parent, true );
|
||||
ChangeCurrentRow( parent );
|
||||
GetOwner()->EnsureVisible( parent, -1 );
|
||||
GetOwner()->EnsureVisibleRowCol( parent, -1 );
|
||||
SendSelectionChangedEvent( parent_node->GetItem() );
|
||||
}
|
||||
}
|
||||
@@ -3965,7 +3926,7 @@ void wxDataViewMainWindow::OnRightKey(wxKeyEvent& event)
|
||||
SelectRow( row, false );
|
||||
SelectRow( row + 1, true );
|
||||
ChangeCurrentRow( row + 1 );
|
||||
GetOwner()->EnsureVisible( row + 1, -1 );
|
||||
GetOwner()->EnsureVisibleRowCol( row + 1, -1 );
|
||||
SendSelectionChangedEvent( GetItemByRow(row+1) );
|
||||
}
|
||||
}
|
||||
@@ -4046,7 +4007,7 @@ bool wxDataViewMainWindow::TryAdvanceCurrentColumn(wxDataViewTreeNode *node, wxK
|
||||
}
|
||||
}
|
||||
|
||||
GetOwner()->EnsureVisible(m_currentRow, idx);
|
||||
GetOwner()->EnsureVisibleRowCol(m_currentRow, idx);
|
||||
|
||||
if ( idx < 1 )
|
||||
{
|
||||
@@ -4112,19 +4073,8 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
||||
// the other ones.
|
||||
if (event.RightUp())
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, parent->GetId());
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(model);
|
||||
|
||||
if ( item.IsOk() && col )
|
||||
{
|
||||
le.SetItem( item );
|
||||
le.SetColumn( col->GetModelColumn() );
|
||||
le.SetDataViewColumn( col );
|
||||
}
|
||||
|
||||
parent->ProcessWindowEvent(le);
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, m_owner, col, item);
|
||||
m_owner->ProcessWindowEvent(le);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4153,10 +4103,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
||||
wxDataViewItem itemDragged = GetItemByRow( drag_item_row );
|
||||
|
||||
// Notify cell about drag
|
||||
wxDataViewEvent evt( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, m_owner->GetId() );
|
||||
evt.SetEventObject( m_owner );
|
||||
evt.SetItem( itemDragged );
|
||||
evt.SetModel( model );
|
||||
wxDataViewEvent evt(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, m_owner, itemDragged);
|
||||
if (!m_owner->HandleWindowEvent( evt ))
|
||||
return;
|
||||
|
||||
@@ -4270,15 +4217,8 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
if ( !hoverOverExpander && (current == m_lineLastClicked) )
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_ACTIVATED, parent->GetId());
|
||||
le.SetItem( item );
|
||||
le.SetColumn( col->GetModelColumn() );
|
||||
le.SetDataViewColumn( col );
|
||||
le.SetEventObject(parent);
|
||||
le.SetModel(GetModel());
|
||||
|
||||
if ( parent->ProcessWindowEvent(le) )
|
||||
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_ACTIVATED, m_owner, col, item);
|
||||
if ( m_owner->ProcessWindowEvent(le) )
|
||||
{
|
||||
// Item activation was handled from the user code.
|
||||
return;
|
||||
@@ -4577,7 +4517,11 @@ void wxDataViewMainWindow::UpdateColumnSizes()
|
||||
if ( lastColX < fullWinWidth )
|
||||
{
|
||||
int desiredWidth = wxMax(fullWinWidth - lastColX, lastCol->GetMinWidth());
|
||||
lastCol->SetWidth(desiredWidth);
|
||||
if ( !lastCol->WXUpdateWidth(desiredWidth) )
|
||||
{
|
||||
// The column width didn't change, no need to do anything else.
|
||||
return;
|
||||
}
|
||||
|
||||
// All columns fit on screen, so we don't need horizontal scrolling.
|
||||
// To prevent flickering scrollbar when resizing the window to be
|
||||
@@ -4842,6 +4786,13 @@ bool wxDataViewCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::OnColumnWidthChange(unsigned int idx)
|
||||
{
|
||||
InvalidateColBestWidth(idx);
|
||||
|
||||
OnColumnChange(idx);
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::OnColumnChange(unsigned int idx)
|
||||
{
|
||||
if ( m_headerArea )
|
||||
@@ -5266,7 +5217,7 @@ void wxDataViewCtrl::UnselectAll()
|
||||
m_clientArea->UnselectAllRows();
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::EnsureVisible( int row, int column )
|
||||
void wxDataViewCtrl::EnsureVisibleRowCol( int row, int column )
|
||||
{
|
||||
if( row < 0 )
|
||||
row = 0;
|
||||
@@ -5293,9 +5244,9 @@ void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, const wxDataVie
|
||||
if( row >= 0 )
|
||||
{
|
||||
if( column == NULL )
|
||||
EnsureVisible(row, -1);
|
||||
EnsureVisibleRowCol(row, -1);
|
||||
else
|
||||
EnsureVisible( row, GetColumnIndex(column) );
|
||||
EnsureVisibleRowCol( row, GetColumnIndex(column) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5322,10 +5273,8 @@ int wxDataViewCtrl::GetRowByItem( const wxDataViewItem & item ) const
|
||||
return m_clientArea->GetRowByItem( item );
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Expand( const wxDataViewItem & item )
|
||||
void wxDataViewCtrl::DoExpand( const wxDataViewItem & item )
|
||||
{
|
||||
ExpandAncestors( item );
|
||||
|
||||
int row = m_clientArea->GetRowByItem( item );
|
||||
if (row != -1)
|
||||
m_clientArea->Expand(row);
|
||||
|
@@ -979,9 +979,8 @@ wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable,
|
||||
if (gs_lastLeftClickHeader)
|
||||
{
|
||||
wxDataViewCtrl *dv = tree_model->internal->GetOwner();
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_COLUMN_SORTED, dv->GetId() );
|
||||
event.SetDataViewColumn( gs_lastLeftClickHeader );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_COLUMN_SORTED, dv, gs_lastLeftClickHeader);
|
||||
dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -1129,11 +1128,7 @@ static GtkCellEditable *gtk_wx_cell_renderer_text_start_editing(
|
||||
item(column->GetOwner()->GTKPathToItem(wxGtkTreePath(path)));
|
||||
|
||||
wxDataViewCtrl *dv = column->GetOwner();
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_START_EDITING, dv->GetId() );
|
||||
event.SetDataViewColumn( column );
|
||||
event.SetModel( dv->GetModel() );
|
||||
event.SetColumn( column->GetModelColumn() );
|
||||
event.SetItem( item );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_START_EDITING, dv, column, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
|
||||
if (event.IsAllowed())
|
||||
@@ -2253,7 +2248,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr)
|
||||
g_value_unset( &gvalue );
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (attr.HasBackgroundColour())
|
||||
{
|
||||
wxColour colour = attr.GetBackgroundColour();
|
||||
@@ -2273,7 +2267,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr)
|
||||
g_object_set_property( G_OBJECT(renderer), "cell-background-set", &gvalue );
|
||||
g_value_unset( &gvalue );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -3002,9 +2995,7 @@ gtk_dataview_header_button_press_callback( GtkWidget *WXUNUSED(widget),
|
||||
gs_lastLeftClickHeader = column;
|
||||
|
||||
wxDataViewCtrl *dv = column->GetOwner();
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_COLUMN_HEADER_CLICK, dv->GetId() );
|
||||
event.SetDataViewColumn( column );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_HEADER_CLICK, dv, column);
|
||||
if (dv->HandleWindowEvent( event ))
|
||||
return FALSE;
|
||||
}
|
||||
@@ -3012,9 +3003,8 @@ gtk_dataview_header_button_press_callback( GtkWidget *WXUNUSED(widget),
|
||||
if (gdk_event->button == 3)
|
||||
{
|
||||
wxDataViewCtrl *dv = column->GetOwner();
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv->GetId() );
|
||||
event.SetDataViewColumn( column );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv, column);
|
||||
if (dv->HandleWindowEvent( event ))
|
||||
return FALSE;
|
||||
}
|
||||
@@ -3605,14 +3595,12 @@ gboolean wxDataViewCtrlInternal::row_draggable( GtkTreeDragSource *WXUNUSED(drag
|
||||
delete m_dragDataObject;
|
||||
m_dragDataObject = NULL;
|
||||
|
||||
wxDataViewItem item(GetOwner()->GTKPathToItem(path));
|
||||
wxDataViewCtrl* const dvc = GetOwner();
|
||||
wxDataViewItem item(dvc->GTKPathToItem(path));
|
||||
if ( !item )
|
||||
return FALSE;
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( m_wx_model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, dvc, item);
|
||||
gint x, y;
|
||||
gtk_widget_get_pointer(m_owner->GtkGetTreeView(), &x, &y);
|
||||
event.SetPosition(x, y);
|
||||
@@ -3676,10 +3664,7 @@ wxDataViewCtrlInternal::drag_data_received(GtkTreeDragDest *WXUNUSED(drag_dest),
|
||||
{
|
||||
wxDataViewItem item(GetOwner()->GTKPathToItem(path));
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_DROP, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( m_wx_model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP, m_owner, item);
|
||||
event.SetDataFormat(gtk_selection_data_get_target(selection_data));
|
||||
event.SetDataSize(gtk_selection_data_get_length(selection_data));
|
||||
event.SetDataBuffer(const_cast<guchar*>(gtk_selection_data_get_data(selection_data)));
|
||||
@@ -3699,10 +3684,7 @@ wxDataViewCtrlInternal::row_drop_possible(GtkTreeDragDest *WXUNUSED(drag_dest),
|
||||
{
|
||||
wxDataViewItem item(GetOwner()->GTKPathToItem(path));
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetItem( item );
|
||||
event.SetModel( m_wx_model );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, m_owner, item);
|
||||
event.SetDataFormat(gtk_selection_data_get_target(selection_data));
|
||||
event.SetDataSize(gtk_selection_data_get_length(selection_data));
|
||||
if (!m_owner->HandleWindowEvent( event ))
|
||||
@@ -3822,10 +3804,7 @@ bool wxDataViewCtrlInternal::ItemDeleted( const wxDataViewItem &parent, const wx
|
||||
|
||||
bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetModel( m_owner->GetModel() );
|
||||
event.SetItem( item );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner, item);
|
||||
m_owner->HandleWindowEvent( event );
|
||||
|
||||
return true;
|
||||
@@ -3833,12 +3812,9 @@ bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item )
|
||||
|
||||
bool wxDataViewCtrlInternal::ValueChanged( const wxDataViewItem &item, unsigned int view_column )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner->GetId() );
|
||||
event.SetEventObject( m_owner );
|
||||
event.SetModel( m_owner->GetModel() );
|
||||
event.SetColumn( view_column );
|
||||
event.SetDataViewColumn( GetOwner()->GetColumn(view_column) );
|
||||
event.SetItem( item );
|
||||
wxDataViewColumn* const column = m_owner->GetColumn(view_column);
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner, column, item);
|
||||
m_owner->HandleWindowEvent( event );
|
||||
|
||||
return true;
|
||||
@@ -4371,10 +4347,8 @@ wxdataview_selection_changed_callback( GtkTreeSelection* WXUNUSED(selection), wx
|
||||
if (!gtk_widget_get_realized(dv->m_widget))
|
||||
return;
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_SELECTION_CHANGED, dv->GetId() );
|
||||
event.SetEventObject( dv );
|
||||
event.SetItem( dv->GetSelection() );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_SELECTION_CHANGED, dv, dv->GetSelection());
|
||||
dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -4382,11 +4356,8 @@ static void
|
||||
wxdataview_row_activated_callback( GtkTreeView* WXUNUSED(treeview), GtkTreePath *path,
|
||||
GtkTreeViewColumn *WXUNUSED(column), wxDataViewCtrl *dv )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_ACTIVATED, dv->GetId() );
|
||||
|
||||
wxDataViewItem item(dv->GTKPathToItem(path));
|
||||
event.SetItem( item );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_ACTIVATED, dv, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -4394,11 +4365,8 @@ static gboolean
|
||||
wxdataview_test_expand_row_callback( GtkTreeView* WXUNUSED(treeview), GtkTreeIter* iter,
|
||||
GtkTreePath *WXUNUSED(path), wxDataViewCtrl *dv )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_EXPANDING, dv->GetId() );
|
||||
|
||||
wxDataViewItem item( (void*) iter->user_data );;
|
||||
event.SetItem( item );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewItem item( (void*) iter->user_data );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDING, dv, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
|
||||
return !event.IsAllowed();
|
||||
@@ -4408,11 +4376,8 @@ static void
|
||||
wxdataview_row_expanded_callback( GtkTreeView* WXUNUSED(treeview), GtkTreeIter* iter,
|
||||
GtkTreePath *WXUNUSED(path), wxDataViewCtrl *dv )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_EXPANDED, dv->GetId() );
|
||||
|
||||
wxDataViewItem item( (void*) iter->user_data );;
|
||||
event.SetItem( item );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewItem item( (void*) iter->user_data );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDED, dv, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -4420,11 +4385,8 @@ static gboolean
|
||||
wxdataview_test_collapse_row_callback( GtkTreeView* WXUNUSED(treeview), GtkTreeIter* iter,
|
||||
GtkTreePath *WXUNUSED(path), wxDataViewCtrl *dv )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_COLLAPSING, dv->GetId() );
|
||||
|
||||
wxDataViewItem item( (void*) iter->user_data );;
|
||||
event.SetItem( item );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewItem item( (void*) iter->user_data );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSING, dv, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
|
||||
return !event.IsAllowed();
|
||||
@@ -4434,11 +4396,8 @@ static void
|
||||
wxdataview_row_collapsed_callback( GtkTreeView* WXUNUSED(treeview), GtkTreeIter* iter,
|
||||
GtkTreePath *WXUNUSED(path), wxDataViewCtrl *dv )
|
||||
{
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_COLLAPSED, dv->GetId() );
|
||||
|
||||
wxDataViewItem item( (void*) iter->user_data );;
|
||||
event.SetItem( item );
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewItem item( (void*) iter->user_data );
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSED, dv, item);
|
||||
dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -4531,10 +4490,8 @@ gtk_dataview_button_press_callback( GtkWidget *WXUNUSED(widget),
|
||||
gtk_tree_selection_select_path(selection, path);
|
||||
}
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, dv->GetId() );
|
||||
if (path)
|
||||
event.SetItem(dv->GTKPathToItem(path));
|
||||
event.SetModel( dv->GetModel() );
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, dv, dv->GTKPathToItem(path));
|
||||
return dv->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
@@ -4863,7 +4820,7 @@ wxDataViewColumn *wxDataViewCtrl::GetSortingColumn() const
|
||||
return m_internal->GetDataViewSortColumn();
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Expand( const wxDataViewItem & item )
|
||||
void wxDataViewCtrl::DoExpand( const wxDataViewItem & item )
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
iter.user_data = item.GetID();
|
||||
|
@@ -10,7 +10,11 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if (wxUSE_DATAVIEWCTRL == 1) && !defined(wxUSE_GENERICDATAVIEWCTRL)
|
||||
#if wxUSE_DATAVIEWCTRL
|
||||
|
||||
#include "wx/dataview.h"
|
||||
|
||||
#if !defined(wxUSE_GENERICDATAVIEWCTRL)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
@@ -544,10 +548,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
wxCHECK_MSG( dvc->GetModel(), false,
|
||||
"Pointer to model not set correctly." );
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP, dvc->GetId());
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(wxDataViewItemFromItem(item));
|
||||
event.SetModel(dvc->GetModel());
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP, dvc, wxDataViewItemFromItem(item));
|
||||
|
||||
BOOL dragSuccessful = false;
|
||||
if ( [bestType compare:DataViewPboardType] == NSOrderedSame )
|
||||
@@ -755,16 +756,10 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
// send first the event to wxWidgets that the sorting has changed so that
|
||||
// the program can do special actions before the sorting actually starts:
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_SORTED,dvc->GetId()); // variable definition
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
if (noOfDescriptors > 0)
|
||||
{
|
||||
wxDataViewColumn* const col = [[wxSortDescriptors objectAtIndex:0] columnPtr];
|
||||
|
||||
event.SetColumn(dvc->GetColumnPosition(col));
|
||||
event.SetDataViewColumn(col);
|
||||
}
|
||||
wxDataViewColumn* const col = noOfDescriptors > 0
|
||||
? [[wxSortDescriptors objectAtIndex:0] columnPtr]
|
||||
: NULL;
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_SORTED, dvc, col);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
// start re-ordering the data;
|
||||
@@ -793,12 +788,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
wxCHECK_MSG(dvc, false, "Pointer to data view control not set correctly.");
|
||||
wxCHECK_MSG(dvc->GetModel(), false, "Pointer to model not set correctly.");
|
||||
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE,dvc->GetId());
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(wxDataViewItemFromItem(item));
|
||||
event.SetModel(dvc->GetModel());
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, dvc, wxDataViewItemFromItem(item));
|
||||
if ([bestType compare:DataViewPboardType] == NSOrderedSame)
|
||||
{
|
||||
NSArray* dataArray((NSArray*)[pasteboard propertyListForType:DataViewPboardType]);
|
||||
@@ -898,22 +888,16 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
// send a begin drag event for all selected items and proceed with
|
||||
// dragging unless the event is vetoed:
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG,dvc->GetId());
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetModel(dvc->GetModel());
|
||||
for (size_t itemCounter=0; itemCounter<[writeItems count]; ++itemCounter)
|
||||
{
|
||||
bool itemStringAvailable(false); // a flag indicating if for the current item a string is available
|
||||
wxDataObjectComposite* itemObject(new wxDataObjectComposite()); // data object for current item
|
||||
wxString itemString; // contains the TAB concatenated data of an item
|
||||
|
||||
event.SetItem(
|
||||
wxDataViewItemFromItem([writeItems objectAtIndex:itemCounter]));
|
||||
itemString = ::ConcatenateDataViewItemValues(dvc,event.GetItem());
|
||||
const wxDataViewItem item = wxDataViewItemFromItem([writeItems objectAtIndex:itemCounter]);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, dvc, item);
|
||||
itemString = ::ConcatenateDataViewItemValues(dvc, item);
|
||||
itemObject->Add(new wxTextDataObject(itemString));
|
||||
event.SetDataObject(itemObject);
|
||||
// check if event has not been vetoed:
|
||||
if (dvc->HandleWindowEvent(event) && event.IsAllowed() && (event.GetDataObject()->GetFormatCount() > 0))
|
||||
{
|
||||
@@ -1616,11 +1600,8 @@ outlineView:(NSOutlineView*)outlineView
|
||||
// sent whether the cell is editable or not
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_ACTIVATED,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(wxDataViewItemFromItem([self itemAtRow:[self clickedRow]]));
|
||||
const wxDataViewItem item = wxDataViewItemFromItem([self itemAtRow:[self clickedRow]]);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_ACTIVATED, dvc, item);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
@@ -1633,12 +1614,8 @@ outlineView:(NSOutlineView*)outlineView
|
||||
characterAtIndex: 0] == NSCarriageReturnCharacter )
|
||||
{
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent eventDV( wxEVT_DATAVIEW_ITEM_ACTIVATED, dvc->GetId() );
|
||||
eventDV.SetEventObject(dvc);
|
||||
eventDV.SetItem( wxDataViewItem( [[self itemAtRow:[self selectedRow]] pointer]) );
|
||||
eventDV.SetModel( dvc->GetModel() );
|
||||
|
||||
const wxDataViewItem item = wxDataViewItem( [[self itemAtRow:[self selectedRow]] pointer]);
|
||||
wxDataViewEvent eventDV(wxEVT_DATAVIEW_ITEM_ACTIVATED, dvc, item);
|
||||
if ( !dvc->GetEventHandler()->ProcessEvent(eventDV) )
|
||||
[super keyDown:event];
|
||||
}
|
||||
@@ -1660,19 +1637,16 @@ outlineView:(NSOutlineView*)outlineView
|
||||
// menu should be shown or not
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU,dvc->GetId());
|
||||
|
||||
wxDataViewItemArray selectedItems;
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetModel(dvc->GetModel());
|
||||
// get the item information;
|
||||
// theoretically more than one ID can be returned but the event can only
|
||||
// handle one item, therefore only the first item of the array is
|
||||
// returned:
|
||||
wxDataViewItem item;
|
||||
wxDataViewItemArray selectedItems;
|
||||
if (dvc->GetSelections(selectedItems) > 0)
|
||||
event.SetItem(selectedItems[0]);
|
||||
item = selectedItems[0];
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, dvc, item);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
// nothing is done:
|
||||
return nil;
|
||||
@@ -1688,14 +1662,8 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_COLUMN_HEADER_CLICK,dvc->GetId());
|
||||
|
||||
|
||||
// first, send an event that the user clicked into a column's header:
|
||||
event.SetEventObject(dvc);
|
||||
event.SetColumn(dvc->GetColumnPosition(col));
|
||||
event.SetDataViewColumn(col);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_HEADER_CLICK, dvc, col);
|
||||
dvc->HandleWindowEvent(event);
|
||||
|
||||
// now, check if the click may have had an influence on sorting, too;
|
||||
@@ -1731,13 +1699,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSING,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem (wxDataViewItemFromItem(item));
|
||||
event.SetModel (dvc->GetModel());
|
||||
// finally send the equivalent wxWidget event:
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSING, dvc, wxDataViewItemFromItem(item));
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
// opening the container is allowed if not vetoed:
|
||||
return event.IsAllowed();
|
||||
@@ -1749,13 +1711,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDING,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem (wxDataViewItemFromItem(item));
|
||||
event.SetModel (dvc->GetModel());
|
||||
// finally send the equivalent wxWidget event:
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDING, dvc, wxDataViewItemFromItem(item));
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
// opening the container is allowed if not vetoed:
|
||||
return event.IsAllowed();
|
||||
@@ -1818,12 +1774,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_REORDERED,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetColumn(dvc->GetColumnPosition(col));
|
||||
event.SetDataViewColumn(col);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_COLUMN_REORDERED, dvc, col);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
@@ -1831,12 +1782,9 @@ outlineView:(NSOutlineView*)outlineView
|
||||
{
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSED,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(wxDataViewItemFromItem(
|
||||
[[notification userInfo] objectForKey:@"NSObject"]));
|
||||
const wxDataViewItem item = wxDataViewItemFromItem(
|
||||
[[notification userInfo] objectForKey:@"NSObject"]);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSED, dvc, item);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
@@ -1844,12 +1792,9 @@ outlineView:(NSOutlineView*)outlineView
|
||||
{
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDED,dvc->GetId());
|
||||
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(wxDataViewItemFromItem(
|
||||
[[notification userInfo] objectForKey:@"NSObject"]));
|
||||
const wxDataViewItem item = wxDataViewItemFromItem(
|
||||
[[notification userInfo] objectForKey:@"NSObject"]);
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDED, dvc, item);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
@@ -1859,11 +1804,7 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_SELECTION_CHANGED,dvc->GetId());
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetModel(dvc->GetModel());
|
||||
event.SetItem(dvc->GetSelection());
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_SELECTION_CHANGED, dvc, dvc->GetSelection());
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
@@ -1928,15 +1869,11 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
|
||||
// send event to wxWidgets:
|
||||
wxDataViewEvent
|
||||
event(wxEVT_DATAVIEW_ITEM_EDITING_DONE,dvc->GetId());
|
||||
const wxDataViewItem
|
||||
item = wxDataViewItemFromItem([self itemAtRow:currentlyEditedRow]);
|
||||
|
||||
event.SetEventObject(dvc);
|
||||
event.SetItem(
|
||||
wxDataViewItemFromItem([self itemAtRow:currentlyEditedRow]));
|
||||
event.SetColumn(dvc->GetColumnPosition(col));
|
||||
event.SetDataViewColumn(col);
|
||||
// send event to wxWidgets:
|
||||
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EDITING_DONE, dvc, col, item);
|
||||
dvc->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
|
||||
@@ -2223,7 +2160,7 @@ void wxCocoaDataViewControl::EnsureVisible(const wxDataViewItem& item, const wxD
|
||||
}
|
||||
}
|
||||
|
||||
void wxCocoaDataViewControl::Expand(const wxDataViewItem& item)
|
||||
void wxCocoaDataViewControl::DoExpand(const wxDataViewItem& item)
|
||||
{
|
||||
[m_OutlineView expandItem:[m_DataSource getDataViewItemFromBuffer:item]];
|
||||
}
|
||||
@@ -2306,6 +2243,15 @@ bool wxCocoaDataViewControl::AssociateModel(wxDataViewModel* model)
|
||||
else
|
||||
m_DataSource = NULL;
|
||||
[m_OutlineView setDataSource:m_DataSource]; // if there is a data source the data is immediately going to be requested
|
||||
|
||||
// By default, the first column is indented to leave enough place for the
|
||||
// expanders, but this looks bad if there are no expanders, so don't use
|
||||
// indent in this case.
|
||||
if ( model && model->IsListModel() )
|
||||
{
|
||||
DoSetIndent(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2903,6 +2849,49 @@ bool wxDataViewChoiceRenderer::MacRender()
|
||||
|
||||
wxIMPLEMENT_CLASS(wxDataViewChoiceRenderer, wxDataViewRenderer);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataViewChoiceByIndexRenderer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDataViewChoiceByIndexRenderer::wxDataViewChoiceByIndexRenderer(const wxArrayString& choices,
|
||||
wxDataViewCellMode mode,
|
||||
int alignment)
|
||||
: wxDataViewChoiceRenderer(choices, mode, alignment)
|
||||
{
|
||||
m_variantType = wxS("long");
|
||||
}
|
||||
|
||||
void
|
||||
wxDataViewChoiceByIndexRenderer::OSXOnCellChanged(NSObject *value,
|
||||
const wxDataViewItem& item,
|
||||
unsigned col)
|
||||
{
|
||||
wxVariant valueLong(ObjectToLong(value));
|
||||
if ( !Validate(valueLong) )
|
||||
return;
|
||||
|
||||
wxDataViewModel *model = GetOwner()->GetOwner()->GetModel();
|
||||
model->ChangeValue(valueLong, item, col);
|
||||
}
|
||||
|
||||
bool
|
||||
wxDataViewChoiceByIndexRenderer::SetValue(const wxVariant& value)
|
||||
{
|
||||
const wxVariant valueStr = GetChoice(value.GetLong());
|
||||
return wxDataViewChoiceRenderer::SetValue(valueStr);
|
||||
}
|
||||
|
||||
bool
|
||||
wxDataViewChoiceByIndexRenderer::GetValue(wxVariant& value) const
|
||||
{
|
||||
wxVariant valueStr;
|
||||
if ( !wxDataViewChoiceRenderer::GetValue(valueStr) )
|
||||
return false;
|
||||
|
||||
value = (long) GetChoices().Index(valueStr.GetString());
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewDateRenderer
|
||||
// ---------------------------------------------------------
|
||||
@@ -3305,4 +3294,6 @@ void wxDataViewColumn::SetNativeData(wxDataViewColumnNativeData* newNativeDataPt
|
||||
m_NativeDataPtr = newNativeDataPtr;
|
||||
}
|
||||
|
||||
#endif // (wxUSE_DATAVIEWCTRL == 1) && !defined(wxUSE_GENERICDATAVIEWCTRL)
|
||||
#endif // !wxUSE_GENERICDATAVIEWCTRL
|
||||
|
||||
#endif // wxUSE_DATAVIEWCTRL
|
||||
|
@@ -9,7 +9,11 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
|
||||
#if wxUSE_DATAVIEWCTRL
|
||||
|
||||
#include "wx/dataview.h"
|
||||
|
||||
#ifndef wxUSE_GENERICDATAVIEWCTRL
|
||||
|
||||
#include <limits>
|
||||
|
||||
@@ -122,13 +126,8 @@ bool wxOSXDataViewModelNotifier::ItemChanged(wxDataViewItem const& item)
|
||||
wxCHECK_MSG(GetOwner() != NULL,false,"Owner not initialized.");
|
||||
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
|
||||
{
|
||||
// sent the equivalent wxWidget event:
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED,m_DataViewCtrlPtr->GetId());
|
||||
|
||||
dataViewEvent.SetEventObject(m_DataViewCtrlPtr);
|
||||
dataViewEvent.SetModel(m_DataViewCtrlPtr->GetModel());
|
||||
dataViewEvent.SetItem(item);
|
||||
// sent the equivalent wxWidget event:
|
||||
// send the equivalent wxWidgets event:
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_DataViewCtrlPtr, item);
|
||||
m_DataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
|
||||
// row height may have to be adjusted:
|
||||
AdjustRowHeight(item);
|
||||
@@ -144,16 +143,11 @@ bool wxOSXDataViewModelNotifier::ItemsChanged(wxDataViewItemArray const& items)
|
||||
{
|
||||
size_t const noOfItems = items.GetCount();
|
||||
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED,m_DataViewCtrlPtr->GetId());
|
||||
|
||||
|
||||
dataViewEvent.SetEventObject(m_DataViewCtrlPtr);
|
||||
dataViewEvent.SetModel(m_DataViewCtrlPtr->GetModel());
|
||||
for (size_t indexItem=0; indexItem<noOfItems; ++indexItem)
|
||||
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(items[indexItem]),items[indexItem]))
|
||||
{
|
||||
// send for all changed items a wxWidget event:
|
||||
dataViewEvent.SetItem(items[indexItem]);
|
||||
// send for all changed items a wxWidgets event:
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED,m_DataViewCtrlPtr,items[indexItem]);
|
||||
m_DataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
|
||||
}
|
||||
else
|
||||
@@ -211,13 +205,9 @@ bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem const& item, unsign
|
||||
wxCHECK_MSG(GetOwner() != NULL,false,"Owner not initialized.");
|
||||
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
|
||||
{
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED,m_DataViewCtrlPtr->GetId());
|
||||
wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_DataViewCtrlPtr, m_DataViewCtrlPtr->GetColumn(col), item);
|
||||
|
||||
dataViewEvent.SetEventObject(m_DataViewCtrlPtr);
|
||||
dataViewEvent.SetModel(m_DataViewCtrlPtr->GetModel());
|
||||
dataViewEvent.SetColumn(col);
|
||||
dataViewEvent.SetItem(item);
|
||||
// send the equivalent wxWidget event:
|
||||
// send the equivalent wxWidgets event:
|
||||
m_DataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
|
||||
|
||||
AdjustAutosizedColumns();
|
||||
@@ -520,9 +510,9 @@ void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Expand(wxDataViewItem const& item)
|
||||
void wxDataViewCtrl::DoExpand(wxDataViewItem const& item)
|
||||
{
|
||||
return GetDataViewPeer()->Expand(item);
|
||||
return GetDataViewPeer()->DoExpand(item);
|
||||
}
|
||||
|
||||
bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
|
||||
@@ -742,5 +732,6 @@ wxBEGIN_EVENT_TABLE(wxDataViewCtrl,wxDataViewCtrlBase)
|
||||
EVT_MOTION(wxDataViewCtrl::OnMouse)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
#endif // (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
|
||||
#endif // !wxUSE_GENERICDATAVIEWCTRL
|
||||
|
||||
#endif // wxUSE_DATAVIEWCTRL
|
||||
|
Reference in New Issue
Block a user