mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-22 22:22:42 +01:00
byuu says: Changelog: - fixed major nall/vector/prepend bug - renamed hiro/ListView to hiro/TableView - added new hiro/ListView control which is a simplified abstraction of hiro/TableView - updated higan's cheat database window and icarus' scan dialog to use the new ListView control - compilation works once again on all platforms (Windows, Cocoa, GTK, Qt) - the loki skeleton compiles once again (removed nall/DSP references; updated port/device ID names) Small catch: need to capture layout resize events internally in Windows to call resizeColumns. For now, just resize the icarus window to get it to use the full window width for list view items.
59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
#if defined(Hiro_TableView)
|
|
|
|
auto mTableViewHeader::allocate() -> pObject* {
|
|
return new pTableViewHeader(*this);
|
|
}
|
|
|
|
//
|
|
|
|
auto mTableViewHeader::append(sTableViewColumn column) -> type& {
|
|
state.columns.append(column);
|
|
column->setParent(this, columnCount() - 1);
|
|
signal(append, column);
|
|
return *this;
|
|
}
|
|
|
|
auto mTableViewHeader::column(unsigned position) const -> TableViewColumn {
|
|
if(position < columnCount()) return state.columns[position];
|
|
return {};
|
|
}
|
|
|
|
auto mTableViewHeader::columnCount() const -> unsigned {
|
|
return state.columns.size();
|
|
}
|
|
|
|
auto mTableViewHeader::columns() const -> vector<TableViewColumn> {
|
|
vector<TableViewColumn> columns;
|
|
for(auto& column : state.columns) columns.append(column);
|
|
return columns;
|
|
}
|
|
|
|
auto mTableViewHeader::remove() -> type& {
|
|
if(auto tableView = parentTableView()) tableView->remove(*this);
|
|
return *this;
|
|
}
|
|
|
|
auto mTableViewHeader::remove(sTableViewColumn column) -> type& {
|
|
signal(remove, column);
|
|
state.columns.remove(column->offset());
|
|
for(auto n : range(column->offset(), columnCount())) {
|
|
state.columns[n]->adjustOffset(-1);
|
|
}
|
|
column->setParent();
|
|
return *this;
|
|
}
|
|
|
|
auto mTableViewHeader::reset() -> type& {
|
|
for(auto n : rrange(state.columns)) remove(state.columns[n]);
|
|
return *this;
|
|
}
|
|
|
|
auto mTableViewHeader::setParent(mObject* parent, signed offset) -> type& {
|
|
for(auto& column : state.columns) column->destruct();
|
|
mObject::setParent(parent, offset);
|
|
for(auto& column : state.columns) column->setParent(this, column->offset());
|
|
return *this;
|
|
}
|
|
|
|
#endif
|