void T27ActionMore::ccTouchEnded(CCTouch* t, CCEvent*) { CCPoint ptStart = t->getStartLocation(); CCPoint ptEnd = t->getLocation(); if (ptStart.getDistanceSq(ptEnd) <= 25) { // click // 点中了哪个子窗口 // 转换ptStart为ScrollView中的Container的坐标 // 再判断被点击的LayerColor CCPoint ptInContainer = _c->convertToNodeSpace(ptStart); CCArray* arr = _c->getChildren(); // 所有的layercolor for (int i = 0; i < sizeof(_actionName) / sizeof(*_actionName); i++) { CCLayerColor* layer = (CCLayerColor*)arr->objectAtIndex(i); if (layer->boundingBox().containsPoint(ptInContainer)) { testAction(i, layer); break; } } } }
ChronoDuino::ChronoDuino(QWidget * a_parent) : QMainWindow(a_parent) { m_main_window.setupUi(this); //UI m_result_inspector = new ResultInspector(this); setCentralWidget(m_result_inspector); m_competitor_inspector = new CompetitorInspector(this); addDockWidget(Qt::RightDockWidgetArea, m_competitor_inspector); m_round_inspector = new RoundInspector(this); addDockWidget(Qt::RightDockWidgetArea, m_round_inspector); //Connect connect(m_main_window.m_action_new, SIGNAL(triggered()), SLOT(newRaceAction())); connect(m_main_window.m_action_open, SIGNAL(triggered()), SLOT(openRaceAction())); connect(m_main_window.m_action_preferences, SIGNAL(triggered()), SLOT(editPreferencesAction())); connect(m_main_window.m_action_about, SIGNAL(triggered()), SLOT(aboutAction())); connect(m_main_window.m_action_print, SIGNAL(triggered()), SLOT(printAction())); connect(m_main_window.m_action_test, SIGNAL(triggered()), SLOT(testAction())); initDbConnection(); }
void ChatWindowStyle_Test::allTests() { testStyle = new ChatWindowStyle(QString(SRCDIR)+QString("/TestStyle")); // change user data dir to avoid messing with user's .kde dir setenv( "KDEHOME", QFile::encodeName( QDir::homePath() + "/.kopete-unittest" ), true ); testPaths(); testHtml(); testVariants(); testAction(); }
void run() { switch (routes[action]) { case LOAD: loadAction(); break; case INSERT: insertAction(); break; case FIND: findAction(); break; case REMOVE: removeAction(); break; case CLEAR: clearAction(); break; case DELETE: deleteAction(); break; case SHOW: showAction(); break; case TEST: testAction(); break; case HELP: helpAction(); break; case REPORT: reportAction(); break; default: usageAction(); break; } }