本文整理汇总了C++中TXshLevel::getPaletteLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshLevel::getPaletteLevel方法的具体用法?C++ TXshLevel::getPaletteLevel怎么用?C++ TXshLevel::getPaletteLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TXshLevel
的用法示例。
在下文中一共展示了TXshLevel::getPaletteLevel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateXshLevel
void TApp::updateXshLevel() {
TXshLevel *xl = 0;
if (m_currentFrame->isEditingScene()) {
int frame = m_currentFrame->getFrame();
int column = m_currentColumn->getColumnIndex();
TXsheet *xsheet = m_currentXsheet->getXsheet();
if (xsheet && column >= 0 && frame >= 0 && !xsheet->isColumnEmpty(column)) {
TXshCell cell = xsheet->getCell(frame, column);
xl = cell.m_level.getPointer();
// Se sono su una cella vuota successiva a celle di un certo livello
// prendo questo come livello corrente.
if (!xl && frame > 0) {
TXshCell cell = xsheet->getCell(frame - 1, column);
xl = cell.m_level.getPointer();
}
}
m_currentLevel->setLevel(xl);
// level could be the same, but palette could have changed
if (xl && xl->getSimpleLevel()) {
TPalette *currentPalette =
m_paletteController->getCurrentPalette()->getPalette();
int styleIndex =
m_paletteController->getCurrentLevelPalette()->getStyleIndex();
m_paletteController->getCurrentLevelPalette()->setPalette(
xl->getSimpleLevel()->getPalette(), styleIndex);
// Se il nuovo livello selezionato e' un ovl,
// la paletta corrente e' una cleanup palette
// => setto come handle corrente quello della paletta di cleanup.
if (xl->getType() == OVL_XSHLEVEL && currentPalette &&
currentPalette->isCleanupPalette())
m_paletteController->editCleanupPalette();
} else if (xl && xl->getPaletteLevel()) {
int styleIndex =
m_paletteController->getCurrentLevelPalette()->getStyleIndex();
m_paletteController->getCurrentLevelPalette()->setPalette(
xl->getPaletteLevel()->getPalette(), styleIndex);
} else
m_paletteController->getCurrentLevelPalette()->setPalette(0);
}
}
示例2: startOrganizePalette
bool StylePickerTool::startOrganizePalette() {
/* Check if the organizing operation is available */
TXshLevel *level = getApplication()->getCurrentLevel()->getLevel();
if (!level) {
DVGui::error(tr("No current level."));
return false;
}
if (level->getType() != PLI_XSHLEVEL && level->getType() != TZP_XSHLEVEL &&
level->getType() != PLT_XSHLEVEL) {
DVGui::error(tr("Current level has no available palette."));
return false;
}
/* palette should have more than one page to organize */
TPalette *pal = NULL;
if (level->getType() == PLT_XSHLEVEL)
pal = level->getPaletteLevel()->getPalette();
else
pal = level->getSimpleLevel()->getPalette();
if (!pal || pal->getPageCount() < 2) {
DVGui::error(
tr("Palette must have more than one palette to be organized."));
return false;
}
m_paletteToBeOrganized = pal;
std::cout << "Start Organize Palette" << std::endl;
return true;
}
示例3: onXshLevelSwitched
void TApp::onXshLevelSwitched(TXshLevel *) {
TXshLevel *level = m_currentLevel->getLevel();
if (level) {
TXshSimpleLevel *simpleLevel = level->getSimpleLevel();
// Devo aggiornare la paletta corrente
if (simpleLevel) {
m_paletteController->getCurrentLevelPalette()->setPalette(
simpleLevel->getPalette());
// Se il nuovo livello selezionato e' un ovl,
// la paletta corrente e' una cleanup palette
// => setto come handle corrente quello della paletta di cleanup.
TPalette *currentPalette =
m_paletteController->getCurrentPalette()->getPalette();
if (simpleLevel->getType() == OVL_XSHLEVEL && currentPalette &&
currentPalette->isCleanupPalette())
m_paletteController->editCleanupPalette();
return;
}
TXshPaletteLevel *paletteLevel = level->getPaletteLevel();
if (paletteLevel) {
m_paletteController->getCurrentLevelPalette()->setPalette(
paletteLevel->getPalette());
return;
}
}
m_paletteController->getCurrentLevelPalette()->setPalette(0);
}
示例4: onImageChanged
/*
If the working palette is changed, then deactivate the "organize palette"
toggle.
*/
void StylePickerTool::onImageChanged() {
std::cout << "StylePickerTool::onImageChanged" << std::endl;
if (!m_organizePalette.getValue() || !m_paletteToBeOrganized) return;
TXshLevel *level = getApplication()->getCurrentLevel()->getLevel();
if (!level) {
m_organizePalette.setValue(false);
getApplication()->getCurrentTool()->notifyToolChanged();
return;
}
TPalette *pal = NULL;
if (level->getType() == PLT_XSHLEVEL)
pal = level->getPaletteLevel()->getPalette();
else if (level->getSimpleLevel()) {
pal = level->getSimpleLevel()->getPalette();
}
if (!pal || pal != m_paletteToBeOrganized) {
m_organizePalette.setValue(false);
getApplication()->getCurrentTool()->notifyToolChanged();
return;
}
}