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

C++ wxEvent类代码示例

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

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



在下文中一共展示了wxEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: if

void Interactor2DRegionEdit::UpdateCursor( wxEvent& event, wxWindow* wnd )
{
  if ( wnd->FindFocus() == wnd )
  {
    if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) )
         && ( event.GetEventType() == wxEVT_MIDDLE_DOWN || event.GetEventType() == wxEVT_RIGHT_DOWN )
         && !m_bEditing )
    {
      Interactor2D::UpdateCursor( event, wnd );
      return;
    }

    if ( m_nAction == EM_Freehand || m_nAction == EM_Polyline )
    {
      if ( event.IsKindOf( CLASSINFO( wxKeyEvent ) ) && (( wxKeyEvent* )&event)->GetKeyCode() == WXK_CONTROL &&
           (( wxKeyEvent* )&event)->GetEventType() != wxEVT_KEY_UP )
      {
        wnd->SetCursor( CursorFactory::CursorFill );
      }
      else if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) && (( wxMouseEvent* )&event)->CmdDown() )
      {
        wnd->SetCursor( CursorFactory::CursorFill );
      }
      else
        wnd->SetCursor( m_nAction == EM_Freehand ? CursorFactory::CursorPencil : CursorFactory::CursorPolyline );
    }
    else if ( m_nAction == EM_Fill )
      wnd->SetCursor( CursorFactory::CursorFill );
    else
      Interactor2D::UpdateCursor( event, wnd );
  }
  else
    Interactor2D::UpdateCursor( event, wnd );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:34,代码来源:Interactor2DRegionEdit.cpp


示例2: ProcessEvent

