bool StatusBar::onProcessMessage(Message* msg) { switch (msg->type()) { case kMouseEnterMessage: { updateSubwidgetsVisibility(); const Document* document = UIContext::instance()->getActiveDocument(); if (document != NULL) updateCurrentFrame(); break; } case kMouseLeaveMessage: if (hasChild(m_commandsBox)) { // If we want restore the state-bar and the slider doesn't have // the capture... if (getManager()->getCapture() != m_slider) { // ...exit from command mode getManager()->freeFocus(); // TODO Review this code removeChild(m_commandsBox); invalidate(); } } break; } return Widget::onProcessMessage(msg); }
unsigned STexture::setLastFrame(unsigned frameno) { if (frameno<=firstFrame) return lastFrame; if (frameno>physicalLastFrame) frameno=physicalLastFrame; lastFrame = frameno; return updateCurrentFrame(); }
unsigned STexture::setFirstFrame(unsigned frameno) { if (frameno>=lastFrame) return firstFrame; if (frameno<physicalFirstFrame) frameno=physicalFirstFrame; firstFrame = frameno; return updateCurrentFrame(); }
void TApp::onXsheetChanged() { updateXshLevel(); updateCurrentFrame(); //update current tool m_currentTool->onImageChanged((TImage::Type)getCurrentImageType()); }
unsigned STexture::setLoopFromFrame(unsigned frameno) { unsigned n=frameno; if (n < firstFrame) n=firstFrame; if (n >= lastFrame) n=lastFrame; loopFromFrame = n; return updateCurrentFrame(); }
void STexture::bind() { if (this==0) return; if (videoReady()) { QString s=frameFilename(updateCurrentFrame()); loadDDS(s); //qDebug() << s << ": " << texture; } else if (currentTexName.size()>0) { loadDDS(currentTexName); } if (texture) { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { glDisable(GL_TEXTURE_2D); } }
void TApp::onSceneSwitched() { //update XSheet m_currentXsheet->setXsheet(m_currentScene->getScene()->getXsheet()); TPalette *palette = m_currentScene->getScene()->getProperties()->getCleanupParameters()->m_cleanupPalette.getPointer(); m_paletteController->getCurrentCleanupPalette()->setPalette(palette, -1); m_paletteController->editLevelPalette(); //reset current frame m_currentFrame->setFrame(0); //clear current onionSkinMask m_currentOnionSkinMask->clear(); //update currentFrames updateCurrentFrame(); //update current tool m_currentTool->onImageChanged((TImage::Type)getCurrentImageType()); }
bool StatusBar::setStatusText(int msecs, const char *format, ...) { // TODO this call should be in an observer of the "current frame" property changes. updateCurrentFrame(); if ((ji_clock > m_timeout) || (msecs > 0)) { char buf[256]; // TODO warning buffer overflow va_list ap; va_start(ap, format); vsprintf(buf, format, ap); va_end(ap); m_timeout = ji_clock + msecs; m_state = SHOW_TEXT; setText(buf); invalidate(); return true; } else return false; }
unsigned STexture::setCurrentFrame(unsigned frameno) { position = frameno; return updateCurrentFrame(); }
void TApp::onSceneChanged() { updateCurrentFrame(); m_currentTool->updateMatrix(); }
void StatusBar::newFrame() { Command* cmd = CommandsModule::instance()->getCommandByName(CommandId::NewFrame); UIContext::instance()->executeCommand(cmd); updateCurrentFrame(); }