当前位置: 首页>>代码示例>>C++>>正文


C++ wxList::Member方法代码示例

本文整理汇总了C++中wxList::Member方法的典型用法代码示例。如果您正苦于以下问题:C++ wxList::Member方法的具体用法?C++ wxList::Member怎么用?C++ wxList::Member使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxList的用法示例。


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

示例1: OnCloseWindow

void wxDialogBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
    // We'll send a Cancel message by default, which may close the dialog.

    // Check for looping if the Cancel event handler calls Close().
    //
    // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
    //     lists here? don't dare to change it now, but should be done later!
    static wxList closing;

    if ( closing.Member(this) )
        return;

    closing.Append(this);

    if ( !SendCloseButtonClickEvent() )
    {
        // If the handler didn't close the dialog (e.g. because there is no
        // button with matching id) we still want to close it when the user
        // clicks the "x" button in the title bar, otherwise we shouldn't even
        // have put it there.
        //
        // Notice that using wxID_CLOSE might have been a better choice but we
        // use wxID_CANCEL for compatibility reasons.
        EndDialog(wxID_CANCEL);
    }

    closing.DeleteObject(this);
}
开发者ID:hazeeq090576,项目名称:wxWidgets,代码行数:29,代码来源:dlgcmn.cpp

示例2: OnCloseWindow

void wxDialogBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
    // We'll send a Cancel message by default, which may close the dialog.

    // Check for looping if the Cancel event handler calls Close().
    //
    // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
    //     lists here? don't dare to change it now, but should be done later!
    static wxList closing;

    if ( closing.Member(this) )
        return;

    closing.Append(this);

    // When a previously hidden (necessarily modeless) dialog is being closed,
    // we must not perform the usual validation and data transfer steps as they
    // had been already done when it was hidden and doing it again now would be
    // unexpected and could result in e.g. the dialog asking for confirmation
    // before discarding the changes being shown again, which doesn't make
    // sense as the dialog is not being closed in response to any user action.
    if ( !IsShown() || !SendCloseButtonClickEvent() )
    {
        // If the handler didn't close the dialog (e.g. because there is no
        // button with matching id) we still want to close it when the user
        // clicks the "x" button in the title bar, otherwise we shouldn't even
        // have put it there.
        //
        // Notice that using wxID_CLOSE might have been a better choice but we
        // use wxID_CANCEL for compatibility reasons.
        EndDialog(wxID_CANCEL);
    }

    closing.DeleteObject(this);
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:35,代码来源:dlgcmn.cpp

示例3: OnCloseWindow

void wxDialogBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
    // We'll send a Cancel message by default, which may close the dialog.
    // Check for looping if the Cancel event handler calls Close().

    // Note that if a cancel button and handler aren't present in the dialog,
    // nothing will happen when you close the dialog via the window manager, or
    // via Close(). We wouldn't want to destroy the dialog by default, since
    // the dialog may have been created on the stack. However, this does mean
    // that calling dialog->Close() won't delete the dialog unless the handler
    // for wxID_CANCEL does so. So use Destroy() if you want to be sure to
    // destroy the dialog. The default OnCancel (above) simply ends a modal
    // dialog, and hides a modeless dialog.

    int idCancel = GetEscapeId();
    if ( idCancel == wxID_NONE )
        return;
    if ( idCancel == wxID_ANY )
        idCancel = wxID_CANCEL;

    // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
    //     lists here? don't dare to change it now, but should be done later!
    static wxList closing;

    if ( closing.Member(this) )
        return;

    closing.Append(this);

    wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, idCancel);
    cancelEvent.SetEventObject( this );
    GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog

    closing.DeleteObject(this);
}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:35,代码来源:dlgcmn.cpp


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