straight copy of qt4 branch over to trunk, merge refused to work
git-svn-id: svn://svn.code.sf.net/p/qjoypad/code/trunk@95 c05e91a0-76c8-4ec0-b377-ef19ce7cc080
This commit is contained in:
committed by
virtuoussin13
parent
c1ef3fa0b7
commit
345bb5748e
@ -1,37 +1,38 @@
|
||||
#include "axisw.h"
|
||||
|
||||
|
||||
AxisWidget::AxisWidget( Axis* a, QWidget* parent )
|
||||
: FlashButton( "",parent) {
|
||||
axis = a;
|
||||
ae = NULL;
|
||||
update();
|
||||
on = false;
|
||||
: FlashButton( "",parent) {
|
||||
axis = a;
|
||||
ae = NULL;
|
||||
update();
|
||||
on = false;
|
||||
}
|
||||
|
||||
void AxisWidget::jsevent( int val ) {
|
||||
bool newOn = !axis->inDeadZone(val);
|
||||
if (on != newOn) {
|
||||
on = newOn;
|
||||
flash();
|
||||
}
|
||||
if (ae != NULL) ae->setState(val);
|
||||
bool newOn = !axis->inDeadZone(val);
|
||||
if (on != newOn) {
|
||||
on = newOn;
|
||||
flash();
|
||||
}
|
||||
if (ae != NULL) ae->setState(val);
|
||||
}
|
||||
|
||||
void AxisWidget::update() {
|
||||
setText( axis->status());
|
||||
setText( axis->status());
|
||||
}
|
||||
|
||||
void AxisWidget::mouseReleaseEvent( QMouseEvent* e ) {
|
||||
//create the edit dialog,
|
||||
ae = new AxisEdit(axis);
|
||||
//get its input
|
||||
ae->exec();
|
||||
//now that it's done, destroy it!
|
||||
delete ae;
|
||||
//and remember that it's gone.
|
||||
ae = NULL;
|
||||
update();
|
||||
//release the button. Waiting to do this until the very end has the nice
|
||||
//effect of keeping the button depressed while the dialog is shown.
|
||||
FlashButton::mouseReleaseEvent( e );
|
||||
//create the edit dialog,
|
||||
ae = new AxisEdit(axis);
|
||||
//get its input
|
||||
ae->exec();
|
||||
//now that it's done, destroy it!
|
||||
delete ae;
|
||||
//and remember that it's gone.
|
||||
ae = NULL;
|
||||
update();
|
||||
//release the button. Waiting to do this until the very end has the nice
|
||||
//effect of keeping the button depressed while the dialog is shown.
|
||||
FlashButton::mouseReleaseEvent( e );
|
||||
}
|
||||
|
Reference in New Issue
Block a user