bool wxPropertyGridManager::ProcessEvent( wxEvent& event )
{
    int evtType = event.GetEventType();

    // NB: For some reason, under wxPython, Connect in Init doesn't work properly,
    //     so we'll need to call OnPropertyGridSelect manually. Multiple call's
    //     don't really matter.
    if ( evtType == wxEVT_PG_SELECTED )
        OnPropertyGridSelect((wxPropertyGridEvent&)event);

    // Property grid events get special attention
    if ( evtType >= wxPG_BASE_EVT_TYPE &&
         evtType < (wxPG_MAX_EVT_TYPE) &&
         m_selPage >= 0 )
    {
        wxPropertyGridPage* page = GetPage(m_selPage);
        wxPropertyGridEvent* pgEvent = wxDynamicCast(&event, wxPropertyGridEvent);

        // Add property grid events to appropriate custom pages
        // but stop propagating to parent if page says it is
        // handling everything.
        if ( pgEvent && !page->m_isDefault )
        {
            /*if ( pgEvent->IsPending() )
                page->AddPendingEvent(event);
            else*/
                page->ProcessEvent(event);

            if ( page->IsHandlingAllEvents() )
                event.StopPropagation();
        }
    }

    return wxPanel::ProcessEvent(event);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:35,代码来源:manager.cpp


示例3: ProcessEvent

bool AudioView::ProcessEvent(wxEvent& event)
{
  if (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED &&
      event.GetId() >= FirstEffectID &&
      event.GetId() < FirstEffectID + numEffects) {
    Effect *f = Effect::GetEffect(event.GetId() - FirstEffectID);

    TrackList *tracks = GetTracks();
    VTrack *t = tracks->First();
    
    while(t) {
      if (t->selected && t->GetKind() == (VTrack::Wave)) {
	f->DoInPlaceEffect((WaveTrack *)t, sel0, sel1);
      }
      
      t = tracks->Next();
    }
    
    PushState();
    
    FixScrollbars();
    REDRAW(trackPanel);
    REDRAW(rulerPanel);
    
    // This indicates we handled the event.
    return true;
  }
  
  return wxView::ProcessEvent(event);
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:30,代码来源:AudioView.cpp


示例4: ProcessEvent

bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event)
{
    if (event.GetEventType() == wxEVT_LEFT_DOWN)
    {
        m_contextHelp->SetStatus(true);
        m_contextHelp->EndContextHelp();
        return true;
    }

    if ((event.GetEventType() == wxEVT_CHAR) ||
        (event.GetEventType() == wxEVT_KEY_DOWN) ||
        (event.GetEventType() == wxEVT_ACTIVATE) ||
        (event.GetEventType() == wxEVT_MOUSE_CAPTURE_CHANGED))
    {
        // May have already been set to true by a left-click
        //m_contextHelp->SetStatus(false);
        m_contextHelp->EndContextHelp();
        return true;
    }

    if ((event.GetEventType() == wxEVT_PAINT) ||
        (event.GetEventType() == wxEVT_ERASE_BACKGROUND))
    {
        event.Skip();
        return false;
    }

    return true;
}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:29,代码来源:cshelp.cpp


示例5: OnClangSyncTaskFinished

void ClangPlugin::OnClangSyncTaskFinished( wxEvent& event )
{
#ifdef CLANGPLUGIN_TRACE_FUNCTIONS
    //fprintf(stdout,"%s\n", __PRETTY_FUNCTION__);
#endif
    ClangProxy::SyncJob* pJob = static_cast<ClangProxy::SyncJob*>(event.GetEventObject());

    if (event.GetId() == idClangCodeCompleteTask)
    {
        ClangProxy::CodeCompleteAtJob* pCCJob = dynamic_cast<ClangProxy::CodeCompleteAtJob*>(pJob);
        ClangEvent evt( clEVT_GETCODECOMPLETE_FINISHED, pCCJob->GetTranslationUnitId(), pCCJob->GetFilename(), pCCJob->GetLocation(), pCCJob->GetResults());
        ProcessEvent(evt);
        if ( HasEventSink(clEVT_DIAGNOSTICS_UPDATED) )
        {
            ClangEvent evt( clEVT_DIAGNOSTICS_UPDATED, pCCJob->GetTranslationUnitId(), pCCJob->GetFilename(), pCCJob->GetLocation(), pCCJob->GetDiagnostics());
            ProcessEvent(evt);
        }
    }
    else if (event.GetId() == idClangGetOccurrencesTask)
    {
        ClangProxy::GetOccurrencesOfJob* pOCJob = dynamic_cast<ClangProxy::GetOccurrencesOfJob*>(pJob);
        ClangEvent evt( clEVT_GETOCCURRENCES_FINISHED, pOCJob->GetTranslationUnitId(), pOCJob->GetFilename(), pOCJob->GetLocation(), pOCJob->GetResults());
        ProcessEvent(evt);
    }
    else if (event.GetId() == idClangGetCCDocumentationTask)
    {
        ClangProxy::DocumentCCTokenJob* pCCDocJob = dynamic_cast<ClangProxy::DocumentCCTokenJob*>(pJob);
        ClangEvent evt( clEVT_GETOCCURRENCES_FINISHED, pCCDocJob->GetTranslationUnitId(), pCCDocJob->GetFilename(), pCCDocJob->GetLocation(), pCCDocJob->GetResult());
        ProcessEvent(evt);
    }

    pJob->Finalize();
}
开发者ID:progmboy,项目名称:ClangLib,代码行数:33,代码来源:clangplugin.cpp


示例6: ProcessEvent

bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event)
{
    // stops the same event being processed repeatedly
    if (m_pLastEvt == &event)
        return false;
    m_pLastEvt = &event;

    // let the active child (if any) process the event first.
    bool res = false;
    if (m_pActiveChild &&
            event.IsCommandEvent() &&
            event.GetEventObject() != m_pClientWindow &&
            !(event.GetEventType() == wxEVT_ACTIVATE ||
              event.GetEventType() == wxEVT_SET_FOCUS ||
              event.GetEventType() == wxEVT_KILL_FOCUS ||
              event.GetEventType() == wxEVT_CHILD_FOCUS ||
              event.GetEventType() == wxEVT_COMMAND_SET_FOCUS ||
              event.GetEventType() == wxEVT_COMMAND_KILL_FOCUS )
       )
    {
        res = m_pActiveChild->GetEventHandler()->ProcessEvent(event);
    }

    if (!res)
    {
        // if the event was not handled this frame will handle it,
        // which is why we need the protection code at the beginning
        // of this method
        res = wxEvtHandler::ProcessEvent(event);
    }

    m_pLastEvt = NULL;

    return res;
}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:35,代码来源:tabmdi.cpp


示例7: PlatformGetEventTimestamp

wxLongLong EventDispatcher::PlatformGetEventTimestamp(const wxEvent &event) {
    // XXX - We need to cast to a DWORD first, because the Win32 API (and
    // wxWidgets) treat the return value of GetMessageTime as a 'LONG'
    // instead of a 'DWORD'.
    ASSERT(event.GetTimestamp() == ::GetMessageTime());
    return (wxLongLong) ((DWORD) event.GetTimestamp());
}
开发者ID:emk,项目名称:halyard,代码行数:7,代码来源:EventDispatcher.cpp


