コード例 #1
0
// lMouseUp
//---------------------------------------------------------------------------
void View::lMouseUp(const iXY &downPos, const iXY &upPos)
{
    // Check all components for a clicked event.
    {    
        ComponentsIterator i;
        for ( i=components.begin(); i != components.end(); i++)
        {        
            if ((*i)->contains(downPos) && (*i)->contains(upPos)) {
                mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_CLICKED, now(), InputEvent::BUTTON1_MASK, upPos.x, upPos.y, 0, false);

                (*i)->actionPerformed(me);

                actionPerformed(me);
            }
        }
    }

    // Report a mouse release to all components except for a clicked one.
    {    
        ComponentsIterator i;
        for ( i=components.begin(); i != components.end(); i++)
        {        
            if ((*i)->contains(upPos)) {
                mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_RELEASED, now(), InputEvent::BUTTON1_MASK, upPos.x, upPos.y, 0, false);

                (*i)->actionPerformed(me);

                actionPerformed(me);
            }
        }
    }
} // end View::lMouseUp
コード例 #2
0
ArmButtons::ArmButtons(QWidget *parent)
    : QGroupBox(parent)
{
    this->setTitle("Arm");
    button=new QPushButton[4];

    button[0].setText("UP");
    button[1].setText("RELEASE");
    button[2].setText("CATCH");
    button[3].setText("DOWN");
    button[0].setMinimumSize(250,75);
    button[1].setMinimumSize(250,75);
    button[2].setMinimumSize(250,75);
    button[3].setMinimumSize(250,75);

    QVBoxLayout *lay=new QVBoxLayout;
    lay->addWidget(&button[0]);
    lay->addWidget(&button[1]);
    lay->addWidget(&button[2]);
    lay->addWidget(&button[3]);
    this->setLayout(lay);

    connect(&button[0], SIGNAL(pressed()), this, SLOT(actionPerformed()));
    connect(&button[1], SIGNAL(pressed()), this, SLOT(actionPerformed()));
    connect(&button[2], SIGNAL(pressed()), this, SLOT(actionPerformed()));
    connect(&button[3], SIGNAL(pressed()), this, SLOT(actionPerformed()));
}
コード例 #3
0
void ConsistToolAction::common()
{
    // disable ourself if there is no consist manager available
 if (InstanceManager::getDefault("ConsistManager") == NULL) {
        setEnabled(false);
    }
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}
コード例 #4
0
 /*public*/ TrainConductorAction::TrainConductorAction(QString s, Train* train, QObject* parent)
   : AbstractAction(s, parent)
 {
     //super(s);
  f = NULL;
     this->train = train;
  connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
 }
