void *wxItemContainer::GetClientData(unsigned int n) const { wxCHECK_MSG( HasClientUntypedData(), NULL, wxT("this window doesn't have void client data") ); return DoGetItemClientData(n); }
void wxChoice::SetString(unsigned int n, const wxString& s) { wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::SetString") ); // we have to delete and add back the string as there is no way to change a // string in place // we need to preserve the client data void *data; if ( m_clientDataItemsType != wxClientData_None ) { data = DoGetItemClientData(n); } else // no client data { data = NULL; } ::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.c_str() ); if ( data ) { DoSetItemClientData(n, data); } //else: it's already NULL by default InvalidateBestSize(); }
wxClientData *wxItemContainer::GetClientObject(unsigned int n) const { wxCHECK_MSG( HasClientObjectData(), NULL, wxT("this window doesn't have object client data") ); return static_cast<wxClientData *>(DoGetItemClientData(n)); }
void *wxItemContainer::GetClientData(int n) const { wxASSERT_MSG( m_clientDataItemsType == wxClientData_Void, wxT("this window doesn't have void client data") ); return DoGetItemClientData(n); }
void wxChoice::SetString(unsigned int n, const wxString& rsStr) { LONG nIndexType = 0; void* pData; if ( HasClientData() ) { pData = DoGetItemClientData(n); } else // no client data { pData = NULL; } ::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, 0); if (m_windowStyle & wxCB_SORT) nIndexType = LIT_SORTASCENDING; else nIndexType = LIT_END; ::WinSendMsg( GetHwnd() ,LM_INSERTITEM ,(MPARAM)nIndexType ,(MPARAM)rsStr.wx_str() ); if (pData) { DoSetItemClientData(n, pData); } } // end of wxChoice::SetString
void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data) { wxASSERT_MSG( !HasClientUntypedData(), wxT("can't have both object and void client data") ); if ( HasClientObjectData() ) { wxClientData * clientDataOld = static_cast<wxClientData *>(DoGetItemClientData(n)); if ( clientDataOld ) delete clientDataOld; } else // didn't have any client data so far { // now we have object client data DoInitItemClientData(); SetClientDataType(wxClientData_Object); } DoSetItemClientData(n, data); }
void LocalsView::OnLocalExpanding(wxDataViewEvent& event) { event.Skip(); CHECK_ITEM_RET( event.GetItem() ); wxDataViewItem item = event.GetItem(); wxDataViewItemArray children; if ( m_dataviewModel->GetChildren( item , children ) && children.GetCount() == 1 ) { wxDataViewItem child = children.Item(0); wxVariant v; m_dataviewModel->GetValue(v, child, 0); if ( v.GetString() == "<dummy>" ) { // a dummy node has been found // Delete this node and request from XDebug to expand it m_dataviewModel->SetValue( wxString("Loading..."), child, 0 ); wxString propertyName = DoGetItemClientData( event.GetItem() ); XDebugManager::Get().SendGetProperty( propertyName ); m_waitingExpand.insert( std::make_pair(propertyName, item) ); } } }
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const { return (wxClientData *)DoGetItemClientData(n); }
wxClientData* wxListBox::DoGetItemClientObject( int n ) const { return (wxClientData *)DoGetItemClientData(n); }
wxClientData* wxOwnerDrawnComboBox::DoGetItemClientObject(unsigned int n) const { return (wxClientData*) DoGetItemClientData(n); }
wxClientData* wxChoice::DoGetItemClientObject( int n ) const { return (wxClientData *)DoGetItemClientData(n); } // end of wxChoice::DoGetItemClientObject
wxClientData* wxCheckListBox::DoGetItemClientObject(unsigned int n) const { return (wxClientData *)DoGetItemClientData(n); }