bsnes/hiro/qt/widget/list-view-column.cpp

100 lines
2.3 KiB
C++
Raw Normal View History

#if defined(Hiro_ListView)
namespace hiro {
auto pListViewColumn::construct() -> void {
}
auto pListViewColumn::destruct() -> void {
}
auto pListViewColumn::setActive() -> void {
//unsupported
}
auto pListViewColumn::setAlignment(Alignment alignment) -> void {
_setState();
}
auto pListViewColumn::setBackgroundColor(Color color) -> void {
_setState();
}
auto pListViewColumn::setEditable(bool editable) -> void {
//unsupported
}
auto pListViewColumn::setExpandable(bool expandable) -> void {
_setState();
}
Update to v094r43 release. byuu says: Updated to compile with all of the new hiro changes. My next step is to write up hiro API documentation, and move the API from alpha (constantly changing) to beta (rarely changing), in preparation for the first stable release (backward-compatible changes only.) Added "--fullscreen" command-line option. I like this over a configuration file option. Lets you use the emulator in both modes without having to modify the config file each time. Also enhanced the command-line game loading. You can now use any of these methods: higan /path/to/game-folder.sfc higan /path/to/game-folder.sfc/ higan /path/to/game-folder.sfc/program.rom The idea is to support launchers that insist on loading files only. Technically, the file can be any name (manifest.bml also works); the only criteria is that the file actually exists and is a file, and not a directory. This is a requirement to support the first version (a directory lacking the trailing / identifier), because I don't want my nall::string class to query the file system to determine if the string is an actual existing file or directory for its pathname() / dirname() functions. Anyway, every game folder I've made so far has program.rom, and that's very unlikely to change, so this should be fine. Now, of course, if you drop a regular "game.sfc" file on the emulator, it won't even try to load it, unless it's in a folder that ends in .fc, .sfc, etc. In which case, it'll bail out immediately by being unable to produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
auto pListViewColumn::setFont(const Font& font) -> void {
_setState();
}
auto pListViewColumn::setForegroundColor(Color color) -> void {
_setState();
}
auto pListViewColumn::setHorizontalAlignment(double alignment) -> void {
_setState();
}
Update to v094r43 release. byuu says: Updated to compile with all of the new hiro changes. My next step is to write up hiro API documentation, and move the API from alpha (constantly changing) to beta (rarely changing), in preparation for the first stable release (backward-compatible changes only.) Added "--fullscreen" command-line option. I like this over a configuration file option. Lets you use the emulator in both modes without having to modify the config file each time. Also enhanced the command-line game loading. You can now use any of these methods: higan /path/to/game-folder.sfc higan /path/to/game-folder.sfc/ higan /path/to/game-folder.sfc/program.rom The idea is to support launchers that insist on loading files only. Technically, the file can be any name (manifest.bml also works); the only criteria is that the file actually exists and is a file, and not a directory. This is a requirement to support the first version (a directory lacking the trailing / identifier), because I don't want my nall::string class to query the file system to determine if the string is an actual existing file or directory for its pathname() / dirname() functions. Anyway, every game folder I've made so far has program.rom, and that's very unlikely to change, so this should be fine. Now, of course, if you drop a regular "game.sfc" file on the emulator, it won't even try to load it, unless it's in a folder that ends in .fc, .sfc, etc. In which case, it'll bail out immediately by being unable to produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
auto pListViewColumn::setImage(const Image& image) -> void {
//unsupported
}
auto pListViewColumn::setResizable(bool resizable) -> void {
_setState();
}
auto pListViewColumn::setSortable(bool sortable) -> void {
_setState();
}
auto pListViewColumn::setText(const string& text) -> void {
_setState();
}
auto pListViewColumn::setVerticalAlignment(double alignment) -> void {
_setState();
}
auto pListViewColumn::setVisible(bool visible) -> void {
_setState();
}
auto pListViewColumn::setWidth(signed width) -> void {
_setState();
}
auto pListViewColumn::_parent() -> maybe<pListViewHeader&> {
if(auto parent = self().parentListViewHeader()) {
if(auto delegate = parent->self()) return *delegate;
}
return nothing;
}
auto pListViewColumn::_setState() -> void {
if(auto header = _parent()) {
if(auto parent = header->_parent()) {
parent->qtListView->header()->setResizeMode(self().offset(), state().resizable ? QHeaderView::Interactive : QHeaderView::Fixed);
bool clickable = false;
for(auto& column : header->state().columns) clickable |= column->state.sortable;
parent->qtListView->header()->setClickable(clickable);
parent->qtListView->headerItem()->setText(self().offset(), QString::fromUtf8(state().text));
parent->qtListView->setColumnHidden(self().offset(), !self().visible());
for(auto& item : parent->state().items) {
if(auto cell = item->cell(self().offset())) {
if(auto self = cell->self()) self->_setState();
}
}
}
}
}
}
#endif