示例8: OnEvent

void wxTestableFrame::OnEvent(wxEvent& evt)
{
    m_count[evt.GetEventType()]++;

    if(! evt.IsCommandEvent() )
        evt.Skip();
}
开发者ID:beanhome,项目名称:dev,代码行数:7,代码来源:testableframe.cpp


示例9: OnTestEvent

 void OnTestEvent(wxEvent& evt)
 {
     if ( evt.GetEventObject() == gs_psrc1 )
         gs_value += 1;
     else if ( evt.GetEventObject() == gs_psrc2 )
         gs_value += 0x10000;
 }
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:7,代码来源:evtconnection.cpp


示例10: OnEvent

	virtual bool OnEvent(wxPropertyGrid* propGrid,
		wxPGProperty* prop,
		wxWindow* ctrl,
		wxEvent& evt) const override
	{
		if (evt.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
		{
			wxPGMultiButton* buttons = (wxPGMultiButton*)propGrid->GetEditorControlSecondary();

			if (evt.GetId() == buttons->GetButtonId(0))
			{
				auto bprop = dynamic_cast<BtnProperty*>(prop);
				if (bprop && bprop->mFunc)
				{
					OnBtnFunc& f = bprop->mFunc;
					return f(prop);
				}
				return false;

				//auto it = mBtnPropMap.find(prop);
				//if (mBtnPropMap.end() != it)
				//	return (it->second) ? it->second(prop) : false;


			}//if (evt.GetId() == buttons->GetButtonId(0))
		}//if (evt.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED)
		return false;
		// всё что не выбрано кнопкой "..." не принимаем return wxPGTextCtrlEditor::OnEvent(propGrid, property, ctrl, event);	
	}
开发者ID:alex3696,项目名称:wh3,代码行数:29,代码来源:BtnProperty.cpp


示例11: wxCHECK_RET

void wxLuaEventCallback::OnAllEvents(wxEvent& event)
{
    wxEventType evtType = event.GetEventType();

    // Get the wxLuaEventCallback instance to use which is NOT "this" since
    // "this" is a central event handler function. i.e. this != theCallback
    wxLuaEventCallback *theCallback = (wxLuaEventCallback *)event.m_callbackUserData;
    wxCHECK_RET(theCallback != NULL, wxT("Invalid wxLuaEventCallback in wxEvent user data"));

    if (theCallback != NULL)
    {
        // Not an error if !Ok(), the wxLuaState is cleared during shutdown or after a destroy event.
        wxLuaState wxlState(theCallback->GetwxLuaState());
        if (wxlState.Ok())
        {
            wxlState.SetInEventType(evtType);
            theCallback->OnEvent(&event);
            wxlState.SetInEventType(wxEVT_NULL);
        }
    }

    // we want the wxLuaWinDestroyCallback to get this too
    if (evtType == wxEVT_DESTROY)
        event.Skip(true);
}
开发者ID:brkpt,项目名称:luaplus51-all,代码行数:25,代码来源:wxlcallb.cpp


示例12:

void					SeqTrack::PropagateEvent(wxEvent &event)
{
  // set events propagationlevel to run down through the parents
  event.ResumePropagation(wxEVENT_PROPAGATE_MAX);

  // continue the event
  event.Skip();
}
开发者ID:eriser,项目名称:wired,代码行数:8,代码来源:SeqTrack.cpp


示例13: DoProcessEvent

bool DoProcessEvent(wxEvent& event)
{
    if ( event.GetEventType() == TEST_EVT ||
            event.GetEventType() == wxEVT_MENU )
        g_str += 'A';

    return false;
}
开发者ID:ben007fr,项目名称:wxWidgets,代码行数:8,代码来源:propagation.cpp


示例14: DoFilterEvent

int DoFilterEvent(wxEvent& event)
{
    if ( event.GetEventType() == TEST_EVT ||
            event.GetEventType() == wxEVT_MENU )
        g_str += 'a';

    return -1;
}
开发者ID:ben007fr,项目名称:wxWidgets,代码行数:8,代码来源:propagation.cpp


示例15: if

void Interactor2DVolumeEdit::UpdateCursor( wxEvent& event, wxWindow* wnd )
{
  if ( wnd->FindFocus() == wnd )
  {
    if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) )
    {
      wxMouseEvent* e = ( wxMouseEvent* )&event;
      if ( ( ( e->MiddleDown() || e->RightDown() ) && !m_bEditing ) ||
           ( e->CmdDown() && e->ShiftDown() ) )
      {
        Interactor2D::UpdateCursor( event, wnd );
        return;
      }
    }

    if ( m_nAction != EM_Fill )
    {
      if ( event.IsKindOf( CLASSINFO( wxKeyEvent ) ) )
      {
        wxKeyEvent* e = ( wxKeyEvent* )&event;
        if ( e->GetEventType() != wxEVT_KEY_UP && ( e->GetKeyCode() == WXK_CONTROL && !e->ShiftDown() && !e->AltDown() ) )
        {
          wnd->SetCursor( CursorFactory::CursorFill );
          return;
        }
      }

      if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) && (( wxMouseEvent* )&event)->CmdDown()
           && !(( wxMouseEvent* )&event)->ShiftDown() && !(( wxMouseEvent* )&event)->AltDown() )
      {
        wnd->SetCursor( CursorFactory::CursorFill );
      }
      else if ( m_nAction == EM_ColorPicker )
        wnd->SetCursor( CursorFactory::CursorColorPicker );
      else if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) )
      {
        switch ( m_nAction )
        {
          case EM_Freehand:
            wnd->SetCursor( CursorFactory::CursorPencil );
            break;
          case EM_Polyline:
            wnd->SetCursor( CursorFactory::CursorPolyline );
            break;
          case EM_Contour:
            wnd->SetCursor( CursorFactory::CursorContour );
            break;
        }
      }
    }
    else 
      wnd->SetCursor( CursorFactory::CursorFill );
  }
  else
    Interactor2D::UpdateCursor( event, wnd );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:56,代码来源:Interactor2DVolumeEdit.cpp


