本文整理汇总了C++中TApp::getPaletteController方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::getPaletteController方法的具体用法?C++ TApp::getPaletteController怎么用?C++ TApp::getPaletteController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApp
的用法示例。
在下文中一共展示了TApp::getPaletteController方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CurrentStyleChangeCommand
PaletteViewerPanel::PaletteViewerPanel(QWidget *parent) : TPanel(parent) {
m_paletteHandle = new TPaletteHandle();
connect(m_paletteHandle, SIGNAL(colorStyleSwitched()),
SLOT(onColorStyleSwitched()));
connect(m_paletteHandle, SIGNAL(paletteSwitched()),
SLOT(onPaletteSwitched()));
TApp *app = TApp::instance();
m_paletteViewer = new PaletteViewer(this, PaletteViewerGUI::LEVEL_PALETTE);
m_paletteViewer->setPaletteHandle(
app->getPaletteController()->getCurrentLevelPalette());
m_paletteViewer->setFrameHandle(app->getCurrentFrame());
m_paletteViewer->setXsheetHandle(app->getCurrentXsheet());
// for clearing cache when paste style command called from the StyleSelection
m_paletteViewer->setLevelHandle(app->getCurrentLevel());
TSceneHandle *sceneHandle = app->getCurrentScene();
connect(sceneHandle, SIGNAL(sceneSwitched()), SLOT(onSceneSwitched()));
CurrentStyleChangeCommand *currentStyleChangeCommand =
new CurrentStyleChangeCommand();
m_paletteViewer->setChangeStyleCommand(currentStyleChangeCommand);
setWidget(m_paletteViewer);
initializeTitleBar();
}
示例2: onStyleChanged
bool onStyleChanged() override {
TApp *app = TApp::instance();
int styleIndex =
app->getPaletteController()->getCurrentLevelPalette()->getStyleIndex();
TSelection *currentSelection = app->getCurrentSelection()->getSelection();
StrokeSelection *ss = dynamic_cast<StrokeSelection *>(currentSelection);
if (!ss || ss->isEmpty()) return false;
ss->changeColorStyle(styleIndex);
return true;
}
示例3: onCurrentButtonToggled
void PaletteViewerPanel::onCurrentButtonToggled(bool isCurrent) {
if (isActive() == isCurrent) return;
TApp *app = TApp::instance();
TPaletteHandle *ph = app->getPaletteController()->getCurrentLevelPalette();
// Se sono sulla palette del livello corrente e le palette e' vuota non
// consento di bloccare il pannello.
if (isActive() && !ph->getPalette()) {
m_isCurrentButton->setPressed(true);
return;
}
setActive(isCurrent);
m_paletteViewer->enableSaveAction(isCurrent);
// Cambio il livello corrente
if (isCurrent) {
std::set<TXshSimpleLevel *> levels;
TXsheet *xsheet = app->getCurrentXsheet()->getXsheet();
int row, column;
findPaletteLevels(levels, row, column, m_paletteHandle->getPalette(),
xsheet);
// Se non trovo livelli riferiti alla palette setto il palette viewer alla
// palette del livello corrente.
if (levels.empty()) {
m_paletteViewer->setPaletteHandle(ph);
update();
return;
}
TXshSimpleLevel *level = *levels.begin();
// Se sto editando l'xsheet devo settare come corrente anche la colonna e il
// frame.
if (app->getCurrentFrame()->isEditingScene()) {
int currentColumn = app->getCurrentColumn()->getColumnIndex();
if (currentColumn != column)
app->getCurrentColumn()->setColumnIndex(column);
int currentRow = app->getCurrentFrame()->getFrameIndex();
TXshCell cell = xsheet->getCell(currentRow, column);
if (cell.isEmpty() || cell.getSimpleLevel() != level)
app->getCurrentFrame()->setFrameIndex(row);
TCellSelection *selection = dynamic_cast<TCellSelection *>(
app->getCurrentSelection()->getSelection());
if (selection) selection->selectNone();
}
app->getCurrentLevel()->setLevel(level);
m_paletteViewer->setPaletteHandle(ph);
} else {
m_paletteHandle->setPalette(ph->getPalette());
m_paletteViewer->setPaletteHandle(m_paletteHandle);
}
update();
}
示例4: TPanel
StudioPaletteViewerPanel::StudioPaletteViewerPanel(QWidget *parent)
: TPanel(parent) {
m_studioPaletteHandle = new TPaletteHandle();
connect(m_studioPaletteHandle, SIGNAL(colorStyleSwitched()),
SLOT(onColorStyleSwitched()));
connect(m_studioPaletteHandle, SIGNAL(paletteSwitched()),
SLOT(onPaletteSwitched()));
connect(m_studioPaletteHandle, SIGNAL(paletteLockChanged()),
SLOT(onPaletteSwitched()));
TApp *app = TApp::instance();
m_studioPaletteViewer = new StudioPaletteViewer(
this, m_studioPaletteHandle,
app->getPaletteController()->getCurrentLevelPalette(),
app->getCurrentFrame(), app->getCurrentXsheet(), app->getCurrentLevel());
setWidget(m_studioPaletteViewer);
}
示例5: showEvent
void Filmstrip::showEvent(QShowEvent *) {
TApp *app = TApp::instance();
TXshLevelHandle *levelHandle = app->getCurrentLevel();
bool ret = connect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)),
SLOT(onLevelSwitched(TXshLevel *)));
ret = ret &&
connect(levelHandle, SIGNAL(xshLevelChanged()), SLOT(onLevelChanged()));
// updateWindowTitle is called in the onLevelChanged
ret = ret && connect(app->getPaletteController()->getCurrentLevelPalette(),
SIGNAL(colorStyleChangedOnMouseRelease()),
SLOT(onLevelChanged()));
ret = ret && connect(levelHandle, SIGNAL(xshLevelTitleChanged()),
SLOT(onLevelChanged()));
ret =
ret && connect(m_frameArea->verticalScrollBar(),
SIGNAL(valueChanged(int)), this, SLOT(onSliderMoved(int)));
TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
ret = ret && connect(sceneHandle, SIGNAL(sceneSwitched()), this,
SLOT(updateChooseLevelComboItems()));
ret = ret && connect(sceneHandle, SIGNAL(castChanged()), this,
SLOT(updateChooseLevelComboItems()));
ret = ret &&
connect(TApp::instance()->getCurrentXsheet(), SIGNAL(xsheetChanged()),
this, SLOT(updateChooseLevelComboItems()));
ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this,
SLOT(onFrameSwitched()));
assert(ret);
updateChooseLevelComboItems();
onFrameSwitched();
onLevelSwitched(0);
}