예제 #1
0
void moTimelineRuler::OnMouseEvent( wxMouseEvent & event ) {

    //wxMessageBox("moTimelineRuler::Mouse event");

    if ( event.Entering() ) {
        //SHINE!!!

    }
    if (event.Button(wxMOUSE_BTN_RIGHT )) {
        SetValue( SlideValue( event.GetX() ) );
        Refresh();
    }

    if (event.Button(wxMOUSE_BTN_LEFT )) {
        SetPlayValue( GetSlideValueToPlayValue( SlideValue( event.GetX() ) ) );
        moSetDuration( m_play_value );
        moAbstract::MODebug2->Push( IntToStr(m_play_value) );
        Refresh();
    }

    if (event.Dragging()) {
        if (event.RightIsDown()) {
            if (m_bStartDragging==false) {
                m_bStartDragging = true;
                wxWindow::CaptureMouse();
            }
            SetValue( SlideValue( event.GetX() ) );
            Refresh();
        }

        if (event.LeftIsDown()) {
            if (m_bStartDragging==false) {
                m_bStartDragging = true;
                wxWindow::CaptureMouse();
            }
            SetPlayValue( GetSlideValueToPlayValue( SlideValue( event.GetX() ) ) );
            moSetDuration( m_play_value );
            Refresh();
        }
    }

    if (!event.Dragging()) {
        if (m_bStartDragging==true) {
            m_bStartDragging = false;
            wxWindow::ReleaseMouse();
        }
    }

    event.Skip();
}
예제 #2
0
// -----------------------------------------------------------------------------
// Called when a mouse button is clicked within the control
// -----------------------------------------------------------------------------
void SCallTip::onMouseDown(wxMouseEvent& e)
{
	if (e.Button(wxMOUSE_BTN_LEFT))
	{
		if (btn_mouse_over_ == 1)
			nextArgSet();
		else if (btn_mouse_over_ == 2)
			prevArgSet();
	}
}
예제 #3
0
void GSPanel::OnMouseEvent( wxMouseEvent& evt )
{
	if( IsBeingDeleted() ) return;

	// Do nothing for left-button event
	if (!evt.Button(wxMOUSE_BTN_LEFT)) {
		evt.Skip();
		DoShowMouse();
	}

#if defined(__unix__)
	// HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes
	// the event before the pad see it. So you send key event directly to the pad.
	if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) {
		keyEvent event;
		// FIXME how to handle double click ???
		if (evt.ButtonDown()) {
			event.evt = 4; // X equivalent of ButtonPress
			event.key = evt.GetButton();
		} else if (evt.ButtonUp()) {
			event.evt = 5; // X equivalent of ButtonRelease
			event.key = evt.GetButton();
		} else if (evt.Moving() || evt.Dragging()) {
			event.evt = 6; // X equivalent of MotionNotify
			long x,y;
			evt.GetPosition(&x, &y);

			wxCoord w, h;
			wxWindowDC dc( this );
			dc.GetSize(&w, &h);

			// Special case to allow continuous mouvement near the border
			if (x < 10)
				x = 0;
			else if (x > (w-10))
				x = 0xFFFF;

			if (y < 10)
				y = 0;
			else if (y > (w-10))
				y = 0xFFFF;

			// For compatibility purpose with the existing structure. I decide to reduce
			// the position to 16 bits.
			event.key = ((y & 0xFFFF) << 16) | (x & 0xFFFF);

		} else {
			event.key = 0;
			event.evt = 0;
		}

		PADWriteEvent(event);
	}
#endif
}
예제 #4
0
void moLayerEffectCtrl::OnMouseEvent( wxMouseEvent& event ) {

    if ( event.Button(wxMOUSE_BTN_LEFT) || event.ButtonDown() ) {

        ///GetParent()->ProcessEvent(event);

        ///OpenMob( m_MobDescriptor );
    }
    event.Skip();

}
예제 #5
0
void moEffectLayerTimelineCtrl::OnMouseEvent( wxMouseEvent& event ) {

    if ( event.Button(wxMOUSE_BTN_LEFT) || event.ButtonDown() ) {

        GetParent()->ProcessEvent(event);

        OpenMob( m_MobDescriptor );

    }
    event.Skip();

}
예제 #6
0
	virtual void OnMouseKey(wxMouseEvent& event)
	{
		event.Skip();
#ifndef _MAC
		if(!HasCapture())
		{
			if(event.Button(wxMOUSE_BTN_LEFT) && event.ButtonDown())
			{
				wxImage image_blank(1, 1);
				image_blank.SetMask();
				image_blank.SetMaskColour(0, 0, 0);
				SetCursor(image_blank);
				mouse_pos = event.GetPosition();
				CaptureMouse();
				wxCommandEvent ev(evtMouseCapture, evID_MOUSE_CAPTURED);
				wxPostEvent(this, ev);
			}
		}
		else
			Handler()->OnMouse(MA_BUTTON, event.Button(wxMOUSE_BTN_LEFT) ? 0 : 1, event.ButtonDown());
#endif//_MAC
	}