示例16: FilterEvent

int InputEventFilter::FilterEvent(wxEvent& event)
{
  if (m_block && ShouldCatchEventType(event.GetEventType()))
  {
    event.StopPropagation();
    return Event_Processed;
  }

  return Event_Skip;
}
开发者ID:E2xD,项目名称:dolphin,代码行数:10,代码来源:InputConfigDiag.cpp


示例17: ShouldSendEventToDummy

bool wxRibbonPanel::ShouldSendEventToDummy(wxEvent& evt)
{
    // For an expanded panel, filter events between being sent up to the
    // floating top level window or to the dummy panel sitting in the ribbon
    // bar.

    // Child focus events should not be redirected, as the child would not be a
    // child of the window the event is redirected to. All other command events
    // seem to be suitable for redirecting.
    return evt.IsCommandEvent() && evt.GetEventType() != wxEVT_CHILD_FOCUS;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:11,代码来源:panel.cpp


示例18: FilterEvent

// This is always the first to handle an event !
int MyApp::FilterEvent(wxEvent& event)
{
    if ( event.GetEventType() == wxEVT_BUTTON &&
            event.GetId() == MyEvtTestButton::BUTTON_ID )
    {
        wxLogMessage("Step 0 in \"How Events are Processed\":\n"
                     "App::FilterEvent");
    }

    return wxApp::FilterEvent(event);
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:12,代码来源:event.cpp


示例19: if

int AButton::Listener::FilterEvent(wxEvent &event)
{
   if (event.GetEventType() == wxEVT_KEY_DOWN ||
       event.GetEventType() == wxEVT_KEY_UP)
      OnEvent();
   else if (event.GetEventType() == wxEVT_SET_FOCUS)
      // A modal dialog might have eaten the modifier key-up with its own
      // filter before we saw it; this is adequate to fix the button image
      // when the dialog disappears.
      OnEvent();
   return Event_Skip;
}
开发者ID:RaphaelMarinier,项目名称:audacity,代码行数:12,代码来源:AButton.cpp


示例20: ProcessEvent

// Extend event processing to call OnCommand
bool wxPropertyFormView::ProcessEvent(wxEvent& event)
{
    if (wxEvtHandler::ProcessEvent(event))
        return true;
    else if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxUpdateUIEvent)) && event.GetEventObject())
    {
        OnCommand(* ((wxWindow*) event.GetEventObject()), (wxCommandEvent&) event);
        return true;
    }
    else
        return false;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:13,代码来源:propform.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ wxFFile类代码示例发布时间:2022-05-31
下一篇:
C++ wxEraseEvent类代码示例发布时间: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