本文整理汇总了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);
}
示例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);
}
示例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);
}