• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetClientObject函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetClientObject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetClientObject函数的具体用法?C++ GetClientObject怎么用?C++ GetClientObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetClientObject函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxCHECK_RET

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 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,代码来源:choice.cpp


示例2: WXUNUSED

bool 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,代码来源:choice.cpp


示例3: event

bool 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,代码来源:listbox.cpp


示例4: wxCHECK_RET

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 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,代码来源:choice.cpp


示例5: wxCHECK_RET

void 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,代码来源:listbox.cpp


示例6: GetSelection

wxString 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,代码来源:ctlComboBox.cpp


示例7: GetClientObject

void wxItemContainer::ResetItemClientObject(unsigned int n)
{
    wxClientData * const data = GetClientObject(n);
    if ( data )
    {
        delete data;
        DoSetItemClientData(n, NULL);
    }
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:9,代码来源:ctrlsub.cpp


示例8: progress

void 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,代码来源:MainFrame.cpp


示例9: wxSwap

void 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,代码来源:rearrangectrl.cpp


示例10: GetCount

void wxChoice::FreeData()
{
    if ( HasClientObjectData() )
    {
        size_t count = GetCount();
        for ( size_t n = 0; n < count; n++ )
        {
            delete GetClientObject(n);
        }
    }
}
开发者ID:Duion,项目名称:Torsion,代码行数:11,代码来源:choice.cpp


示例11: GetCount

wxChoice::~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,代码来源:choice_osx.cpp


示例12: GetCount

void wxChoice::Free()
{
    if ( HasClientObjectData() )
    {
        unsigned int count = GetCount();
        for ( unsigned int n = 0; n < count; n++ )
        {
            delete GetClientObject(n);
        }
    }
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:11,代码来源:choice.cpp


示例13: wxCHECK_RET

void 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,代码来源:choicece.cpp


示例14: wxCHECK_RET

void 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,代码来源:choice.cpp


示例15: wxCHECK_RET

void 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,代码来源:choice.cpp


示例16: InitCommandEvent

void
wxControlWithItemsBase::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,代码来源:ctrlsub.cpp


示例17: wxCHECK_RET

void 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,代码来源:choice_osx.cpp


示例18: event

bool 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,代码来源:lboxcmn.cpp


示例19: wxCHECK_RET

void 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,代码来源:choice.cpp


示例20: wxCHECK_RET

void 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,代码来源:listbox.cpp



注:本文中的GetClientObject函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetClientRect函数代码示例发布时间:2022-05-30
下一篇:
C++ GetClientName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap