contextual menu actions
This commit is contained in:
parent
bb301b99ee
commit
815b39bb16
|
@ -26,24 +26,20 @@
|
|||
|
||||
-(void)back: (id)sender {
|
||||
NSLog(@"Browser backward");
|
||||
if (browser_window_history_back_available(browser)) {
|
||||
browser_window_history_back(browser, false);
|
||||
}
|
||||
[plotView back: sender];
|
||||
}
|
||||
|
||||
-(void)forward: (id)sender {
|
||||
NSLog(@"Browser forward");
|
||||
if (browser_window_history_forward_available(browser)) {
|
||||
browser_window_history_forward(browser, false);
|
||||
}
|
||||
[plotView forward: sender];
|
||||
}
|
||||
|
||||
-(void)stopOrRefresh: (id)sender {
|
||||
int tag = [sender tag];
|
||||
if (tag == 1 && browser_window_stop_available(browser)) {
|
||||
browser_window_stop(browser);
|
||||
} else if (browser_window_reload_available(browser)) {
|
||||
browser_window_reload(browser, true);
|
||||
if (tag == 1) {
|
||||
[plotView stopReloading: sender];
|
||||
} else {
|
||||
[plotView reload: sender];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -368,15 +368,15 @@ static const struct plotter_table gnustep_plotters = {
|
|||
|
||||
[popupMenu addItem: [NSMenuItem separatorItem]];
|
||||
}
|
||||
|
||||
[popupMenu addItemWithTitle: @"Back"
|
||||
action: @selector(goBack:) keyEquivalent: @""];
|
||||
[popupMenu addItemWithTitle: @"Reload"
|
||||
action: @selector(reloadPage:) keyEquivalent: @""];
|
||||
action: @selector(back:) keyEquivalent: @""];
|
||||
[popupMenu addItemWithTitle: @"Forward"
|
||||
action: @selector(goForward:) keyEquivalent: @""];
|
||||
[popupMenu addItemWithTitle: @"View Source"
|
||||
action: @selector(viewSource:) keyEquivalent: @""];
|
||||
action: @selector(forward:) keyEquivalent: @""];
|
||||
[popupMenu addItemWithTitle: @"Stop"
|
||||
action: @selector(stopReloading:) keyEquivalent: @""];
|
||||
[popupMenu addItemWithTitle: @"Reload"
|
||||
action: @selector(reload:) keyEquivalent: @""];
|
||||
|
||||
|
||||
[NSMenu popUpContextMenu: popupMenu withEvent: event forView: self];
|
||||
|
||||
|
@ -620,6 +620,27 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) {
|
|||
return NSHeight( [[self superview] frame] ) - [[self enclosingScrollView] pageScroll];
|
||||
}
|
||||
|
||||
-(void)back: (id)sender {
|
||||
if (browser_window_history_back_available(browser)) {
|
||||
browser_window_history_back(browser, false);
|
||||
}
|
||||
}
|
||||
-(void)forward: (id)sender {
|
||||
if (browser_window_history_forward_available(browser)) {
|
||||
browser_window_history_forward(browser, false);
|
||||
}
|
||||
}
|
||||
-(void)stopReloading: (id)sender {
|
||||
if (browser_window_stop_available(browser)) {
|
||||
browser_window_stop(browser);
|
||||
}
|
||||
}
|
||||
-(void)reload: (id)sender {
|
||||
if (browser_window_reload_available(browser)) {
|
||||
browser_window_reload(browser, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) cmOpenURLInTab: (id)sender {
|
||||
struct nsurl *url;
|
||||
|
|
Loading…
Reference in New Issue