コード例 #5
0
void AudioTableAction::common()
{
 log = new Logger("AudioTableAction");
 bufferFrame = nullptr;
 sourceFrame = nullptr;
 listenerFrame = nullptr;
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}
コード例 #6
0
// mouseMove
//---------------------------------------------------------------------------
// Purpse: Changes the current highlighted button and checks for mouseEnter
//         and mouseExit status.
//---------------------------------------------------------------------------
void View::mouseMove(const iXY & prevPos, const iXY &newPos)
{
    // Check all components for a clicked event.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {        
        bool containsPrev=(*i)->contains(prevPos);
        bool containsNew=(*i)->contains(newPos);
        if (containsPrev && !containsNew) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_EXITED, now(), 0, newPos.x, newPos.y, 0, false);

            (*i)->actionPerformed(me);

            actionPerformed(me);
        } else if (!containsPrev && containsNew) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_ENTERED, now(), 0, newPos.x, newPos.y, 0, false);

            (*i)->actionPerformed(me);

            actionPerformed(me);
        } else if (containsNew && newPos!=prevPos) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_MOVED, now(), 0, newPos.x, newPos.y, 0, false);

            (*i)->actionPerformed(me);

            actionPerformed(me);
        }
    }

    /*  // THIS DOES NOT WORK!!!!!!!!!!
    	bool flagNewPos  = contains(newPos);
    	bool flagPrevPos = contains(prevPos);
     
    	// Check for status of mouseEnter and mouseExit.
    	if (flagNewPos && !flagPrevPos)
    	{
    		mouseEnter(newPos);
    	}
    	else if (!flagNewPos && flagPrevPos)
    	{
    		mouseExit(prevPos);
    	}
    */
} // end mouseMove
コード例 #7
0
ファイル: logviewer.cpp プロジェクト: shsorbom/kcm-ufw-debian
void LogViewer::setupActions()
{
    viewAction=KAuth::Action("org.kde.ufw.viewlog");
    viewAction.setHelperID("org.kde.ufw");
#if KDE_IS_VERSION(4, 5, 90)
    viewAction.setParentWidget(this);
#endif
//     queryAction.setExecutesAsync(true);
    connect(viewAction.watcher(), SIGNAL(actionPerformed(ActionReply)), SLOT(queryPerformed(ActionReply)));
}
コード例 #8
0
// rMouseUp
//---------------------------------------------------------------------------
void View::rMouseUp(const iXY &downPos, const iXY &upPos)
{
    int reportRelease = true;

    // Check all components for a clicked event.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {        
        if ((*i)->contains(downPos) && (*i)->contains(upPos)) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_CLICKED, now(), InputEvent::BUTTON2_MASK, upPos.x, upPos.y, 0, false);

            (*i)->actionPerformed(me);

            reportRelease = false;

            actionPerformed(me);
        }
    }

    // If we are on the last component and there was no component containing both
    // mouse press positions, then report a release to an
    if (reportRelease) {
        // Check all components for a release event.
        ComponentsIterator i;
        for ( i=components.begin(); i != components.end(); i++)
        {        
            if ((*i)->contains(upPos)) {
                mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_RELEASED, now(), InputEvent::BUTTON2_MASK, upPos.x, upPos.y, 0, false);

                (*i)->actionPerformed(me);

                reportRelease = false;

                actionPerformed(me);
            }
        }
    }

} // end View::rMouseUp
コード例 #9
0
// doDeactivate
//---------------------------------------------------------------------------
// Purpose: Default Implementation -
//---------------------------------------------------------------------------
void View::doDeactivate()
{
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {
        mMouseEvent me((*i),
            mMouseEvent::MOUSE_EVENT_EXITED, now(), 0, 
            MouseInterface::getMouseX(), MouseInterface::getMouseY(), 0, false);

        (*i)->actionPerformed(me);

        actionPerformed(me);
    }
} // end View::doDeactivate
コード例 #10
0
// mouseEnter
//---------------------------------------------------------------------------
// Purpose: Is triggered when the mouse enters the window.
//---------------------------------------------------------------------------
void View::mouseEnter(const iXY &pos)
{
    // Check all components for a entered event.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {        
        if ((*i)->contains(pos)) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_ENTERED, now(), 0, pos.x, pos.y, 0, false);

            (*i)->actionPerformed(me);

            actionPerformed(me);
        }
    }

} // end View::mouseEnter
コード例 #11
0
// doActivate
//---------------------------------------------------------------------------
// Purpose: Default Implementation -
//---------------------------------------------------------------------------
void View::doActivate()
{
    // Tell all the components the mouse entered the view.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {
        if ((*i)->contains(MouseInterface::getMousePosition())) {
            mMouseEvent me((*i),
                mMouseEvent::MOUSE_EVENT_ENTERED, now(), 0, 
                MouseInterface::getMouseX(), MouseInterface::getMouseY(), 0, false);

            (*i)->actionPerformed(me);

            actionPerformed(me);
        }
    }
} // end View::doActivate
コード例 #12
0
void DualDecoderToolAction::common()
{
 // disable ourself if programming is not possible
 bool enabled = false;
 if ((!InstanceManager::getList("GlobalProgrammerManager")->isEmpty())
     && (InstanceManager::getList("GlobalProgrammerManager")->size() > 0))
 {
     enabled = true;
 }
 if ((!InstanceManager::getList("AddressedProgrammerManager")->isEmpty())
     && (InstanceManager::getList("AddressedProgrammerManager")->size() > 0))
 {
     enabled = true;
 }

 setEnabled(enabled);
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}
コード例 #13
0
// rMouseDown
//---------------------------------------------------------------------------
void View::rMouseDown(const iXY &pos)
{
    focusComponent = 0;

    // Check all components for a pressed event.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {        
        if ((*i)->contains(pos)) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_PRESSED, now(), InputEvent::BUTTON2_MASK, pos.x, pos.y, 0, false);

            (*i)->actionPerformed(me);

            focusComponent = (*i);

            actionPerformed(me);
        }
    }

} // end View::rMouseDown
コード例 #14
0
// lMouseDrag
//---------------------------------------------------------------------------
void View::lMouseDrag(const iXY &downPos, const iXY &prevPos, const iXY &newPos)
{
    //lMouseDown(newPos);
    //mouseMove(prevPos, newPos);

    // Check all components for a dragged event.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {        
        if ((*i)->contains(newPos) && (*i)->contains(downPos) && newPos!=prevPos) {
            mMouseEvent me((*i), mMouseEvent::MOUSE_EVENT_DRAGGED, now(), InputEvent::BUTTON1_MASK, newPos.x, newPos.y, 0, false);

            (*i)->actionPerformed(me);

            focusComponent = (*i);

            actionPerformed(me);
        }
    }

} // end View::lMouseDrag
コード例 #15
0
 /*public*/ ExportCarRosterAction::ExportCarRosterAction(QString actionName, QWidget* frame)
    : AbstractAction(actionName, (QObject*)frame)
 {
     //super(actionName);
  connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
 }
コード例 #16
0
 /*public*/ BackupFilesAction::BackupFilesAction(QString s, QObject* parent)
     : AbstractAction(s, parent)
 {
  //super(s);
  connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
 }
コード例 #17
0
///*public*/ SignallingSourceAction() {
//    super(rb.getString("SignallingPairs"));
//}
void SignallingSourceAction::init()
{
    log = new Logger("SignallingSourceAction");
    connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}
コード例 #18
0
 void OperationsSetupAction::common()
 {
  connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
  f = NULL;
 }
コード例 #19
0
 /*public*/ SetTrainIconPositionAction::SetTrainIconPositionAction(QString s, QObject* parent) : AbstractAction(s, parent) {
     //super(s);
      f = NULL;
      connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
 }
コード例 #20
0
/*public*/ XmlFileLocationAction::XmlFileLocationAction(QObject* parent)
        : AbstractAction(parent)
{
 //super();
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()) );
}
コード例 #21
0
void LcdClockAction::common()
{
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}
コード例 #22
0
/**
 * @brief PausedMenu::on_no_clicked resume the game
 */
void PausedMenu::on_no_clicked()
{
    this->quit = false ;
    emit actionPerformed();
    this->hide();
}
コード例 #23
0
/**
 * @brief PausedMenu::on_yes_clicked returns the control to the main menu
 */
void PausedMenu::on_yes_clicked()
{
    this->quit = true ;
    emit actionPerformed();
    this->hide();
}
コード例 #24
0
 void TrainCopyAction::common()
 {
  _train = NULL;
  f = NULL;
  connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
 }
コード例 #25
0
void InputWindowAction::common()
{
 pref = (UserPreferencesManager*)InstanceManager::getDefault("UserPreferencesManager");
 connect(this, SIGNAL(triggered()), this, SLOT(actionPerformed()));
}