mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04: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.
72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
#if defined(Hiro_TableView)
|
|
|
|
namespace hiro {
|
|
|
|
auto pTableViewCell::construct() -> void {
|
|
}
|
|
|
|
auto pTableViewCell::destruct() -> void {
|
|
}
|
|
|
|
auto pTableViewCell::setAlignment(Alignment alignment) -> void {
|
|
}
|
|
|
|
auto pTableViewCell::setBackgroundColor(Color color) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::setCheckable(bool checkable) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::setChecked(bool checked) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::setForegroundColor(Color color) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::setIcon(const image& icon) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::setText(const string& text) -> void {
|
|
_repaint();
|
|
}
|
|
|
|
auto pTableViewCell::_parent() -> maybe<pTableViewItem&> {
|
|
if(auto parent = self().parentTableViewItem()) {
|
|
if(auto self = parent->self()) return *self;
|
|
}
|
|
return nothing;
|
|
}
|
|
|
|
auto pTableViewCell::_repaint() -> void {
|
|
if(auto parent = _parent()) {
|
|
if(auto tableView = parent->_parent()) {
|
|
//TableView uses a custom drawing routine; so we need to tell the control to repaint itself manually
|
|
PostMessageOnce(tableView->_parentHandle(), AppMessage::TableView_doPaint, 0, (LPARAM)&tableView->reference);
|
|
}
|
|
}
|
|
}
|
|
|
|
auto pTableViewCell::_setState() -> void {
|
|
if(auto item = _parent()) {
|
|
if(auto parent = item->_parent()) {
|
|
parent->lock();
|
|
wchar_t text[] = L"";
|
|
LVITEM lvItem;
|
|
lvItem.mask = LVIF_TEXT;
|
|
lvItem.iItem = item->self().offset();
|
|
lvItem.iSubItem = self().offset();
|
|
lvItem.pszText = text;
|
|
ListView_SetItem(parent->hwnd, &lvItem);
|
|
parent->unlock();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|