void AddLightObjectPlugin::onSceneReset(void) { clearIndicators(); typedef Fairy::SceneInfo::Objects Objects; const Fairy::SceneInfo* sceneInfo = mSceneManipulator->getSceneInfo(); const Objects& objects = sceneInfo->getObjects(); for (Objects::const_iterator it = objects.begin(); it != objects.end(); ++it) { Ogre::String type = (*it)->getType(); // 判断,如果是能处理的类型(LightObject),就处理 if ( type == "Light" ) { LightObject *lightObject = static_cast<LightObject *> ((*it).get()); Indicator *indicator = new Indicator( *it, mSceneManipulator->getSceneManager(), mSceneManipulator ); std::pair<Indicators::iterator, bool> inserted = mIndicators.insert(Indicators::value_type(*it, indicator)); assert(inserted.second); } } }
void FindReplaceDialog::cancelFind() { m_scintilla->findFirst(QString(), false, false, false, false); clearIndicators(); findInProgress = false; ui->messageLabel->setText(""); }
void UIScrollLayer::moveToPage(int page, bool animated) { if(page < 0 || page >= m_Page) { return; } if(m_ScrollStatus != ESS_IDLE) { return; } CCSize contentSize = getContentSize(); if(animated) { if (m_ScrollDir == ESD_Horizontal) { CCMoveTo *moveTo = CCMoveTo::create(0.2f, CCPointMake(-page * contentSize.width + m_ptCenter.x, m_ptCenter.y)); //m_baseLayer->runAction(moveTo); m_baseLayer->runAction(CCSequence::create(moveTo,CCCallFuncN::create(this,callfuncN_selector(UIScrollLayer::onMoveEnd)),NULL)); } else { CCMoveTo *moveTo = CCMoveTo::create(0.2f, CCPointMake(m_ptCenter.x , page * contentSize.height + m_ptCenter.y)); //m_baseLayer->runAction(moveTo); m_baseLayer->runAction(CCSequence::create(moveTo,CCCallFuncN::create(this,callfuncN_selector(UIScrollLayer::onMoveEnd)),NULL)); } } else { if (m_ScrollDir == ESD_Horizontal) { m_baseLayer->setPosition(CCPointMake(-page * contentSize.width + m_ptCenter.x, m_ptCenter.y)); } else { m_baseLayer->setPosition(CCPointMake(m_ptCenter.x, page * contentSize.height + m_ptCenter.y)); } } m_CurPage = page; checkChildrenPos(); clearIndicators(); addIndicators(m_ScrollDir); if(m_showPage != m_CurPage) { if(m_pageChangeTarget != NULL && m_pageChangeHandler != NULL) { (m_pageChangeTarget->*m_pageChangeHandler)(); } m_showPage = m_CurPage; } }
bool FindReplaceDialog::findNext() { clearIndicators(); if (findInProgress) findInProgress = m_scintilla->findNext(); else findInProgress = findFirst(ui->wrapCheckBox->isChecked(), !ui->backwardsCheckBox->isChecked()); if (!findInProgress) ui->messageLabel->setText(tr("The searched text was not found")); return findInProgress; }
void FindReplaceDialog::searchAll(bool replace) { clearIndicators(); if (!ui->selectionCheckBox->isChecked()) m_scintilla->setCursorPosition(0, 0); bool found = findFirst(/* wrap */ false, /* fordward */ true); int occurrences = 0; while (found) { if (replace) m_scintilla->replace(ui->replaceWithText->text()); indicateSelection(); ++occurrences; found = m_scintilla->findNext(); } if (!ui->selectionCheckBox->isChecked()) m_scintilla->clearSelection(); QString message; switch (occurrences) { case 0: message = tr("The searched text was not found."); break; case 1: if (replace) message = tr("The searched text was replaced one time."); else message = tr("The searched text was found one time."); break; default: if (replace) message = tr("The searched text was replaced %1 times.").arg(occurrences); else message = tr("The searched text was found %1 times.").arg(occurrences); break; } ui->messageLabel->setText(message); }
RandRConfig::~RandRConfig() { clearIndicators(); }
RandRConfig::RandRConfig(QWidget *parent, RandRDisplay *display) : QWidget(parent), Ui::RandRConfigBase() { m_display = display; Q_ASSERT(m_display); if (!m_display->isValid()) { // FIXME: this needs much better handling of this error... return; } setupUi(this); layout()->setMargin(0); connect( identifyOutputsButton, SIGNAL(clicked()), SLOT(identifyOutputs())); connect( &identifyTimer, SIGNAL(timeout()), SLOT(clearIndicators())); connect( &compressUpdateViewTimer, SIGNAL(timeout()), SLOT(slotDelayedUpdateView())); connect(unifyOutputs, SIGNAL(toggled(bool)), SLOT(unifiedOutputChanged(bool))); identifyTimer.setSingleShot( true ); compressUpdateViewTimer.setSingleShot( true ); connect( saveAsDefaultButton, SIGNAL(clicked()), SLOT(saveStartup())); QMenu* saveMenu = new QMenu(saveAsDefaultButton); saveMenu->addAction(i18n("Save as Default"),this, SLOT(saveStartup())); saveMenu->addAction(i18n("Reset"),this, SLOT(disableStartup())); saveAsDefaultButton->setMenu(saveMenu); // create the container for the settings widget QHBoxLayout *layout = new QHBoxLayout(outputList); layout->setSpacing(0); layout->setContentsMargins(0,0,0,0); m_container = new SettingsContainer(outputList); m_container->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); layout->addWidget(m_container); #ifdef HAS_RANDR_1_3 if (RandR::has_1_3) { primaryDisplayBox->setVisible(true); label->setVisible(true); } else #endif //HAS_RANDR_1_3 { primaryDisplayBox->setVisible(false); label->setVisible(false); } KConfig config("krandrrc"); if (config.hasGroup("Screen_0") && config.group("Screen_0").readEntry("OutputsUnified", false)) { unifyOutputs->setChecked(true); } // create the scene m_scene = new QGraphicsScene(m_display->currentScreen()->rect(), screenView); screenView->setScene(m_scene); screenView->installEventFilter(this); m_layoutManager = new LayoutManager(m_display->currentScreen(), m_scene); }
AddLightObjectPlugin::~AddLightObjectPlugin() { mSceneManipulator->removeSceneListener(this); clearIndicators(); }