Exemplo n.º 1
0
void ATOM_CurveEditor::onLButtonDown (ATOM_WidgetLButtonDownEvent *event)
{
	_selectedControlPoint = controlPointHitTest (event->x, event->y);

	if (_selectedControlPoint < 0)
	{
		long timeInMs = coordToTimeInSecond (event->x) * 1000;
		float value = coordToKeyValue (event->y);
		_selectedControlPoint = _animationCurve.insertKey (timeInMs, value);
	}

	if (_selectedControlPoint > 0)
	{
		_minTimeValue = _animationCurve[_selectedControlPoint-1].x;
	}
	else
	{
		_minTimeValue = _minTimeRange;;
	}

	if (_selectedControlPoint < _animationCurve.getNumKeys() - 1)
	{
		_maxTimeValue = _animationCurve[_selectedControlPoint+1].x;
	}
	else
	{
		_maxTimeValue = _maxTimeRange;
	}

	_dragTarget = DRAG_POINT;

	setCapture ();
}
Exemplo n.º 2
0
LRESULT Dispatcher::onLButtonDown( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
	Point pt(lParam);
	Widget* pWid = NULL;
	LRESULT lResult = 0;
	WFX_CONDITION(m_hWnd != NULL);
	::SetFocus(m_hWnd);
	pWid = getWidPt(pt);
	if (pWid != NULL)
	{
		if (pWid->getHwid() != m_h2oFocused.first
			&& pWid != m_h2oFocused.second)
		{
			if (m_h2oFocused.second != NULL)
			{
				m_h2oFocused.second->sendMessage(WM_KILLFOCUS, (WPARAM)pWid->getHwid());
			}
		}
		pWid->sendMessage(WM_SETFOCUS, (WPARAM)m_h2oFocused.first);
		setCapture(pWid);
		setFocus(pWid);
		setLButtonDown(pWid);
		lResult = pWid->sendMessage(uMsg, wParam, lParam);
	}
	else
	{
		if (m_h2oFocused.second != NULL)
		{
			m_h2oFocused.second->sendMessage(WM_KILLFOCUS, INVALID_HWID);
		}
	}
	return lResult;
}
Exemplo n.º 3
0
int main()
{
    unsigned int userInputLength = 0;
    int readflags = O_RDWR | O_NONBLOCK | O_NOCTTY;
    int readFile = 0;
    char userInput [64];

    setCapture(0,1);
    setADCParams(adcOffsetLeft, adcOffsetRight, adcGainLeft, adcGainRight);
    
    // Do this one again, because it doesn't seem to reliably go through.
    setADCParams(adcOffsetLeft, adcOffsetRight, adcGainLeft, adcGainRight);
    printHelp();
    
    
    while(1)
    {
        // Check if any user input from terminal...
        readFile = open("/dev/jtag_uart", readflags);
        userInputLength = read(readFile,userInput,64);
        readFile = close(readFile);

        if(userInputLength > 0 && userInput[userInputLength-1] == '\n')
        {
                userInput[userInputLength-1] = 0;
                //userInput[userInputLength-2] = 0;
                processCommand(userInput, userInputLength);
            userInputLength = 0;
            userInput[0] = 0;
            
        }
    }// end while(1)

}
Exemplo n.º 4
0
void CIrrWindow::_OnRButtonDown	( uiMouseEvent mouseEvent, int x, int y )
{
	setCapture();

	SEvent irrEvent;
	memset(&irrEvent, 0, sizeof(SEvent));

	irrEvent.EventType			= irr::EET_MOUSE_INPUT_EVENT;
	irrEvent.MouseInput.Event	= irr::EMIE_RMOUSE_PRESSED_DOWN;
	irrEvent.MouseInput.X		= (short)x;
	irrEvent.MouseInput.Y		= (short)y;
	irrEvent.MouseInput.Shift	= mouseEvent.isShiftKeyDown();
	irrEvent.MouseInput.Control = mouseEvent.isCtrlKeyDown();
	irrEvent.MouseInput.Alt		= mouseEvent.isAltKeyDown();
	irrEvent.MouseInput.ButtonStates |= irr::EMBSM_LEFT;

	// post event
	m_device->postEventFromUser(irrEvent);

	// controller event
	// CControllerManager::getInstance()->getCurrentController()->onRMouseDown( x, y );

	//  set focus
	uiApplication::getRoot()->setFocus();
}
Exemplo n.º 5
0
void ATOM_Button::onRButtonDown (ATOM_WidgetRButtonDownEvent * /* event */)
{
	ATOM_STACK_TRACE(ATOM_Button::onRButtonDown);

	setBorderMode (ATOM_Widget::Drop);
	setCapture ();
}
Exemplo n.º 6
0
void ATOM_CurveEditor::onMButtonDown (ATOM_WidgetMButtonDownEvent *event)
{
	if (_enableScroll)
	{
		_dragTarget = DRAG_CLIENT;
		setCapture ();
	}
}
Exemplo n.º 7
0
void ATOM_CellData::onRButtonDown (ATOM_WidgetRButtonDownEvent *event)
{
	ATOM_STACK_TRACE(ATOM_CellData::onRButtonDown);

	setBorderMode (ATOM_Widget::Drop);
	setCapture ();
	ATOM_Widget *parent = getParent ();
	if(parent)
	{
		ATOM_CellRButtonDownEvent e(getId(), 0, 0);
		parent->handleEvent(&e);
	}
}
Exemplo n.º 8
0
void ATOM_CellData::onLButtonDown (ATOM_WidgetLButtonDownEvent *event)
{
	ATOM_STACK_TRACE(ATOM_CellData::onLButtonDown);

	setBorderMode (ATOM_Widget::Drop);
	setCapture ();
	_oldPosition = _widgetRect.point;
	ATOM_Widget *parent = getParent ();
	if(parent)
	{
		ATOM_CellLButtonDownEvent e(getId(), 0, 0);
		parent->handleEvent(&e);
	}
}
Exemplo n.º 9
0
void dialogAnalog::updatecapture(int state)
{
    mainwindow->analogMutex.lock();

	if (state == Qt::Checked )
	{
		setCapture(true);
		dataplot.Clear();
		pbZoomIn->setEnabled(false);
		pbZoomOut->setEnabled(false);
		pbFit->setEnabled(false);
		pbSave->setEnabled(false);
		pbLoad->setEnabled(false);
		groupBox->setEnabled(false);
		chkBShowMarker->setEnabled(false);
		
	}
	else
	{
		setCapture(false);
		// Store timeref
        dataplot.timeUnit = ( pPC->pTIMER->CPUSpeed * pPC->getfrequency() );
		ComputeScrollBar();
		
		pbZoomIn->setEnabled(true);
		pbZoomOut->setEnabled(true);
		pbFit->setEnabled(true);
		pbSave->setEnabled(true);
		pbLoad->setEnabled(true);
		groupBox->setEnabled(true);
		chkBShowMarker->setEnabled(true);

		this->update();
	}
    mainwindow->analogMutex.unlock();
}
Exemplo n.º 10
0
void ATOM_Button::onLButtonDblClick (ATOM_WidgetLButtonDblClickEvent *event)
{
	setBorderMode (ATOM_Widget::Drop);
	setCapture ();
}
Exemplo n.º 11
0
void ATOM_Button::onLButtonDown (ATOM_WidgetLButtonDownEvent * /* event */)
{
	setBorderMode (ATOM_Widget::Drop);
	setCapture ();
}