mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-30 09:20:19 +02:00
v108.3
* add support for TableView::onActivate(TableViewCell) to Windows, macOS ** allows the new input/hotkey mapping panels to work on Windows, macOS * polish BrowserDialog behavior
This commit is contained in:
@@ -110,13 +110,15 @@
|
||||
tableView->doChange();
|
||||
}
|
||||
|
||||
-(IBAction) activate:(id)sender {
|
||||
tableView->doActivate({});
|
||||
}
|
||||
|
||||
-(IBAction) doubleAction:(id)sender {
|
||||
if([content clickedRow] >= 0) {
|
||||
[self activate:self];
|
||||
int row = [content clickedRow];
|
||||
if(row >= 0 && row < tableView->state.items.size()) {
|
||||
int column = [content clickedColumn];
|
||||
if(column >= 0 && column < tableView->state.columns.size()) {
|
||||
auto item = tableView->state.items[row];
|
||||
auto cell = item->cell(column);
|
||||
tableView->doActivate(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,9 +129,14 @@
|
||||
-(void) keyDown:(NSEvent*)event {
|
||||
auto character = [[event characters] characterAtIndex:0];
|
||||
if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) {
|
||||
if([self selectedRow] >= 0) {
|
||||
[[self delegate] activate:self];
|
||||
return;
|
||||
int row = [self selectedRow];
|
||||
if(row >= 0 && row < tableView->state.items.size()) {
|
||||
int column = max(0, [self selectedColumn]); //can be -1?
|
||||
if(column >= 0 && column < tableView->state.columns.size()) {
|
||||
auto item = tableView->state.items[row];
|
||||
auto cell = item->cell(column);
|
||||
tableView->doActivate(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,6 @@
|
||||
-(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation;
|
||||
-(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
|
||||
-(void) tableViewSelectionDidChange:(NSNotification*)notification;
|
||||
-(IBAction) activate:(id)sender;
|
||||
-(IBAction) doubleAction:(id)sender;
|
||||
@end
|
||||
|
||||
|
Reference in New Issue
Block a user