本文整理汇总了C++中wxDataViewItem函数的典型用法代码示例。如果您正苦于以下问题:C++ wxDataViewItem函数的具体用法?C++ wxDataViewItem怎么用?C++ wxDataViewItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxDataViewItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxDataViewItem
wxDataViewItem vvStampsModel::AddItem(
const wxString& sName,
unsigned int uCount,
bool bChecked
)
{
// check if this item already exists
stlDataItemMap::iterator it = this->mcDataItems.find(sName);
if (it != this->mcDataItems.end())
{
return wxDataViewItem();
}
// add the item
DataItem cItem;
cItem.sName = sName;
cItem.uCount = uCount;
cItem.bChecked = bChecked;
it = this->mcDataItems.insert(it, stlDataItemMap::value_type(sName, cItem));
// create a wxDataViewItem from it
wxDataViewItem cViewItem = this->ConvertDataItem(it);
// notify anyone that cares about the new item
this->ItemAdded(wxDataViewItem(), cViewItem);
// return the new item
return cViewItem;
}
示例2: wxDataViewItem
unsigned int MyMusicTreeModel::GetChildren( const wxDataViewItem &parent,
wxDataViewItemArray &array ) const
{
MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) parent.GetID();
if (!node)
{
array.Add( wxDataViewItem( (void*) m_root ) );
return 1;
}
if (node == m_classical)
{
MyMusicTreeModel *model = (MyMusicTreeModel*)(const MyMusicTreeModel*) this;
model->m_classicalMusicIsKnownToControl = true;
}
if (node->GetChildCount() == 0)
{
return 0;
}
unsigned int count = node->GetChildren().GetCount();
for (unsigned int pos = 0; pos < count; pos++)
{
MyMusicTreeModelNode *child = node->GetChildren().Item( pos );
array.Add( wxDataViewItem( (void*) child ) );
}
return count;
}
示例3: wxDataViewItem
wxDataViewItem FunctionsModel::GetParent(const wxDataViewItem& item) const
{
FunctionsModel_Item* node = reinterpret_cast<FunctionsModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例4: wxDataViewItem
wxDataViewItem CScoptViewResultsModel::GetParent(const wxDataViewItem& item) const
{
CScoptViewResultsModel_Item* node = reinterpret_cast<CScoptViewResultsModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例5: wxDataViewItem
wxDataViewItem StaleFilesModel::GetParent(const wxDataViewItem& item) const
{
StaleFilesModel_Item* node = reinterpret_cast<StaleFilesModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例6: if
void MemCheckOutputView::ShowPageView(size_t page)
{
// CL_DEBUG1(PLUGIN_PREFIX("MemCheckOutputView::ShowPage()"));
if(page < 1)
m_currentPage = 1;
else if(page > m_pageMax)
m_currentPage = m_pageMax;
else
m_currentPage = page;
if(m_currentPage == 0)
m_textCtrlPageNumber->Clear();
else
pageValidator.TransferToWindow(); // it sets m_textCtrlPageNumber
m_currentPageIsEmptyView = true;
m_currentItem = wxDataViewItem(0);
m_onValueChangedLocked = false;
m_markedErrorsCount = 0;
m_dataViewCtrlErrorsModel->Clear();
if(m_totalErrorsView == 0) return;
ErrorList& errorList = m_plugin->GetProcessor()->GetErrors();
long iStart = (long)(m_currentPage - 1) * m_plugin->GetSettings()->GetResultPageSize();
long iStop =
(long)std::min(m_totalErrorsView - 1, m_currentPage * m_plugin->GetSettings()->GetResultPageSize() - 1);
// CL_DEBUG1(PLUGIN_PREFIX("start - stop = %lu - %lu", iStart, iStop));
m_currentPageIsEmptyView = (iStop - iStart) < 0;
// this should never happen if m_totalErrorsView > 0, but...
if(m_currentPageIsEmptyView) return;
wxWindowDisabler disableAll;
wxBusyInfo wait(wxT(BUSY_MESSAGE));
m_mgr->GetTheApp()->Yield();
unsigned int flags = 0;
if(m_plugin->GetSettings()->GetOmitNonWorkspace()) flags |= MC_IT_OMIT_NONWORKSPACE;
if(m_plugin->GetSettings()->GetOmitDuplications()) flags |= MC_IT_OMIT_DUPLICATIONS;
if(m_plugin->GetSettings()->GetOmitSuppressed()) flags |= MC_IT_OMIT_SUPPRESSED;
size_t i = 0;
MemCheckIterTools::ErrorListIterator it = MemCheckIterTools::Factory(errorList, m_workspacePath, flags);
for(; i < iStart && it != errorList.end(); ++i, ++it)
; // skipping item before start
// CL_DEBUG1(PLUGIN_PREFIX("items skiped"));
m_mgr->GetTheApp()->Yield();
for(; i <= iStop; ++i, ++it) {
if(it == errorList.end()) {
CL_WARNING(PLUGIN_PREFIX("Some items skiped. Total errors count mismatches the iterator."));
break;
}
AddTree(wxDataViewItem(0), *it); // CL_DEBUG1(PLUGIN_PREFIX("adding %lu", i));
if(!(i % WAIT_UPDATE_PER_ITEMS)) m_mgr->GetTheApp()->Yield();
}
}
示例7: wxDataViewItem
wxDataViewItem GNC::GUI::AcquisitionTableModel::GetParent( const wxDataViewItem &item ) const
{
if (!item.IsOk()) {
return wxDataViewItem(0);
}
//if it's a study...
AcquisitionNode* pNode = (AcquisitionNode*)(item.GetID());
return wxDataViewItem( (void*) pNode->GetParent() );
}
示例8: wxDataViewItem
wxDataViewItem TreeListModel::GetParent(const wxDataViewItem& item) const
{
if ( IsEmpty() ) {
return wxDataViewItem(NULL);
}
TreeListModel_Item* node = reinterpret_cast<TreeListModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例9: wxDataViewItem
wxDataViewItem LLDBBreakpointModel::GetParent(const wxDataViewItem& item) const
{
if ( IsEmpty() ) {
return wxDataViewItem(NULL);
}
LLDBBreakpointModel_Item* node = reinterpret_cast<LLDBBreakpointModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例10: wxDataViewItem
wxDataViewItem MemCheckDVCErrorsModel::GetParent(const wxDataViewItem& item) const
{
if ( IsEmpty() ) {
return wxDataViewItem(NULL);
}
MemCheckDVCErrorsModel_Item* node = reinterpret_cast<MemCheckDVCErrorsModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
}
return wxDataViewItem(NULL);
}
示例11: GetParent
virtual wxDataViewItem GetParent(const wxDataViewItem &item) const
{
// the invisible root node has no parent
if (!item.IsOk())
return wxDataViewItem(0);
ReplayProvider* provider = (ReplayProvider*)item.GetID();
if (provider == m_root)
return wxDataViewItem(0);
return wxDataViewItem((void*)provider->GetParent());
}
示例12: CancelCommand
void GNC::GUI::AcquisitionTableModel::ClearResults()
{
CancelCommand();
wxDataViewItemArray toDeleteList;
for (TMapIndex::iterator it = studyMap.begin(); it != studyMap.end(); ++it) {
toDeleteList.push_back(wxDataViewItem((*it).second));
}
//then delete studies Nodes...
ItemsDeleted(wxDataViewItem(0), toDeleteList);
//delete all and reload again...
ClearStudyMap();
}
示例13: wxDataViewItem
wxDataViewItem MyMusicTreeModel::GetParent( const wxDataViewItem &item ) const
{
// the invisible root node has no parent
if (!item.IsOk())
return wxDataViewItem(0);
MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
// "MyMusic" also has no parent
if (node == m_root)
return wxDataViewItem(0);
return wxDataViewItem( (void*) node->GetParent() );
}
示例14: wxDataViewItem
void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Refresh()
{
#ifdef REASSOCIATE_HACK
m_Widget->AssociateModel( this );
#else
std::queue<wxDataViewItem> todo;
todo.push( wxDataViewItem() );
while( !todo.empty() )
{
wxDataViewItem current = todo.front();
wxDataViewItemArray items;
GetChildren( current, items );
ItemsAdded( current, items );
for( wxDataViewItemArray::const_iterator i = items.begin(); i != items.end(); ++i )
{
if( IsContainer( *i ) )
todo.push( *i );
}
todo.pop();
}
#endif
}
示例15: wxDataViewTreeCtrl
/* ActionSpecialTreeView::ActionSpecialTreeView
* ActionSpecialTreeView class constructor
*******************************************************************/
ActionSpecialTreeView::ActionSpecialTreeView(wxWindow* parent) : wxDataViewTreeCtrl(parent, -1)
{
parent_dialog = NULL;
// Create root item
root = wxDataViewItem(0);
// Add 'None'
item_none = AppendItem(root, "0: None");
// Populate tree
vector<as_t> specials = theGameConfiguration->allActionSpecials();
std::sort(specials.begin(), specials.end());
for (unsigned a = 0; a < specials.size(); a++)
{
AppendItem(getGroup(specials[a].special->getGroup()),
S_FMT("%d: %s", specials[a].number, specials[a].special->getName()), -1);
}
// Bind events
Bind(wxEVT_DATAVIEW_ITEM_START_EDITING, &ActionSpecialTreeView::onItemEdit, this);
Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, &ActionSpecialTreeView::onItemActivated, this);
Expand(root);
SetMinSize(wxSize(-1, 200));
}