bool TabbedControl::SetCurrentPage(unsigned i, bool click) { const unsigned old_current = pager.GetCurrentIndex(); bool success = pager.SetCurrent(i, click); if (success && old_current != pager.GetCurrentIndex() && page_flipped_callback != NULL) page_flipped_callback(); return success; }
void TabBarControl::PreviousPage() { if (!pager.Previous(HasPointer())) /* failed to switch */ return; if (tab_display != nullptr) tab_display->Invalidate(); if (page_flipped_callback) page_flipped_callback(); }
void TabBarControl::SetCurrentPage(unsigned i) { if (i == pager.GetCurrentIndex()) /* no-op */ return; if (!pager.SetCurrent(i)) /* failed to switch */ return; if (tab_display != nullptr) tab_display->Invalidate(); if (page_flipped_callback) page_flipped_callback(); }
void TabBarControl::ClickPage(unsigned i) { const bool is_current = i == pager.GetCurrentIndex(); if (!pager.ClickPage(i) || is_current) /* failure */ return; /* switching to a new page by mouse click focuses the first control of the page, which is important for Altair hot keys */ pager.SetFocus(); if (tab_display != nullptr) tab_display->Invalidate(); if (page_flipped_callback) page_flipped_callback(); }
void TabbedControl::PreviousPage() { if (pager.Previous(true) && page_flipped_callback != NULL) page_flipped_callback(); }
void TabbedControl::NextPage() { if (pager.Next(true) && page_flipped_callback != NULL) page_flipped_callback(); }
void PagerWidget::OnPageFlipped() { if (page_flipped_callback) page_flipped_callback(); }