本文整理汇总了C++中cegui::Scrollbar::getPageSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Scrollbar::getPageSize方法的具体用法?C++ Scrollbar::getPageSize怎么用?C++ Scrollbar::getPageSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Scrollbar
的用法示例。
在下文中一共展示了Scrollbar::getPageSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例2: 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;
}
示例3: 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 ) {}
}
示例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;
}