• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxIdleEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了wxIdleEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:21,代码来源:richtextstyles.cpp


示例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));
    }
  }
}
开发者ID:Emmavw,项目名称:wxExtension,代码行数:41,代码来源:frame.cpp


示例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();
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:21,代码来源:dropdown.cpp


示例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();
}
开发者ID:lixun910,项目名称:geoda,代码行数:21,代码来源:HClusterDlg.cpp


示例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();
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:21,代码来源:timebarframe.cpp


示例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();
}
开发者ID:Nau3D,项目名称:nau,代码行数:22,代码来源:glcanvas.cpp


示例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();
}
开发者ID:ennorehling,项目名称:alh,代码行数:39,代码来源:unitpane.cpp


示例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
}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:22,代码来源:canlua.cpp


示例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();
}
开发者ID:ralphbean,项目名称:grav,代码行数:38,代码来源:grav.cpp


示例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();
    }
开发者ID:slunski,项目名称:wxWidgets,代码行数:23,代码来源:test.cpp


示例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();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:23,代码来源:combo.cpp


示例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();
}
开发者ID:BBkBlade,项目名称:e,代码行数:36,代码来源:GotoFileDlg.cpp


示例13: OnIdle

void wxNewBitmapButton::OnIdle(wxIdleEvent& event)
{
    DoButtonUpdate();

    event.Skip();
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:6,代码来源:newbmpbtn.cpp


示例14: bmx_wxidleevent_morerequested

int bmx_wxidleevent_morerequested(wxIdleEvent & event) {
	return static_cast<int>(event.MoreRequested());
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:3,代码来源:glue.cpp


示例15: bmx_wxidleevent_requestmore

void bmx_wxidleevent_requestmore(wxIdleEvent & event, int needMore) {
	event.RequestMore(static_cast<bool>(needMore));
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:3,代码来源:glue.cpp


示例16: OnIdle

void wxTerminal::OnIdle(wxIdleEvent& event)
{
    event.Skip();
    DoFlushOutputBuffer();
}
开发者ID:kluete,项目名称:codelite,代码行数:5,代码来源:wxterminal.cpp


示例17: OnIdle

void panRender::OnIdle( wxIdleEvent& event )
{
	return; // DEBUG!!!
	if (b_nRealtimeWindows>0 && !mbRealtime) 
	{
		notRealtimeCnt++;
		if (notRealtimeCnt<300) { event.Skip(); return; }
		notRealtimeCnt=0;
	}

	// INPUT
	if (m_bActive)
	{
		float delta = g_pEngine->GetDeltaTime();
		P3DMOUSED md = g_pInput->GetMouseData();

		// ortho zoom
		m_fOrthoZoom += md.z * delta * 100000;
		if (m_fOrthoZoom<10) m_fOrthoZoom = 10;

		// axes
		switch(miViewType)
		{
		case 0: // right
			//m_vPos
			break;
		case 1: // top
			m_vPos.x -= md.x * delta * 1000;
			m_vPos.z -= md.y * delta * 1000;
			//g_pRenderer->SetProjectionOrtho(m_fOrthoZoom*fAspect, m_fOrthoZoom, 0, DEFAULT_FAR_PLANE);
			//g_pEngine->SetCamera(pntEye, P3DXPoint3D(0, -1, 0), P3DXPoint3D(0, 0, 1));
			break;
		case 2: // front
			//g_pRenderer->SetProjectionOrtho(m_fOrthoZoom*fAspect, m_fOrthoZoom, 0, DEFAULT_FAR_PLANE);
			//g_pEngine->SetCamera(pntEye, P3DXPoint3D(0, 0, 1), P3DXPoint3D(0, 1, 0));
			break;
		case 3: // perspect
			//g_pRenderer->SetProjection(DEFAULT_FIELD_OF_VIEW, fAspect,DEFAULT_NEAR_PLANE, DEFAULT_FAR_PLANE);
			break;
		}

		//char tmp[32];
		//sprintf(tmp, "%f", m_fOrthoZoom);
		//g_pFrmMain->AddConsoleMsg(tmp, tmp);
	}

	// SET PROJECTION AND CAMERA
	wxSize vpSize = this->panViewport->GetSize();
	float fAspect = (float)vpSize.x/(float)vpSize.y;
	P3DXPoint3D pntEye;
	pntEye.x = pntEye.y = pntEye.z = 0;

	switch(miViewType)
	{
	case 0: // right
		g_pRenderer->SetProjectionOrtho(m_fOrthoZoom*fAspect, m_fOrthoZoom, 0, DEFAULT_FAR_PLANE);
		g_pEngine->SetCamera(pntEye, P3DXPoint3D(-1, 0, 0), P3DXPoint3D(0, 1, 0));
		break;
	case 1: // top
		g_pRenderer->SetProjectionOrtho(m_fOrthoZoom*fAspect, m_fOrthoZoom, 0, DEFAULT_FAR_PLANE);
		g_pEngine->SetCamera(m_vPos, P3DXPoint3D(0, -1, 0), P3DXPoint3D(0, 0, 1));
		break;
	case 2: // front
		g_pRenderer->SetProjectionOrtho(m_fOrthoZoom*fAspect, m_fOrthoZoom, 0, DEFAULT_FAR_PLANE);
		g_pEngine->SetCamera(pntEye, P3DXPoint3D(0, 0, 1), P3DXPoint3D(0, 1, 0));
		break;
	case 3: // perspect
		g_pRenderer->SetProjection(DEFAULT_FIELD_OF_VIEW, fAspect,DEFAULT_NEAR_PLANE, DEFAULT_FAR_PLANE);
		break;
	}

	// RENDER SCENE
	eEngineState engState = g_pEngine->RenderScene(GetViewportHWND());
	if (m_bActive) g_pEngine->UpdateScene();
	// ---------------------

	if (mbRealtime) event.RequestMore(true);
}
开发者ID:k3a,项目名称:Panther3D-1,代码行数:78,代码来源:panRender.cpp


示例18: OnIdle

void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
{
    event.Skip();
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:4,代码来源:mdi.cpp


示例19: OnIdle

void MainFrame::OnIdle( wxIdleEvent & event )
{
    viewer_->frame();

    event.RequestMore();
}
开发者ID:yaroslav-tarasov,项目名称:backdropfx,代码行数:6,代码来源:wxpick.cpp


示例20: OnIdle

void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
    processInputQueue();
    Refresh();
    event.RequestMore();
}
开发者ID:george-viaud,项目名称:CubicSDR,代码行数:5,代码来源:WaterfallCanvas.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxImage类代码示例发布时间:2022-05-31
下一篇:
C++ wxIconBundle类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap