这篇教程C++ GetClientObject函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetClientObject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetClientObject函数的具体用法?C++ GetClientObject怎么用?C++ GetClientObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetClientObject函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxCHECK_RETvoid 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 manually void *oldData = NULL; wxClientData *oldObjData = NULL; if ( HasClientUntypedData() ) oldData = GetClientData(n); else if ( HasClientObjectData() ) oldObjData = GetClientObject(n); // and also the selection if we're going to delete the item that was // selected const bool wasSelected = static_cast<int>(n) == GetSelection(); ::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.wx_str() ); // restore the client data if ( oldData ) SetClientData(n, oldData); else if ( oldObjData ) SetClientObject(n, oldObjData); // and the selection if ( wasSelected ) SetSelection(n); // the width could have changed so the best size needs to be recomputed InvalidateBestSize();}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:35,
示例2: WXUNUSEDbool wxChoice::OS2Command( WXUINT uParam, WXWORD WXUNUSED(wId)){ if (uParam != LN_SELECT) { // // "selection changed" is the only event we're after // return false; } int n = GetSelection(); if (n > -1) { wxCommandEvent vEvent( wxEVT_CHOICE ,m_windowId ); vEvent.SetInt(n); vEvent.SetEventObject(this); vEvent.SetString(GetStringSelection()); if (HasClientObjectData()) vEvent.SetClientObject(GetClientObject(n)); else if (HasClientUntypedData()) vEvent.SetClientData(GetClientData(n)); ProcessCommand(vEvent); } return true;} // end of wxChoice::OS2Command
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:31,
示例3: eventbool wxListBox::SendEvent(wxEventType type, int item){ wxCommandEvent event(type, m_windowId); event.SetEventObject(this); // use the current item by default if ( item == -1 ) { item = m_current; } // client data and string parameters only make sense if we have an item if ( item != -1 ) { if ( HasClientObjectData() ) event.SetClientObject(GetClientObject(item)); else if ( HasClientUntypedData() ) event.SetClientData(GetClientData(item)); event.SetString(GetString(item)); } event.SetInt(item); return GetEventHandler()->ProcessEvent(event);}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:26,
示例4: wxCHECK_RETvoid 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 manually void *oldData = NULL; wxClientData *oldObjData = NULL; if ( HasClientUntypedData() ) oldData = GetClientData(n); else if ( HasClientObjectData() ) oldObjData = GetClientObject(n); ::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.wx_str() ); // restore the client data if ( oldData ) SetClientData(n, oldData); else if ( oldObjData ) SetClientObject(n, oldObjData); InvalidateBestSize();}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:26,
示例5: wxCHECK_RETvoid wxListBox::SetString(unsigned int n, const wxString& rsString){ wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetString") ); // // Remember the state of the item // bool bWasSelected = IsSelected(n); void* pOldData = NULL; wxClientData* pOldObjData = NULL; if ( HasClientUntypedData() ) pOldData = GetClientData(n); else if ( HasClientObjectData() ) pOldObjData = GetClientObject(n); // // Delete and recreate it // ::WinSendMsg( GetHwnd() ,LM_DELETEITEM ,(MPARAM)n ,(MPARAM)0 ); int nNewN = n; if (n == (m_nNumItems - 1)) nNewN = -1; ::WinSendMsg( GetHwnd() ,LM_INSERTITEM ,(MPARAM)nNewN ,(MPARAM)rsString.wx_str() ); // // Restore the client data // if (pOldData) SetClientData(n, pOldData); else if (pOldObjData) SetClientObject(n, pOldObjData); // // We may have lost the selection // if (bWasSelected) Select(n);#if wxUSE_OWNER_DRAWN if (m_windowStyle & wxLB_OWNERDRAW) // // Update item's text // m_aItems[n]->SetName(rsString);#endif //USE_OWNER_DRAWN} // end of wxListBox::SetString
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:59,
示例6: GetSelectionwxString ctlComboBoxFix::GetStringKey(int sel){ if (sel < 0) sel = GetSelection(); StringClientData *scd=(StringClientData*)GetClientObject(sel); if (scd) return scd->str; return wxEmptyString;}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:9,
示例7: GetClientObjectvoid wxItemContainer::ResetItemClientObject(unsigned int n){ wxClientData * const data = GetClientObject(n); if ( data ) { delete data; DoSetItemClientData(n, NULL); }}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:9,
示例8: progressvoid MainFrame::OnImageButtonClick(wxCommandEvent &event) { wxProgressDialog progress("Loading", "Now Loading", 4, this); auto button = dynamic_cast<wxButton *>(event.GetEventObject()); auto clientData = dynamic_cast<wxStringClientData *>(button->GetClientObject()); auto page = notebook->GetPageCount(); progress.Update(1); auto childEntry = dynamic_cast<EntryItemData *>(button->GetClientObject())->Get(); progress.Update(2); auto bitmapCtl = new ImageViewPanel(notebook, childEntry); progress.Update(3); notebook->AddPage(bitmapCtl, childEntry->Name()); progress.Update(4); bitmapCtl->SwitchToTheActualImage(); notebook->SetSelection(page);}
开发者ID:wutipong,项目名称:ZipPicViewWx,代码行数:18,
示例9: wxSwapvoid wxRearrangeList::Swap(int pos1, int pos2){ // update the internally stored order wxSwap(m_order[pos1], m_order[pos2]); // and now also swap all the attributes of the items // first the label const wxString stringTmp = GetString(pos1); SetString(pos1, GetString(pos2)); Check(pos1, IsChecked(pos2)); // then the checked state const bool checkedTmp = IsChecked(pos1); SetString(pos2, stringTmp); Check(pos2, checkedTmp); // and finally the client data, if necessary switch ( GetClientDataType() ) { case wxClientData_None: // nothing to do break; case wxClientData_Object: { wxClientData * const dataTmp = GetClientObject(pos1); SetClientObject(pos1, GetClientObject(pos2)); SetClientObject(pos2, dataTmp); } break; case wxClientData_Void: { void * const dataTmp = GetClientData(pos1); SetClientData(pos1, GetClientData(pos2)); SetClientData(pos2, dataTmp); } break; }}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:42,
示例10: GetCountvoid wxChoice::FreeData(){ if ( HasClientObjectData() ) { size_t count = GetCount(); for ( size_t n = 0; n < count; n++ ) { delete GetClientObject(n); } }}
开发者ID:Duion,项目名称:Torsion,代码行数:11,
示例11: GetCountwxChoice::~wxChoice(){ if ( HasClientObjectData() ) { unsigned int i, max = GetCount(); for ( i = 0; i < max; ++i ) delete GetClientObject( i ); } delete m_popUpMenu;}
开发者ID:chromylei,项目名称:third_party,代码行数:11,
示例12: GetCountvoid wxChoice::Free(){ if ( HasClientObjectData() ) { unsigned int count = GetCount(); for ( unsigned int n = 0; n < count; n++ ) { delete GetClientObject(n); } }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:11,
示例13: wxCHECK_RETvoid wxChoice::Delete(int n){ wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") ); if ( HasClientObjectData() ) { delete GetClientObject(n); } ::SendMessage(GetBuddyHwnd(), LB_DELETESTRING, n, 0);}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:11,
示例14: wxCHECK_RETvoid wxChoice::Delete(int n){ wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") ); if ( HasClientObjectData() ) { delete GetClientObject(n); } ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ; m_strings.RemoveAt( n ) ; m_datas.RemoveAt( n ) ; m_peer->SetMaximum( GetCount() ) ;}
开发者ID:Duion,项目名称:Torsion,代码行数:12,
示例15: wxCHECK_RETvoid wxChoice::Delete(unsigned int n){ wxCHECK_RET( IsValid(n) , wxT("wxChoice::Delete: invalid index") ); if ( HasClientObjectData() ) delete GetClientObject( n ); ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1 ) ; m_strings.RemoveAt( n ) ; m_datas.RemoveAt( n ) ; m_peer->SetMaximum( GetCount() ) ;}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:12,
示例16: InitCommandEventvoidwxControlWithItemsBase::InitCommandEventWithItems(wxCommandEvent& event, int n){ InitCommandEvent(event); if ( n != wxNOT_FOUND ) { if ( HasClientObjectData() ) event.SetClientObject(GetClientObject(n)); else if ( HasClientUntypedData() ) event.SetClientData(GetClientData(n)); }}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:13,
示例17: wxCHECK_RETvoid wxChoice::DoDeleteOneItem(unsigned int n){ wxCHECK_RET( IsValid(n) , wxT("wxChoice::Delete: invalid index") ); if ( HasClientObjectData() ) delete GetClientObject( n ); m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) ); m_strings.RemoveAt( n ) ; m_datas.RemoveAt( n ) ; DoAfterItemCountChange();}
开发者ID:chromylei,项目名称:third_party,代码行数:14,
示例18: eventbool wxListBoxBase::SendEvent(wxEventType evtType, int item, bool selected){ wxCommandEvent event(evtType, GetId()); event.SetEventObject(this); event.SetInt(item); event.SetString(GetString(item)); event.SetExtraLong(selected); if ( HasClientObjectData() ) event.SetClientObject(GetClientObject(item)); else if ( HasClientUntypedData() ) event.SetClientData(GetClientData(item)); return HandleWindowEvent(event);}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:16,
示例19: wxCHECK_RETvoid wxChoice::Delete(unsigned int n){ wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") ); if ( HasClientObjectData() ) { delete GetClientObject(n); } SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); if ( !IsFrozen() ) UpdateVisibleHeight(); InvalidateBestSize();}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:16,
示例20: wxCHECK_RETvoid wxListBox::SetString(int N, const wxString& s){ wxCHECK_RET( N >= 0 && N < m_noItems, wxT("invalid index in wxListBox::SetString") ); // remember the state of the item bool wasSelected = IsSelected(N); void *oldData = NULL; wxClientData *oldObjData = NULL; if ( m_clientDataItemsType == wxClientData_Void ) oldData = GetClientData(N); else if ( m_clientDataItemsType == wxClientData_Object ) oldObjData = GetClientObject(N); // delete and recreate it SendMessage(GetHwnd(), LB_DELETESTRING, N, 0); int newN = N; if ( N == m_noItems - 1 ) newN = -1; ListBox_InsertString(GetHwnd(), newN, s); // restore the client data if ( oldData ) SetClientData(N, oldData); else if ( oldObjData ) SetClientObject(N, oldObjData);#if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { // update item's text m_aItems[N]->SetName(s); // reassign the item's data ListBox_SetItemData(GetHwnd(), N, m_aItems[N]); }#endif //USE_OWNER_DRAWN // we may have lost the selection if ( wasSelected ) Select(N); InvalidateBestSize();}
开发者ID:gitrider,项目名称:wxsj2,代码行数:47,
示例21: WXUNUSEDbool wxListBox::OS2Command( WXUINT uParam, WXWORD WXUNUSED(wId)){ wxEventType eEvtType; if (uParam == LN_SELECT) { eEvtType = wxEVT_COMMAND_LISTBOX_SELECTED; } else if (uParam == LN_ENTER) { eEvtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED; } else { // // Some event we're not interested in // return false; } wxCommandEvent vEvent( eEvtType ,m_windowId ); vEvent.SetEventObject(this); wxArrayInt aSelections; int n; int nCount = GetSelections(aSelections); if (nCount > 0) { n = aSelections[0]; if (HasClientObjectData()) vEvent.SetClientObject(GetClientObject(n)); else if ( HasClientUntypedData() ) vEvent.SetClientData(GetClientData(n)); vEvent.SetString(GetString(n)); } else { n = -1; } vEvent.SetInt(n); return GetEventHandler()->ProcessEvent(vEvent);} // end of wxListBox::OS2Command
开发者ID:Duion,项目名称:Torsion,代码行数:47,
示例22: wxCHECK_RETvoid wxListBox::SetString(unsigned int n, const wxString& s){ wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetString") ); // remember the state of the item bool wasSelected = IsSelected(n); void *oldData = NULL; wxClientData *oldObjData = NULL; if ( m_clientDataItemsType == wxClientData_Void ) oldData = GetClientData(n); else if ( m_clientDataItemsType == wxClientData_Object ) oldObjData = GetClientObject(n); // delete and recreate it SendMessage(GetHwnd(), LB_DELETESTRING, n, 0); int newN = n; if ( n == (m_noItems - 1) ) newN = -1; ListBox_InsertString(GetHwnd(), newN, s); // restore the client data if ( oldData ) SetClientData(n, oldData); else if ( oldObjData ) SetClientObject(n, oldObjData);#if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { // update item's text m_aItems[n]->SetName(s); // reassign the item's data ListBox_SetItemData(GetHwnd(), n, m_aItems[n]); }#endif //USE_OWNER_DRAWN // we may have lost the selection if ( wasSelected ) Select(n); SetHorizontalExtent();}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:47,
示例23: WX_CLEAR_ARRAYvoid wxListBox::Free(){#if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { WX_CLEAR_ARRAY(m_aItems); } else#endif // wxUSE_OWNER_DRAWN if ( HasClientObjectData() ) { for ( unsigned int n = 0; n < m_noItems; n++ ) { delete GetClientObject(n); } }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:17,
示例24: GetSelectionsvoid wxListBox::MacDoClick(){ wxArrayInt aSelections; int n ; size_t count = GetSelections(aSelections); if ( count == m_selectionPreImage.GetCount() ) { bool hasChanged = false ; for ( size_t i = 0 ; i < count ; ++i ) { if ( aSelections[i] != m_selectionPreImage[i] ) { hasChanged = true ; break ; } } if ( !hasChanged ) { return ; } } m_selectionPreImage = aSelections; wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); event.SetEventObject( this ); if ( count > 0 ) { n = aSelections[0]; if ( HasClientObjectData() ) event.SetClientObject( GetClientObject(n) ); else if ( HasClientUntypedData() ) event.SetClientData( GetClientData(n) ); event.SetString(GetString(n)); } else { n = -1; } event.SetInt(n); GetEventHandler()->ProcessEvent(event);}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:46,
示例25: WXUNUSEDbool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)){ if ((param == LBN_SELCHANGE) && HasMultipleSelection()) { CalcAndSendEvent(); return true; } wxEventType evtType; int n; if ( param == LBN_SELCHANGE ) { evtType = wxEVT_COMMAND_LISTBOX_SELECTED; n = SendMessage(GetHwnd(), LB_GETCARETINDEX, 0, 0); // NB: conveniently enough, LB_ERR is the same as wxNOT_FOUND } else if ( param == LBN_DBLCLK ) { evtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED; n = HitTest(ScreenToClient(wxGetMousePosition())); } else { // some event we're not interested in return false; } // retrieve the affected item if ( n == wxNOT_FOUND ) return false; wxCommandEvent event(evtType, m_windowId); event.SetEventObject(this); if ( HasClientObjectData() ) event.SetClientObject( GetClientObject(n) ); else if ( HasClientUntypedData() ) event.SetClientData( GetClientData(n) ); event.SetString(GetString(n)); event.SetInt(n); return HandleWindowEvent(event);}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:45,
示例26: GetAttr virtual bool GetAttr(const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr & attr) const { if ( col == 1 ) { clFunctionImplDetails *cd = dynamic_cast<clFunctionImplDetails*>( GetClientObject(item)); if ( !cd->IsSelected() ) { attr.SetColour( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT ) ); attr.SetBold(false); } else { attr.SetBold(true); } return true; } else { return false; } }
开发者ID:05storm26,项目名称:codelite,代码行数:18,
示例27: WXUNUSEDwxInt32 wxChoice::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) ){ wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); int n = GetSelection(); // actually n should be made sure by the os to be a valid selection, but ... if ( n > -1 ) { event.SetInt( n ); event.SetString(GetStringSelection()); event.SetEventObject(this); if ( HasClientObjectData() ) event.SetClientObject( GetClientObject(n) ); else if ( HasClientUntypedData() ) event.SetClientData( GetClientData(n) ); ProcessCommand(event); } return noErr ;}
开发者ID:Duion,项目名称:Torsion,代码行数:18,
注:本文中的GetClientObject函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetClientRect函数代码示例 C++ GetClientName函数代码示例 |