mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#include "tab_table_controller.h"
|
|
|
|
namespace Shared {
|
|
|
|
TabTableController::TabTableController(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin,
|
|
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, bool showIndicators) :
|
|
DynamicViewController(parentResponder),
|
|
m_dataSource(dataSource),
|
|
m_topMargin(topMargin),
|
|
m_rightMargin(rightMargin),
|
|
m_bottomMargin(bottomMargin),
|
|
m_leftMargin(leftMargin),
|
|
m_showIndicators(showIndicators)
|
|
{
|
|
}
|
|
|
|
void TabTableController::didBecomeFirstResponder() {
|
|
app()->setFirstResponder(selectableTableView());
|
|
}
|
|
|
|
void TabTableController::viewWillAppear() {
|
|
DynamicViewController::viewWillAppear();
|
|
selectableTableView()->reloadData();
|
|
}
|
|
|
|
void TabTableController::willExitResponderChain(Responder * nextFirstResponder) {
|
|
if (nextFirstResponder == tabController()) {
|
|
selectableTableView()->deselectTable();
|
|
selectableTableView()->scrollToCell(0,0);
|
|
}
|
|
}
|
|
|
|
SelectableTableView * TabTableController::selectableTableView() {
|
|
return (SelectableTableView *)view();
|
|
}
|
|
|
|
View * TabTableController::loadView() {
|
|
return new SelectableTableView(this, m_dataSource, 0, 0, m_topMargin, m_rightMargin, m_bottomMargin, m_leftMargin, this, m_showIndicators, true, Palette::WallScreenDark);
|
|
}
|
|
|
|
void TabTableController::unloadView(View * view) {
|
|
delete view;
|
|
}
|
|
|
|
}
|
|
|