예제 #7
0
PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint& globalPoint)
    : m_position(event.GetPosition())
    , m_globalPosition(globalPoint)
    , m_shiftKey(event.ShiftDown())
    , m_ctrlKey(event.CmdDown())
    , m_altKey(event.AltDown())
    , m_metaKey(event.MetaDown()) // FIXME: We'll have to test other browsers
{
    wxEventType type = event.GetEventType();
    m_eventType = MouseEventMoved;
    
    if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type == wxEVT_RIGHT_DOWN)
        m_eventType = MouseEventPressed;
    
    else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_UP || 
                type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK || type == wxEVT_RIGHT_DCLICK)
        m_eventType = MouseEventReleased;

    else if (type == wxEVT_MOTION)
        m_eventType = MouseEventMoved;

    if (event.Button(wxMOUSE_BTN_LEFT))
        m_button = LeftButton;
    else if (event.Button(wxMOUSE_BTN_RIGHT))
        m_button = RightButton;
    else if (event.Button(wxMOUSE_BTN_MIDDLE))
        m_button = MiddleButton;
    else if (!m_eventType == MouseEventMoved)
        ASSERT_NOT_REACHED();


    if (m_eventType == MouseEventMoved)
        m_clickCount = 0;
    else
        m_clickCount = event.ButtonDClick() ? 2 : 1;

    m_timestamp = WebCore::currentTime();
}
예제 #8
0
bool wxStdButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
                                          const wxMouseEvent& event)
{
    // the button has 2 states: pressed and normal with the following
    // transitions between them:
    //
    //      normal -> left down -> capture mouse and go to pressed state
    //      pressed -> left up inside -> generate click -> go to normal
    //                         outside ------------------>
    //
    // the other mouse buttons are ignored
    if ( event.Button(1) )
    {
        if ( event.LeftDown() || event.LeftDClick() )
        {
            m_winCapture = consumer->GetInputWindow();
            m_winCapture->CaptureMouse();
            m_winHasMouse = true;

            consumer->PerformAction(wxACTION_BUTTON_PRESS);

            return true;
        }
        else if ( event.LeftUp() )
        {
            if ( m_winCapture )
            {
                m_winCapture->ReleaseMouse();
                m_winCapture = NULL;
            }

            if ( m_winHasMouse )
            {
                // this will generate a click event
                consumer->PerformAction(wxACTION_BUTTON_TOGGLE);

                return true;
            }
            //else: the mouse was released outside the window, this doesn't
            //      count as a click
        }
        //else: don't do anything special about the double click
    }

    return wxStdInputHandler::HandleMouse(consumer, event);
}
예제 #9
0
void ActorSceneCanvas::OnMiddleUp(wxMouseEvent& e)
{
    if (!GetSceneManipulator())
        return;

    if (!HasCapture())
        return;

    if (mDragButton == wxMOUSE_BTN_NONE || !e.Button(mDragButton))
        return;

    wxASSERT(m_pCameraManip);

    m_pCameraManip->onEnd(e.GetX(), e.GetY(), false);
    m_pCameraManip = NULL;

    mDragButton = wxMOUSE_BTN_NONE;
    ReleaseCapture();

}
예제 #10
0
void ActorSceneCanvas::OnLeftUp(wxMouseEvent& e)
{
    if (!GetSceneManipulator())
        return;
	mDragStarted = false;
	mDragOrigin  =Ogre::Vector2(e.GetX(), e.GetY()) ;

	Ogre::Ray ray = GetSceneManipulator()->getWindowToViewportRay(e.GetX(),e.GetY());
	bool bAxis = false;
	std::pair<bool, Ogre::Real> result = Fairy::rayCollide(ray, ( Ogre::MovableObject*) Fairy::CDataManipulator::mAxis_x, true);
	if (result.first)
	{
		_resetAxisMaterial();

		mXax = !mXax;
		mYax = mZax = false;

		if (mXax)
		{
			GetDataManipulator()->m_pMaterialX->setSelfIllumination(1.0,1.0,0);
		}

		bAxis = true;
	}
	if (!bAxis)
	{
		result = Fairy::rayCollide(ray, ( Ogre::MovableObject*) Fairy::CDataManipulator::mAxis_y, true);
		if (result.first)
		{
			_resetAxisMaterial();

			mYax = !mYax;
			mXax = mZax = false;			

			if (mYax)
			{
				GetDataManipulator()->m_pMaterialY->setSelfIllumination(1.0,1.0,0);
			}

			bAxis = true;
		}
	}
	if (!bAxis)
	{
		result = Fairy::rayCollide(ray, ( Ogre::MovableObject*) Fairy::CDataManipulator::mAxis_z, true);
		if (result.first)
		{
			_resetAxisMaterial();

			mZax = !mZax;
			mXax = mYax = false;

			if (mZax)
			{
				GetDataManipulator()->m_pMaterialZ->setSelfIllumination(1.0,1.0,0);
			}

			bAxis = true;
		}	
	}

    if (!HasCapture())
        return;

    if (mDragButton == wxMOUSE_BTN_NONE || !e.Button(mDragButton))
        return;

    wxASSERT(GetActiveAction());

    GetActiveAction()->onEnd(e.GetX(), e.GetY(), false);

    m_pUpdateListener->disable();
    mDragButton = wxMOUSE_BTN_NONE;
    ReleaseCapture();


}
예제 #11
0
void DataListCtrl::OnMouse(wxMouseEvent &event)
{
   if (event.Button(wxMOUSE_BTN_ANY))
      m_rename_text->Hide();
   event.Skip();
}
예제 #12
0
void wxMoTimelineBandCtrl::OnMouseEvent( wxMouseEvent & event ) {

    //wxMessageBox("wxMoTimelineBandCtrl::Mouse event");

    if ( event.Entering() ) {
        //SHINE!!!

    }

    if (event.LeftDown() && !m_bLeftSizeDragging) {
        m_bLeftSizeDragging = (-1<=event.GetX() && event.GetX()<=3);
        Refresh();
    }
    if (event.LeftUp() && m_bLeftSizeDragging) {
        m_bLeftSizeDragging = false;
        Refresh();
    }

    if (event.LeftDown() && !m_bRightSizeDragging) {
        m_bRightSizeDragging = ( (GetSize().GetX()-5)<event.GetX() && event.GetX()<=(GetSize().GetX()+2) );
        Refresh();
    }
    if (event.LeftUp() && m_bRightSizeDragging) {
        m_bRightSizeDragging = false;
        Refresh();
    }


    if (event.LeftDown() && !m_bMovingDragging) {
        m_bMovingDragging = ( 3<event.GetX() && event.GetX()<=(GetSize().GetX()-3) );
        Px = event.GetX();
        Refresh();
    }
    if (event.LeftUp() && m_bMovingDragging) {
        m_bMovingDragging = false;
        Refresh();
    }


    if ((0<event.GetX() && event.GetX()<=3) ||
    ( (GetSize().GetX()-3)<event.GetX() && event.GetX()<=(GetSize().GetX()+2) )) {
        //
        //m_bRightSizeDragging = false;
        //m_bLeftSizeDragging = true;
        this->SetCursor( wxCursor(wxCURSOR_SIZEWE) );
    } else this->SetCursor( wxCursor() );
    /* else if ( (GetSize().GetX()-3)<event.GetX() && event.GetX()<=GetSize().GetX() ) {
            m_bRightSizeDragging = true;
            m_bLeftSizeDragging = false;
    } else {
        m_bRightSizeDragging = false;
        m_bLeftSizeDragging = false;
    }*/

    /*if ( m_bLeftSizeDragging || m_bRightSizeDragging ) {
        this->SetCursor( wxCursor(wxCURSOR_SIZEWE) );
    } else this->SetCursor( wxCursor() );
*/
    if (event.Button(wxMOUSE_BTN_RIGHT )) {
        SetValue( SlideValue( event.GetX() ) );
        Refresh();
    }

    if (event.Button(wxMOUSE_BTN_LEFT )) {
        SetPlayValue( GetSlideValueToPlayValue( SlideValue( event.GetX() ) ) );
        //moSetDuration( m_play_value );
        //moAbstract::MODebug2->Push( IntToStr(m_play_value) );
        Refresh();
    }

    if (event.Dragging()) {
        if (event.RightIsDown()) {
            if (m_bStartDragging==false) {
                m_bStartDragging = true;
                wxWindow::CaptureMouse();
            }
            SetValue( SlideValue( event.GetX() ) );
            Refresh();
        }

        if (event.LeftIsDown()) {
            if (m_bStartDragging==false) {
                m_bStartDragging = true;
                //m_bRightSizeDragging = ( (GetSize().GetX()-3)<event.GetX() && event.GetX()<=GetSize().GetX() );
                wxWindow::CaptureMouse();
            }
            wxPoint PW = GetPosition();
            wxSize  SW = GetSize();

            if ( (SW.GetX()-event.GetX())>0 && m_bLeftSizeDragging) {
                SetSize( PW.x+event.GetX(), PW.y, SW.GetX()-event.GetX(), SW.GetY() );
            }
            if ( event.GetX()>0 && m_bRightSizeDragging) {
                SetSize( PW.x, PW.y, event.GetX(), SW.GetY() );
            }
            if ( m_bMovingDragging) {
                SetSize( GetParent()->ScreenToClient(wxGetMousePosition()).x-Px, PW.y, SW.GetX(), SW.GetY() );
            }

            //SetPlayValue( GetSlideValueToPlayValue( SlideValue( event.GetX() ) ) );
            //moSetDuration( m_play_value );
            Refresh();
        }
    }

    if (!event.Dragging()) {
        if (m_bStartDragging==true) {
            m_bStartDragging = false;
            wxWindow::ReleaseMouse();
        }
    }

    event.Skip();
}
예제 #13
0
파일: glue.cpp 프로젝트: maxmods/wx.mod
int bmx_wxmouseevent_button(wxMouseEvent & event, int but) {
	return static_cast<int>(event.Button(but));
}