CComponentsForm/CComponentsWindow: add page scroll handling

This provides page scroll with up/down, left/right or combined.
Usage of exec() methods with implemented signals allows a
generic implematation of button or other message handling with
signal/slot solutions.

still to do: page cache
This commit is contained in:
2014-09-07 22:41:04 +02:00
committed by [CST] Focus
parent 4e5df866bd
commit 88ce62ea84
4 changed files with 210 additions and 0 deletions

View File

@@ -153,6 +153,8 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const
ccw_show_r_sideber = false;
ccw_w_sidebar = 40;
page_scroll_mode = PG_SCROLL_M_OFF; //permanent disabled here, only in body used!
initCCWItems();
initParent(parent);
}
@@ -370,11 +372,26 @@ u_int8_t CComponentsWindow::getCurrentPage()
return ccw_body->getCurrentPage();
}
bool CComponentsWindow::isPageChanged()
{
for(size_t i=0; i<ccw_body->size(); i++){
if (ccw_body->getCCItem(i)->getPageNumber() != getCurrentPage())
return true;
}
return false;
}
void CComponentsWindow::setScrollBarWidth(const int& scrollbar_width)
{
ccw_body->setScrollBarWidth(scrollbar_width);
}
void CComponentsWindow::enablePageScroll(const int& mode)
{
ccw_body->enablePageScroll(mode);
}
void CComponentsWindow::paintCurPage(bool do_save_bg)
{
if (is_painted) //ensure that we have painted already the parent form before paint body