本文整理汇总了C++中cegui::Scrollbar类的典型用法代码示例。如果您正苦于以下问题:C++ Scrollbar类的具体用法?C++ Scrollbar怎么用?C++ Scrollbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Scrollbar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: logFiredEvent
void WidgetDemo::logFiredEvent(const CEGUI::String& logMessage)
{
ListboxItem* item = d_widgetSelectorListbox->getFirstSelectedItem();
if(!item)
return;
CEGUI::String eventsLog = d_widgetsEventsLog->getText();
eventsLog += logMessage;
//Remove line
int pos = std::max<int>(static_cast<int>(eventsLog.length() - 2056), 0);
int len = std::min<int>(static_cast<int>(eventsLog.length()), 2056);
eventsLog = eventsLog.substr(pos, len);
if(len == 2056)
{
int newlinePos = eventsLog.find_first_of("\n");
if(newlinePos != std::string::npos)
eventsLog = eventsLog.substr(newlinePos, std::string::npos);
}
d_widgetsEventsLog->setText(eventsLog);
//Scroll to end
CEGUI::Scrollbar* scrollbar = static_cast<CEGUI::Scrollbar*>(d_widgetsEventsLog->getChild("__auto_vscrollbar__"));
scrollbar->setScrollPosition(scrollbar->getDocumentSize() - scrollbar->getPageSize());
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:25,代码来源:WidgetDemo.cpp
示例2: SetVerticalScrollPosition
void CGUIMemo_Impl::SetVerticalScrollPosition ( float fPosition )
{
CEGUI::Scrollbar* pScrollbar = reinterpret_cast < CEGUI::MultiLineEditbox* > ( m_pWindow )->d_vertScrollbar;
if ( pScrollbar )
{
pScrollbar->setScrollPosition ( fPosition );
}
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:8,代码来源:CGUIMemo_Impl.cpp
示例3: 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;
}
}
开发者ID:justinzane,项目名称:navit,代码行数:9,代码来源:gui_sdl_window.cpp
示例4: GetScrollbarPageSize
float CGUIMemo_Impl::GetScrollbarPageSize ( void )
{
CEGUI::Scrollbar* pScrollbar = reinterpret_cast < CEGUI::MultiLineEditbox* > ( m_pWindow )->d_vertScrollbar;
if ( pScrollbar )
{
return pScrollbar->getPageSize ();
}
return 1.0f;
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:10,代码来源:CGUIMemo_Impl.cpp
示例5: 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;
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:10,代码来源:CGUIMemo_Impl.cpp
示例6: SetVerticalScrollPosition
void CGUIGridList_Impl::SetVerticalScrollPosition ( float fPosition )
{
try
{
CEGUI::Scrollbar* pScrollbar = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow )->d_vertScrollbar;
if ( pScrollbar )
pScrollbar->setScrollPosition ( fPosition * ( pScrollbar->getDocumentSize () - pScrollbar->getPageSize () ) );
}
catch ( CEGUI::Exception ) {}
}
开发者ID:Jusonex,项目名称:mtasa-awesomium,代码行数:10,代码来源:CGUIGridList_Impl.cpp
示例7: 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;
}
开发者ID:Jusonex,项目名称:mtasa-awesomium,代码行数:11,代码来源:CGUIGridList_Impl.cpp
示例8: 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;
}
开发者ID:Ackak,项目名称:Khazad,代码行数:12,代码来源:MainGameScreen.cpp
示例9: handleDSSelection
bool GUIManager::handleDSSelection ( 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));
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
DataManager *dm = static_cast<DataManager *>(
lb->getFirstSelectedItem()->getUserData());
_selectedDM = dm;
std::vector<unsigned int> const & dim = dm->getDimensions();
sb->setStepSize(1.0/float(dim.size()-1));
sb->enable();
CEGUI::WindowEventArgs w(sb);
sb->fireEvent(CEGUI::Scrollbar::EventScrollPositionChanged, w);
return true;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:16,代码来源:GUIManager.cpp
示例10: setHandlers
void GUIManager::setHandlers ()
{
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
CEGUI::FrameWindow *dsFrame = static_cast<CEGUI::FrameWindow *>(
wm.getWindow("Sheet/DatasetFrame"));
dsFrame->hide();
// Handle behavior of options-button
CEGUI::PushButton *button = static_cast<CEGUI::PushButton *>(
wm.getWindow("Sheet/Options"));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleOptionsVisibility, this));
button = dsFrame->getCloseButton();
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleOptionsVisibility, this));
// Connect activate buttons on tabs
auto connectFrames = [=](CEGUI::Window *tab) {
CEGUI::PushButton *button =
static_cast<CEGUI::PushButton *>(tab->getChild(3));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleDSActivation, this));
button = static_cast<CEGUI::PushButton *>(tab->getChild(4));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleDSDeactivation, this));
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
sb->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleScrollbarChanged, this));
CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
lb->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleDSSelection, this));
};
CEGUI::Window *tab = wm.getWindow("Sheet/DatasetFrame/TabControl/HTab");
connectFrames(tab);
tab = wm.getWindow("Sheet/DatasetFrame/TabControl/PTab");
connectFrames(tab);
tab = wm.getWindow("Sheet/DatasetFrame/TabControl/CTab");
connectFrames(tab);
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(
wm.getWindow("Sheet/DimensionSlider"));
sb->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleBigScrollbarChanged, this));
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:42,代码来源:GUIManager.cpp
示例11: handleDSDeactivation
bool GUIManager::handleDSDeactivation ( 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());
dm->deactivate();
// Enable global scrollbar
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
sb = static_cast<CEGUI::Scrollbar *>(wm.getWindow("Sheet/DimensionSlider"));
sb->disable();
CEGUI::Window *desc = wm.getWindow("Sheet/DimensionText");
desc->hide();
}
// TODO handle else-error
return true;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:20,代码来源:GUIManager.cpp
示例12: 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;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:27,代码来源:GUIManager.cpp
示例13: 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;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:39,代码来源:GUIManager.cpp
示例14: 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);
}
}
}
开发者ID:Ackak,项目名称:Khazad,代码行数:23,代码来源:MainGameScreen.cpp
示例15: Init
bool MainGameScreen::Init()
{
RootWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout("MainGameScreen.layout");
try
{
CEGUI::Window* GameOptionsButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/GameOptionsButton");
if (GameOptionsButton != NULL)
{
GameOptionsButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::GameOptionsOpen, this));
}
CEGUI::Window* GameOptionsWindow = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow");
if (GameOptionsWindow != NULL)
{
GameOptionsWindow->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&MainGameScreen::GameOptionsClose, this));
}
CEGUI::Window* PathTesterWindow = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow");
if (PathTesterWindow != NULL)
{
PathTesterWindow->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&MainGameScreen::PathProfilerClose, this));
}
CEGUI::Window* ZoneButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/ZoneButton");
if (ZoneButton != NULL)
{
ZoneButton->subscribeEvent(CEGUI::FrameWindow::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::ZoneButtonClick, this));
}
CEGUI::Window* SaveButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/SaveGameButton");
if (SaveButton != NULL)
{
SaveButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::SaveGame, this));
}
CEGUI::Window* PathProfileButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/PathProfilerButton");
if (PathProfileButton != NULL)
{
PathProfileButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::PathProfilerOpen, this));
}
CEGUI::Window* ExitButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/ExitButton");
if (ExitButton != NULL)
{
ExitButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::ExitGame, this));
}
CEGUI::Window* TestSuiteButton = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/RunSuiteButton");
if (TestSuiteButton != NULL)
{
TestSuiteButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::RunSuitePressed, this));
}
CEGUI::Scrollbar* DepthSliderTop = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerTop"));
if (DepthSliderTop != NULL)
{
DepthSliderTop->setDocumentSize(1000);
DepthSliderTop->setScrollPosition(0);
DepthSliderTop->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&MainGameScreen::DepthSliderMoved, this));
}
CEGUI::Scrollbar* DepthSliderBottom = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerBottom"));
if (DepthSliderBottom != NULL)
{
DepthSliderBottom->setDocumentSize(1000);
DepthSliderBottom->setScrollPosition(1000);
DepthSliderBottom->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&MainGameScreen::DepthSliderMoved, this));
}
CEGUI::Window* PauseButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/PauseButton");
if (PauseButton != NULL)
{
PauseButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::PausePressed, this));
}
CEGUI::Window* PlayButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/PlayButton");
if (PauseButton != NULL)
{
PlayButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::PlayPressed, this));
}
CEGUI::Window* DigButton = GUI->getWindowManager()->getWindow("MainGameScreen/BottomWindow/DigButton");
if (DigButton != NULL)
{
DigButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::DigPressed, this));
}
}
catch(CEGUI::Exception &e)
{
}
}
开发者ID:Ackak,项目名称:Khazad,代码行数:94,代码来源:MainGameScreen.cpp
注:本文中的cegui::Scrollbar类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论