|
KiCad PCB EDA Suite
|
Extension of the wxDataViewCtrl to include some helper functions for working with items. More...
#include <wx_dataviewctrl.h>
Public Member Functions | |
| ~WX_DATAVIEWCTRL () override | |
| bool | AssociateModel (wxDataViewModel *aModel) override |
Install a WX_ENSURE_VISIBLE_CANCELLER on aModel so deferred scrolls are dropped automatically when it frees items, then associate it as usual. | |
| wxDataViewItem | GetPrevItem (wxDataViewItem const &aItem) |
| Get the previous item in list order. | |
| wxDataViewItem | GetNextItem (wxDataViewItem const &aItem) |
| Get the next item in list order. | |
| wxDataViewItem | GetPrevSibling (wxDataViewItem const &aItem) |
| Get the previous sibling of an item. | |
| wxDataViewItem | GetNextSibling (wxDataViewItem const &aItem) |
| Get the next sibling of an item. | |
| void | DoSetToolTipText (const wxString &tip) override |
| void | ExpandAll () |
| void | CollapseAll () |
| void | CancelPendingEnsureVisible () |
| Cancel any pending deferred EnsureVisible request. | |
Private Attributes | |
| wxDataViewModelNotifier * | m_ensureVisibleCanceller = nullptr |
Extension of the wxDataViewCtrl to include some helper functions for working with items.
These should probably be sent upstream, since they may be useful to others, but for now just extend the class with them ourselves.
Definition at line 84 of file wx_dataviewctrl.h.
|
override |
Definition at line 179 of file wx_dataviewctrl.cpp.
References m_ensureVisibleCanceller.
|
override |
Install a WX_ENSURE_VISIBLE_CANCELLER on aModel so deferred scrolls are dropped automatically when it frees items, then associate it as usual.
Definition at line 187 of file wx_dataviewctrl.cpp.
References CancelPendingEnsureVisible(), and m_ensureVisibleCanceller.
| void WX_DATAVIEWCTRL::CancelPendingEnsureVisible | ( | ) |
Cancel any pending deferred EnsureVisible request.
On GTK, wxDataViewCtrl::EnsureVisible() records the target item and re-scrolls to it during the next idle cycle (in OnInternalIdle). If the model is rebuilt and the underlying item is freed before that idle runs, OnInternalIdle dereferences the stale pointer in ExpandAncestors and crashes. The installed WX_ENSURE_VISIBLE_CANCELLER invokes this automatically when the model frees items, so call sites normally do not need to. This is a no-op on platforms that do not defer the scroll.
Definition at line 164 of file wx_dataviewctrl.cpp.
Referenced by AssociateModel().
| void WX_DATAVIEWCTRL::CollapseAll | ( | ) |
Definition at line 158 of file wx_dataviewctrl.cpp.
References recursiveDescent().
|
inlineoverride |
Definition at line 130 of file wx_dataviewctrl.h.
| void WX_DATAVIEWCTRL::ExpandAll | ( | ) |
Definition at line 152 of file wx_dataviewctrl.cpp.
References recursiveDescent().
| wxDataViewItem WX_DATAVIEWCTRL::GetNextItem | ( | wxDataViewItem const & | aItem | ) |
Get the next item in list order.
| aItem | a valid item in the control's model. |
Definition at line 44 of file wx_dataviewctrl.cpp.
References GetNextSibling().
| wxDataViewItem WX_DATAVIEWCTRL::GetNextSibling | ( | wxDataViewItem const & | aItem | ) |
Get the next sibling of an item.
| aItem | a valid item in the control's model. |
Definition at line 110 of file wx_dataviewctrl.cpp.
Referenced by GetNextItem().
| wxDataViewItem WX_DATAVIEWCTRL::GetPrevItem | ( | wxDataViewItem const & | aItem | ) |
Get the previous item in list order.
| aItem | a valid item in the control's model. |
Definition at line 23 of file wx_dataviewctrl.cpp.
References GetPrevSibling().
| wxDataViewItem WX_DATAVIEWCTRL::GetPrevSibling | ( | wxDataViewItem const & | aItem | ) |
Get the previous sibling of an item.
| aItem | a valid item in the control's model. |
Definition at line 87 of file wx_dataviewctrl.cpp.
Referenced by GetPrevItem().
|
private |
Definition at line 149 of file wx_dataviewctrl.h.
Referenced by AssociateModel(), and ~WX_DATAVIEWCTRL().