本文整理汇总了C++中wxIdleEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxIdleEvent类的具体用法?C++ wxIdleEvent怎么用?C++ wxIdleEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxIdleEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnIdle
/// Auto-select from style under caret in idle time
void wxRichTextStyleListBox::OnIdle(wxIdleEvent& event)
{
if (CanAutoSetSelection() && GetRichTextCtrl() && IsShownOnScreen() && wxWindow::FindFocus() != this)
{
wxString styleName = GetStyleToShowInIdleTime(GetRichTextCtrl(), GetStyleType());
int sel = GetSelection();
if (!styleName.IsEmpty())
{
// Don't do the selection if it's already set
if (sel == GetIndexForStyle(styleName))
return;
SetStyleSelection(styleName);
}
else if (sel != -1)
SetSelection(-1);
}
event.Skip();
}
示例2: OnIdle
void wxExFrameWithHistory::OnIdle(wxIdleEvent& event)
{
event.Skip();
const wxString title(GetTitle());
if (title.empty())
{
return;
}
#ifdef wxExUSE_CPP0X
auto* stc = GetSTC();
auto* project = GetProject();
#else
wxExSTC* stc = GetSTC();
wxExListViewFile* project = GetProject();
#endif
const wxUniChar indicator('*');
if ((project != NULL && project->GetContentsChanged()) ||
// using GetContentsChanged gives assert in vcs dialog
(stc != NULL && stc->GetModify() && stc->AllowChangeIndicator()))
{
// Project or editor changed, add indicator if not yet done.
if (title.Last() != indicator)
{
SetTitle(title + " " + indicator);
}
}
else
{
// Project or editor not changed, remove indicator if not yet done.
if (title.Last() == indicator && title.size() > 2)
{
SetTitle(title.substr(0, title.length() - 2));
}
}
}
示例3: OnIdle
void DropDownPopup::OnIdle( wxIdleEvent& event )
{
if (IsShown())
{
m_mouse = ScreenToClient(wxGetMousePosition());
wxPrintf(wxT("OnIdle mouse %d %d\n"), m_mouse.x, m_mouse.y);
wxWindow *child = GetChild();
if (!child) return; // nothing to do
wxRect clientRect(GetClientRect());
//wxPrintf(wxT("**DropDownPopup::OnIdle mouse %d %d -- %d %d %d\n"), m_mouse.x, m_mouse.y, m_popped_handler, m_child, m_handlerPopup); fflush(stdout);
// pop the event handler if inside the child window or
// restore the event handler if not in the child window
if (clientRect.Contains(m_mouse))
PopPopupHandler(child);
else
PushPopupHandler(child);
}
event.Skip();
}
示例4: OnIdle
void DendrogramPanel::OnIdle(wxIdleEvent& event)
{
if (isResize && isWindowActive) {
isResize = false;
wxSize sz = GetClientSize();
if (sz.x > 0 && sz.y > 0) {
if (layer_bm) {
delete layer_bm;
layer_bm = 0;
}
double scale_factor = GetContentScaleFactor();
layer_bm = new wxBitmap;
layer_bm->CreateScaled(sz.x, sz.y, 32, scale_factor);
if (root) init();
}
}
event.Skip();
}
示例5: OnIdle
void CTimeBarFrame::OnIdle(wxIdleEvent& event)
{
if (m_bPlaying)
{
wxLongLong timeNow = wxGetLocalTimeMillis();
if (m_nIntervalMS < timeNow - m_nBeginTime)
{
m_nBeginTime = timeNow;
BEATS_ASSERT(m_uMaxFrameIndex != 0);
if (m_nPlayType == 0)
{
if ((m_nCursorPos + 1) >(int)m_uMaxFrameIndex)
{
m_bPlaying = false;
}
}
SetCursorPos((m_nCursorPos + 1) % (m_uMaxFrameIndex + 1));
}
}
event.Skip();
}
示例6:
void
GLCanvas::OnIdle(wxIdleEvent& event) {
//if (!inited) {
// ((FrmMainFrame *)mParent)->init();
// inited = true;
//}
if (!m_pEngine)
return;
{
PROFILE("Nau");
if (!isPaused) {
this->Render();
if (APISupport->apiSupport(IAPISupport::BUFFER_ATOMICS))
DlgAtomics::Instance()->update();
}
event.RequestMore();
}
if (m_pEngine->getProfileResetRequest())
Profile::Reset();
}
示例7: OnIdle
void CUnitPane::OnIdle(wxIdleEvent& event)
{
// Set sorting
if (m_ColClicked>=0)
{
CListLayoutItem * p;
int col = m_ColClicked;
m_ColClicked = -1;
p = (CListLayoutItem*)m_pLayout->At(col);
if (p)
{
wxString choice, message=wxString::FromAscii(p->m_Caption), caption=wxT("Set sort order");
wxString choices[NUM_SORTS-1];
choices[0]=wxT("primary");
choices[1]=wxT("secondary");
choices[2]=wxT("tertiary");
choice = wxGetSingleChoice(message, caption, NUM_SORTS-1, choices, m_pParent);
if (!choice.IsEmpty())
{
int key;
if (0==stricmp(choice.mb_str(), "primary"))
key = 0;
else if (0==stricmp(choice.mb_str(), "secondary"))
key = 1;
else
key = 2;
SetSortName(key, p->m_Name);
Sort();
}
}
}
//CListPane::OnIdle(event);
event.Skip();
}
示例8: OnIdle
void wxlCan::OnIdle(wxIdleEvent &event)
{
if ( m_pendingObjects )
{
m_rootobject.Update( 0, 0 );
// we will now render all objects stored in the canvas to a bitmap
wxMemoryDC mdc;
mdc.SelectObject( m_buffer );
//draw object into buffer
Render( mdc );
mdc.SelectObject( wxNullBitmap );
// force a repaint in OnPaint()
Refresh();
m_pendingObjects = false;
}
event.Skip(); //always skip idle events
}
示例9: idleHandler
void gravApp::idleHandler( wxIdleEvent& evt )
{
// start secondary thread if not running
if ( usingThreads && !threadRunning )
{
grav->setThreads( usingThreads );
threadRunning = true;
VPMthread = thread_start( threadTest, this );
}
if ( !usingThreads )
sessionManager->iterateSessions();
if ( timerIntervalUS > 0 )
{
// this is the method for rendering on idle, with a limiter based on the
// timer interval
unsigned long time = (unsigned long)timer->getTiming();
if ( time > (unsigned long)timerIntervalUS )
{
//gravUtil::logVerbose( "%lu\n", time );
canvas->draw();
timer->resetTiming();
}
else
{
wxMilliSleep( 1 );
}
}
// otherwise (if fps value isn't set) just constantly draw - if vsync is on,
// will be limited to vsync
else if ( timerIntervalUS == 0 )
{
canvas->draw();
}
evt.RequestMore();
}
示例10: OnIdle
void OnIdle(wxIdleEvent& event)
{
if ( m_runTests )
{
m_runTests = false;
#ifdef __WXOSX__
// we need to wait until the window is activated and fully ready
// otherwise no events can be posted
wxEventLoopBase* const loop = wxEventLoop::GetActive();
if ( loop )
{
loop->DispatchTimeout(1000);
loop->Yield();
}
#endif // __WXOSX__
m_exitcode = RunTests();
ExitMainLoop();
}
event.Skip();
}
示例11: OnIdle
void MyFrame::OnIdle(wxIdleEvent& event)
{
// This code is useful for debugging focus problems
// (which are plentiful when dealing with popup windows).
#if 0
static wxWindow* lastFocus = (wxWindow*) NULL;
wxWindow* curFocus = ::wxWindow::FindFocus();
if ( curFocus != lastFocus )
{
const wxChar* className = wxT("<none>");
if ( curFocus )
className = curFocus->GetClassInfo()->GetClassName();
lastFocus = curFocus;
wxLogDebug( wxT("FOCUSED: %s %X"),
className,
(unsigned int)curFocus);
}
#endif
event.Skip();
}
示例12: OnIdle
void GotoFileDlg::OnIdle(wxIdleEvent& event) {
if (!m_project.HasProject()) return; // No project, so no files to load.
if (m_filesLoaded) return; // Already done loading files.
if (m_dirStack.empty()) {
const wxString root_path = m_project.GetRoot().GetPath();
m_files.reserve(100);
BuildFileList(root_path);
}
else {
DirState& dirState = *m_dirStack.back();
// Get next subdir
if (dirState.WalkFolders()) {
const wxString fulldirname = dirState.FullFolderName();
wxLogDebug(fulldirname);
BuildFileList(fulldirname);
}
else {
// All sub-dirs visited
if (dirState.info) {
m_filters.pop_back();
delete dirState.info;
}
delete m_dirStack.back();
m_dirStack.pop_back();
if (m_dirStack.empty())
m_filesLoaded = true;
}
}
m_cmdList->UpdateList();
if (!m_dirStack.empty()) event.RequestMore();
}
示例13: OnIdle
void wxNewBitmapButton::OnIdle(wxIdleEvent& event)
{
DoButtonUpdate();
event.Skip();
}
示例14: bmx_wxidleevent_morerequested
int bmx_wxidleevent_morerequested(wxIdleEvent & event) {
return static_cast<int>(event.MoreRequested());
}
示例15: bmx_wxidleevent_requestmore
void bmx_wxidleevent_requestmore(wxIdleEvent & event, int needMore) {
event.RequestMore(static_cast<bool>(needMore));
}