本文整理汇总了C++中wxList类的典型用法代码示例。如果您正苦于以下问题:C++ wxList类的具体用法?C++ wxList怎么用?C++ wxList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WXUNUSED
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
示例2: WXUNUSED
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
示例3: WXUNUSED
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
示例4: DoCut
void csDiagramView::DoCut(wxList& shapes)
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
if (shapes.GetCount() > 0)
{
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
wxObjectList::compatibility_iterator node = shapes.GetFirst();
while (node)
{
wxShape *theShape = (wxShape*) node->GetData();
csCommandState* state = new csCommandState(ID_CS_CUT, NULL, theShape);
// Insert lines at the front, so they are cut first.
// Otherwise we may try to remove a shape with a line still
// attached.
if (theShape->IsKindOf(CLASSINFO(wxLineShape)))
cmd->InsertState(state);
else
cmd->AddState(state);
node = node->GetNext();
}
cmd->RemoveLines(); // Schedule any connected lines, not already mentioned,
// to be removed first
doc->GetCommandProcessor()->Submit(cmd);
}
}
开发者ID:EdgarTx,项目名称:wx,代码行数:30,代码来源:view.cpp
示例5: ClearSplineList
static void ClearSplineList()
{
wxList::compatibility_iterator node = ocpn_wx_spline_point_list.GetFirst();
while (node)
{
wxPoint *point = (wxPoint *)node->GetData();
delete point;
ocpn_wx_spline_point_list.Erase(node);
node = ocpn_wx_spline_point_list.GetFirst();
}
}
开发者ID:OpenCPN,项目名称:OpenCPN,代码行数:11,代码来源:IsoLine.cpp
示例6: wx_spline_draw_point_array
static void wx_spline_draw_point_array(wxDCBase *dc)
{
dc->DrawLines(&wx_spline_point_list, 0, 0 );
wxList::compatibility_iterator node = wx_spline_point_list.GetFirst();
while (node)
{
wxPoint *point = (wxPoint *)node->GetData();
delete point;
wx_spline_point_list.Erase(node);
node = wx_spline_point_list.GetFirst();
}
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:12,代码来源:dcbase.cpp
示例7: DestroyItemList
void GarbageCollector::DestroyItemList( wxList& lst )
{
wxNode* pNode = lst.GetFirst();
while( pNode )
{
delete &node_to_item( pNode );
pNode = pNode->GetNext();
}
lst.Clear();
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:13,代码来源:garbagec.cpp
示例8: while
void wxFontRefData::ClearX11Fonts()
{
#if wxUSE_UNICODE
#else
wxList::compatibility_iterator node = m_fonts.GetFirst();
while (node)
{
wxXFont* f = (wxXFont*) node->GetData();
delete f;
node = node->GetNext();
}
m_fonts.Clear();
#endif
}
开发者ID:beanhome,项目名称:dev,代码行数:14,代码来源:font.cpp
示例9: RemoveStyle
/// Remove a style
bool wxRichTextStyleSheet::RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle)
{
wxList::compatibility_iterator node = list.Find(def);
if (node)
{
wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData();
list.Erase(node);
if (deleteStyle)
delete def;
return true;
}
else
return false;
}
开发者ID:hgwells,项目名称:tive,代码行数:15,代码来源:richtextstyles.cpp
示例10: GetChildren
void wxTreeLayoutStored::GetChildren(long id, wxList& list)
{
long currentId = GetTopNode();
while (currentId != wxID_ANY)
{
if (id == GetNodeParent(currentId))
list.Append((wxObject *)currentId);
currentId = GetNextNode(currentId);
}
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:10,代码来源:treelay.cpp
示例11: defined
void wxFontRefData::ClearX11Fonts()
{
#if wxUSE_UNICODE
#else
wxList::compatibility_iterator node = m_fonts.GetFirst();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
while (node)
{
wxXFont* f = (wxXFont*) node->GetData();
delete f;
node = node->GetNext();
}
m_fonts.Clear();
#endif
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:23,代码来源:font.cpp
示例12: FindSelectedShapes
void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind)
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->GetData();
if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected() && ((toFind == NULL) || (eachShape->IsKindOf(toFind))))
{
selections.Append(eachShape);
}
node = node->GetNext();
}
}
开发者ID:EdgarTx,项目名称:wx,代码行数:14,代码来源:view.cpp
示例13: DoCmd
// Generalised command
void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxString& op)
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
if (shapes.GetCount() > 0)
{
csDiagramCommand* command = new csDiagramCommand(op, doc);
wxObjectList::compatibility_iterator node = shapes.GetFirst();
wxObjectList::compatibility_iterator node1 = oldShapes.GetFirst();
while (node && node1)
{
wxShape *theShape = (wxShape*) node->GetData();
wxShape *oldShape = (wxShape*) node1->GetData();
csCommandState* state = new csCommandState(cmd, theShape, oldShape);
command->AddState(state);
node = node->GetNext();
node1 = node1->GetNext();
}
doc->GetCommandProcessor()->Submit(command);
}
}
开发者ID:EdgarTx,项目名称:wx,代码行数:24,代码来源:view.cpp
示例14: AddItem
void cbGCUpdatesMgr::AddItem( wxList& itemList,
cbBarInfo* pBar,
cbDockPane* pPane,
wxRect& curBounds,
wxRect& prevBounds )
{
cbRectInfo* pInfo = new cbRectInfo();
pInfo->mpBar = pBar;
pInfo->mpPane = pPane;
pInfo->mpCurBounds = &curBounds;
pInfo->mpPrevBounds = &prevBounds;
itemList.Append( (wxObject*) pInfo );
}
开发者ID:EdgarTx,项目名称:wx,代码行数:15,代码来源:gcupdatesmgr.cpp
示例15: wxT
wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList &constrained)
{
m_xSpacing = 0.0;
m_ySpacing = 0.0;
m_constraintType = type;
m_constrainingObject = constraining;
m_constraintId = 0;
m_constraintName = wxT("noname");
wxNode *node = constrained.GetFirst();
while (node)
{
m_constrainedObjects.Append(node->GetData());
node = node->GetNext();
}
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:18,代码来源:constrnt.cpp
示例16: wxAddAccelerators
// Helper for wxCreateAcceleratorTableForMenuBar
static void wxAddAccelerators(wxList& accelEntries, wxMenu* menu)
{
size_t i;
for (i = 0; i < menu->GetMenuItems().GetCount(); i++)
{
wxMenuItem* item = (wxMenuItem*) menu->GetMenuItems().Item(i)->GetData();
if (item->GetSubMenu())
{
wxAddAccelerators(accelEntries, item->GetSubMenu());
}
else if (!item->GetItemLabel().IsEmpty())
{
wxAcceleratorEntry* entry = wxAcceleratorEntry::Create(item->GetItemLabel());
if (entry)
{
entry->Set(entry->GetFlags(), entry->GetKeyCode(), item->GetId());
accelEntries.Append((wxObject*) entry);
}
}
}
}
开发者ID:Richard-Ni,项目名称:wxWidgets,代码行数:22,代码来源:frame.cpp
示例17: SetModal
void wxDialog::SetModal(bool flag)
{
if ( flag )
wxModelessWindows.DeleteObject(this);
else
wxModelessWindows.Append(this);
}
开发者ID:chromylei,项目名称:third_party,代码行数:7,代码来源:dialog.cpp
示例18: OnClose
void MyFrame::OnClose(wxCloseEvent& event)
{
if ( !event.CanVeto() )
{
event.Skip();
return ;
}
if ( m_children.GetCount () < 1 )
{
event.Skip();
return ;
}
// now try the children
wxObjectList::compatibility_iterator pNode = m_children.GetFirst ();
wxObjectList::compatibility_iterator pNext ;
MyChild * pChild ;
while ( pNode )
{
pNext = pNode -> GetNext ();
pChild = (MyChild*) pNode -> GetData ();
if (pChild -> Close ())
{
m_children.Erase(pNode) ;
}
else
{
event.Veto();
return;
}
pNode = pNext ;
}
event.Skip();
}
开发者ID:EdgarTx,项目名称:wx,代码行数:33,代码来源:svgtest.cpp
示例19: PreDestroy
void wxTopLevelWindowMotif::PreDestroy()
{
#ifdef __VMS
#pragma message disable codcauunr
#endif
if ( (GetWindowStyleFlag() & wxDIALOG_MODAL) != wxDIALOG_MODAL )
wxModelessWindows.DeleteObject(this);
#ifdef __VMS
#pragma message enable codcauunr
#endif
m_icons.m_icons.Empty();
DestroyChildren();
// MessageDialog and FileDialog do not have a client widget
if( GetClientWidget() )
{
XtRemoveEventHandler( (Widget)GetClientWidget(),
ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | KeyPressMask,
False,
wxTLWEventHandler,
(XtPointer)this );
}
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:26,代码来源:toplevel.cpp
示例20: DoShowModal
void wxDialog::DoShowModal()
{
wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") );
wxModalDialogs.Append(this);
SetFocus() ;
#if TARGET_CARBON
BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ;
#else
// TODO : test whether parent gets disabled
bool formerModal = s_macIsInModalLoop ;
s_macIsInModalLoop = true ;
#endif
while ( IsModalShowing() )
{
wxTheApp->MacDoOneEvent() ;
// calls process idle itself
}
#if TARGET_CARBON
EndAppModalStateForWindow( (WindowRef) MacGetWindowRef() ) ;
#else
// TODO probably reenable the parent window if any
s_macIsInModalLoop = formerModal ;
#endif
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:28,代码来源:dialog.cpp
注:本文中的wxList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论