当前位置: 首页>>代码示例>>C++>>正文


C++ wxEvent::IsKindOf方法代码示例

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


在下文中一共展示了wxEvent::IsKindOf方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: if

void Interactor3DMeasure::UpdateCursor( wxEvent& event, wxWindow* wnd )
{
  if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) )
  {
    wxMouseEvent* e = ( wxMouseEvent* )&event;
    if ( !e->RightDown() && !e->MiddleDown() )
    {
      if ( e->CmdDown() && !e->ShiftDown() )
      {
        wnd->SetCursor( CursorFactory::CursorContour );
        return;
      }
      else if ( e->CmdDown() && e->ShiftDown() )
      {
        wnd->SetCursor( CursorFactory::CursorAdd );
        return;
      }
      else if ( !e->CmdDown() && e->ShiftDown() )
      {
        wnd->SetCursor( CursorFactory::CursorRemove );
        return;
      }
    }
  }
  else if ( event.IsKindOf( CLASSINFO( wxKeyEvent ) ) )
  {
    wxKeyEvent* e = ( wxKeyEvent* )&event;
    if ( e->GetEventType() != wxEVT_KEY_UP )
    {
      if ( e->GetKeyCode() == WXK_CONTROL && !e->ShiftDown() )
      {
        wnd->SetCursor( CursorFactory::CursorContour );
        return;
      }
      else if ( ( e->GetKeyCode() == WXK_CONTROL && e->ShiftDown() ) ||
                  ( e->GetKeyCode() == WXK_SHIFT && e->CmdDown() ) )
      {
        wnd->SetCursor( CursorFactory::CursorAdd );
        return;
      }
      else if ( e->GetKeyCode() == WXK_SHIFT && !e->CmdDown() )
      {
        wnd->SetCursor( CursorFactory::CursorRemove );
        return;
      }
    }
  }
  
  Interactor3D::UpdateCursor( event, wnd );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:50,代码来源:Interactor3DMeasure.cpp

示例4: ProcessEvent

// Extend event processing to search the view's event table
bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event)
{
    static wxEvent *ActiveEvent = NULL;

    // Break recursion loops
    if (ActiveEvent == &event)
        return false;

    ActiveEvent = &event;

    bool ret;
    if ( !m_childView || ! m_childView->ProcessEvent(event) )
    {
        // Only hand up to the parent if it's a menu command
        if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
            ret = wxEvtHandler::ProcessEvent(event);
        else
            ret = true;
    }
    else
        ret = true;

    ActiveEvent = NULL;
    return ret;
}
开发者ID:Blackbird88,项目名称:pcsx2,代码行数:26,代码来源:docmdi.cpp

示例5: if

void Interactor2DMeasure::UpdateCursor( wxEvent& event, wxWindow* wnd )
{
  RenderView2D* view = ( RenderView2D* )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;
      }
      else if ( ( !m_bEditing && !m_bDrawing && view->GetRegion( e->GetX(), e->GetY() ) ) ||
                ( m_bEditing && m_nPointIndex < 0 ) )
      {
        wnd->SetCursor( CursorFactory::CursorGrab );
      }
      else
      {
        if ( m_nAction == MM_Line ) 
          wnd->SetCursor( CursorFactory::CursorMeasureLine );
        else if ( m_nAction == MM_Rectangle )
          wnd->SetCursor( CursorFactory::CursorMeasureRectangle );
        else if ( m_nAction == MM_Polyline || m_nAction == MM_Spline )
          wnd->SetCursor( CursorFactory::CursorMeasurePolyline );
      }
    }   
  }
  else
    Interactor2D::UpdateCursor( event, wnd );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:33,代码来源:Interactor2DMeasure.cpp

示例6: 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

示例7: ProcessEvent

// Redirect events to active child first
bool wxMDIParentFrame::ProcessEvent(wxEvent& event)
{
    // Stops the same event being processed repeatedly
    static wxEventType inEvent = wxEVT_NULL;
    if (inEvent == event.GetEventType())
        return false;

    inEvent = event.GetEventType();

    bool res = false;
    if (m_activeChild && event.IsKindOf(CLASSINFO(wxCommandEvent)))
    {
        res = m_activeChild->GetEventHandler()->ProcessEvent(event);
    }

    if (!res)
        res = GetEventHandler()->wxEvtHandler::ProcessEvent(event);

    inEvent = wxEVT_NULL;

    return res;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:23,代码来源:mdi.cpp

示例8: ProcessEvent

// Forward command events to the current rich text control, if any
bool IceNoteFrame::ProcessEvent(wxEvent& event)
{
    if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
    {
        // Problem: we can get infinite recursion because the events
        // climb back up to this frame, and repeat.
        // Assume that command events don't cause another command event
        // to be called, so we can rely on inCommand not being overwritten

        static int s_eventType = 0;
        static wxWindowID s_id = 0;

        if (s_id != event.GetId() && s_eventType != event.GetEventType())
        {
            s_eventType = event.GetEventType();
            s_id = event.GetId();

            wxWindow* focusWin = wxFindFocusDescendant(this);
            if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
            {
                //s_command = NULL;
                s_eventType = 0;
                s_id = 0;
                return true;
            }

            s_eventType = 0;
            s_id = 0;
        }
        else
        {
            return false;
        }
    }

    return wxFrame::ProcessEvent(event);
}
开发者ID:sunicy,项目名称:IceNote,代码行数:38,代码来源:IceNoteMain.cpp


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