本文整理汇总了C++中cegui::Scrollbar::getScrollPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Scrollbar::getScrollPosition方法的具体用法?C++ Scrollbar::getScrollPosition怎么用?C++ Scrollbar::getScrollPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Scrollbar
的用法示例。
在下文中一共展示了Scrollbar::getScrollPosition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleDSActivation
bool GUIManager::handleDSActivation ( CEGUI::EventArgs const & e )
{
CEGUI::Window *tab =
static_cast<CEGUI::WindowEventArgs const &>(e).window->getParent();
CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
ListboxItem *item = static_cast<ListboxItem *>(lb->getFirstSelectedItem());
if (item != NULL) {
DataManager *dm = static_cast<DataManager *>(item->getUserData());
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
std::vector<unsigned int> const & dims = dm->getDimensions();
unsigned int dim = dims[int(sb->getScrollPosition()*(dims.size()-1))];
float scrollPos = sb->getScrollPosition();
dm->activate(dim);
// Enable global scrollbar
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
sb = static_cast<CEGUI::Scrollbar *>(wm.getWindow("Sheet/DimensionSlider"));
sb->enable();
CEGUI::WindowEventArgs w(sb);
sb->fireEvent(CEGUI::Scrollbar::EventScrollPositionChanged, w);
// Set the global scrollbar to the right position.
sb->setScrollPosition(scrollPos);
CEGUI::Window *desc = wm.getWindow("Sheet/DimensionText");
desc->show();
}
// TODO handle else-error
return true;
}
示例2: MoveCamera
bool MoveCamera(const CEGUI::EventArgs& event){
CEGUI::Scrollbar * sb = static_cast<const CEGUI::Scrollbar *>(CEGUI::WindowManager::getSingleton().getWindow("OSD/Scrollbar1"));
dbg(0,"moving : %f\n",sb->getScrollPosition());
eyeZ=-sb->getScrollPosition();
if (eyeZ>-100){
eyeZ=-100;
}
}
示例3: GetVerticalScrollPosition
float CGUIMemo_Impl::GetVerticalScrollPosition ( void )
{
CEGUI::Scrollbar* pScrollbar = reinterpret_cast < CEGUI::MultiLineEditbox* > ( m_pWindow )->d_vertScrollbar;
if ( pScrollbar )
{
return pScrollbar->getScrollPosition ();
}
return 0.0f;
}
示例4: GetVerticalScrollPosition
float CGUIGridList_Impl::GetVerticalScrollPosition ( void )
{
try
{
CEGUI::Scrollbar* pScrollbar = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow )->d_vertScrollbar;
if ( pScrollbar )
return ( pScrollbar->getScrollPosition () / ( pScrollbar->getDocumentSize () - pScrollbar->getPageSize () ) );
}
catch ( CEGUI::Exception ) {}
return 0.0f;
}
示例5: DepthSliderMoved
bool MainGameScreen::DepthSliderMoved(const CEGUI::EventArgs& pEventArgs)
{
CEGUI::Scrollbar* DepthSliderTop = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerTop"));
CEGUI::Scrollbar* DepthSliderBottom = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerBottom"));
if (DepthSliderTop != NULL && DepthSliderBottom != NULL)
{
int32_t ZMax = GAME->getMap()->getHighest() - GAME->getMap()->getLowest();
RENDERER->getActiveCamera()->SetSlice(ZMax - DepthSliderTop->getScrollPosition(), ZMax - DepthSliderBottom->getScrollPosition());
}
return true;
}
示例6: handleBigScrollbarChanged
bool GUIManager::handleBigScrollbarChanged ( CEGUI::EventArgs const & e )
{
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
try {
if (_selectedDM != NULL) {
CEGUI::Window *desc = wm.getWindow("Sheet/DimensionText");
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(
static_cast<CEGUI::WindowEventArgs const &>(e).window);
float f = sb->getScrollPosition();
std::vector<unsigned int> const & dims = _selectedDM->getDimensions();
unsigned int newDim = dims[int(f*(dims.size()-1))];
std::ostringstream ss; ss << newDim;
desc->setText(ss.str());
CEGUI::Scrollbar *otherSB;
switch (_selectedDM->type) {
case DM_Height:
otherSB = static_cast<CEGUI::Scrollbar *>(wm.getWindow(
"Sheet/DatasetFrame/TabControl/HTab/Scrollbar"));
break;
case DM_Pattern:
otherSB = static_cast<CEGUI::Scrollbar *>(wm.getWindow(
"Sheet/DatasetFrame/TabControl/PTab/Scrollbar"));
break;
case DM_Color:
otherSB = static_cast<CEGUI::Scrollbar *>(wm.getWindow(
"Sheet/DatasetFrame/TabControl/CTab/Scrollbar"));
break;
default:
break;
};
otherSB->setScrollPosition(f);
_selectedDM->activate(newDim);
}
}
catch (DataManagerException & e) {
std::cerr << e.what() << std::endl;
}
return true;
}
示例7: resetDeepthSliders
void MainGameScreen::resetDeepthSliders()
{
CEGUI::Scrollbar* DepthSliderTop = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerTop"));
if (DepthSliderTop != NULL)
{
int32_t ZMax = GAME->getMap()->getHighest() - GAME->getMap()->getLowest();
DepthSliderTop->setDocumentSize(ZMax);
}
CEGUI::Scrollbar* DepthSliderBottom = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerBottom"));
if (DepthSliderBottom != NULL)
{
int32_t ZMax = GAME->getMap()->getHighest() - GAME->getMap()->getLowest();
float OldPosition = DepthSliderBottom->getScrollPosition();
if (OldPosition > ZMax)
{
DepthSliderBottom->setDocumentSize(ZMax);
DepthSliderBottom->setScrollPosition(ZMax);
} else {
DepthSliderBottom->setScrollPosition(ZMax);
}
}
}