本文整理汇总了C++中wxVector::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ wxVector::begin方法的具体用法?C++ wxVector::begin怎么用?C++ wxVector::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxVector
的用法示例。
在下文中一共展示了wxVector::begin方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessNativeEvents
void wxIOCPThread::ProcessNativeEvents(wxVector<wxEventProcessingData>& events)
{
wxVector<wxEventProcessingData>::iterator it = events.begin();
for ( ; it != events.end(); ++it )
{
const FILE_NOTIFY_INFORMATION& e = *(it->nativeEvent);
const wxFSWatchEntryMSW* watch = it->watch;
wxLogTrace( wxTRACE_FSWATCHER, "[iocp] %s",
FileNotifyInformationToString(e));
int nativeFlags = e.Action;
int flags = Native2WatcherFlags(nativeFlags);
if (flags & wxFSW_EVENT_WARNING || flags & wxFSW_EVENT_ERROR)
{
wxFileSystemWatcherEvent
event(flags,
flags & wxFSW_EVENT_ERROR ? wxFSW_WARNING_NONE
: wxFSW_WARNING_GENERAL);
SendEvent(event);
}
// filter out ignored events and those not asked for.
// we never filter out warnings or exceptions
else if ((flags == 0) || !(flags & watch->GetFlags()))
{
return;
}
// rename case
else if (nativeFlags == FILE_ACTION_RENAMED_OLD_NAME)
{
wxFileName oldpath = GetEventPath(*watch, e);
wxFileName newpath;
// newpath should be in the next entry. what if there isn't?
++it;
if ( it != events.end() )
{
newpath = GetEventPath(*(it->watch), *(it->nativeEvent));
}
wxFileSystemWatcherEvent event(flags, oldpath, newpath);
SendEvent(event);
}
// all other events
else
{
// CHECK I heard that returned path can be either in short on long
// form...need to account for that!
wxFileName path = GetEventPath(*watch, e);
// For files, check that it matches any filespec
if ( m_service->MatchesFilespec(path, watch->GetFilespec()) )
{
wxFileSystemWatcherEvent event(flags, path, path);
SendEvent(event);
}
}
}
}
示例2: DestroyWindow
// window procedure of a hidden window which is created just to receive
// the notification message when a process exits
LRESULT APIENTRY
wxExecuteWindowCbk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if ( message == wxWM_PROC_TERMINATED )
{
DestroyWindow(hWnd); // we don't need it any more
wxExecuteData * const data = (wxExecuteData *)lParam;
if ( data->handler )
{
data->handler->OnTerminate((int)data->dwProcessId,
(int)data->dwExitCode);
}
if ( data->state )
{
// we're executing synchronously, tell the waiting thread
// that the process finished
data->state = false;
}
else
{
// asynchronous execution - we should do the clean up
#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 */
for ( wxVector<HANDLE>::iterator it = gs_asyncThreads.begin();
it != gs_asyncThreads.end();
++it )
{
if ( *it == data->hThread )
{
gs_asyncThreads.erase(it);
if ( !::CloseHandle(data->hThread) )
{
wxLogLastError(wxT("CloseHandle(hThread)"));
}
break;
}
}
delete data;
}
return 0;
}
else
{
return ::DefWindowProc(hWnd, message, wParam, lParam);
}
}
示例3: StartNextTestIfNecessary
void MyClient::StartNextTestIfNecessary()
{
while ( !m_tests.empty() )
{
MyClientTestFunc testfunc = m_tests.front();
m_tests.erase(m_tests.begin());
(this->*testfunc)();
}
}
示例4:
virtual ~MyClass()
{
for ( size_t i=0; i<gs_myClassInstances.size(); i++ )
{
if ( gs_myClassInstances[i] == this )
{
gs_myClassInstances.erase(gs_myClassInstances.begin()+i);
}
}
}
示例5: SoundStopped
// Notification when a sound has stopped
void wxSound::SoundStopped(const wxSoundData* data)
{
for ( wxVector<wxSoundData*>::iterator s = s_soundsPlaying.begin();
s != s_soundsPlaying.end(); ++s )
{
if ( (*s) == data )
{
s_soundsPlaying.erase(s);
break;
}
}
}
示例6: RemoveVisibleNotification
void wxNotificationMessageWindow::RemoveVisibleNotification(wxNotificationMessageWindow* notif)
{
for ( wxVector<wxNotificationMessageWindow*>::iterator it = ms_visibleNotifications.begin();
it != ms_visibleNotifications.end(); ++it )
{
if ( *it == notif )
{
ms_visibleNotifications.erase(it);
break;
}
}
ResizeAndFitVisibleNotifications();
}
示例7: AddVisibleNotification
void wxNotificationMessageWindow::AddVisibleNotification(wxNotificationMessageWindow* notif)
{
bool found = false;
for ( wxVector<wxNotificationMessageWindow*>::iterator it = ms_visibleNotifications.begin();
it != ms_visibleNotifications.end(); ++it )
{
if ( *it == notif )
{
found = true;
break;
}
}
if ( !found )
ms_visibleNotifications.push_back(notif);
ResizeAndFitVisibleNotifications();
}
示例8: defined
virtual ~MyClass()
{
#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 */
for ( size_t i=0; i<gs_myClassInstances.size(); i++ )
{
if ( gs_myClassInstances[i] == this )
{
gs_myClassInstances.erase(gs_myClassInstances.begin()+i);
}
}
}
示例9: ResizeAndFitVisibleNotifications
void wxNotificationMessageWindow::ResizeAndFitVisibleNotifications()
{
if ( ms_presentationDirection == 0 )
{
// Determine presentation position
wxDisplay display;
wxRect clientArea = display.GetClientArea();
wxRect geom = display.GetGeometry();
if ( clientArea.y > 0 ) // Taskbar is at top
{
ms_presentationDirection = 1;
ms_presentationPos = clientArea.GetTopRight();
}
else if ( clientArea.GetHeight() != geom.GetHeight() ) // Taskbar at bottom
{
ms_presentationDirection = -1;
ms_presentationPos = clientArea.GetBottomRight();
}
else // Default to upper right screen corner with some padding
{
ms_presentationDirection = 1;
ms_presentationPos.x = geom.GetWidth() - 30;
ms_presentationPos.y = 30;
}
}
int maxWidth = -1;
// Determine max width
for (wxVector<wxNotificationMessageWindow*>::iterator notif = ms_visibleNotifications.begin();
notif != ms_visibleNotifications.end(); ++notif)
{
wxSize notifSize = (*notif)->GetSize();
if ( notifSize.GetWidth() > maxWidth )
maxWidth = notifSize.GetWidth();
}
int notifPadding = 2;
wxPoint presentPos = ms_presentationPos;
presentPos.x -= notifPadding + maxWidth;
int prevNotifHeight = 0;
for (wxVector<wxNotificationMessageWindow*>::iterator notif = ms_visibleNotifications.begin();
notif != ms_visibleNotifications.end(); ++notif)
{
// Modify existing maxwidth
wxSize notifSize = (*notif)->GetSize();
if ( notifSize.GetWidth() < maxWidth )
{
notifSize.SetWidth(maxWidth);
(*notif)->SetSize(notifSize);
(*notif)->Layout();
}
if ( ms_presentationDirection > 0 )
{
presentPos.y += (notifPadding + prevNotifHeight);
prevNotifHeight = notifSize.GetHeight();
}
else
{
presentPos.y -= (notifPadding + notifSize.GetHeight());
}
(*notif)->SetPosition(presentPos);
}
}