Skip to content

Commit

Permalink
Added hot keys in the Menu to enable/disable zoom or pan functions us…
Browse files Browse the repository at this point in the history
…ing Ctrl + key shortcuts.
  • Loading branch information
ggalibert committed Nov 18, 2016
1 parent e60b8ac commit 633c5ab
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions GUI/mainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ function mainWindow(...
buttons = findall(tb);

zoomoutb = findobj(buttons, 'TooltipString', 'Zoom Out');
zoominb = findobj(buttons, 'TooltipString', 'Zoom In');
panb = findobj(buttons, 'TooltipString', 'Pan');
zoominb = findobj(buttons, 'TooltipString', 'Zoom In (Ctrl+z)');
panb = findobj(buttons, 'TooltipString', 'Pan (Ctrl+a)');
datacursorb = findobj(buttons, 'TooltipString', 'Data Cursor');

buttons(buttons == tb) = [];
Expand Down Expand Up @@ -318,11 +318,16 @@ function mainWindow(...
set(hToolsLineCastVarNonQC, 'callBack', {@displayLineCastVar, false});
set(hToolsLineCastVarQC, 'callBack', {@displayLineCastVar, true});
end
hHelpMenu = uimenu(fig, 'label', 'Help');
hHelpWiki = uimenu(hHelpMenu, 'label', 'IMOS Toolbox Wiki');
hHotKeyMenu = uimenu(fig, 'label', 'Hot Keys');
uimenu(hHotKeyMenu, 'Label', 'Enable zoom', 'Accelerator', 'z', 'Callback', @(src,evt)zoom(fig, 'on'));
uimenu(hHotKeyMenu, 'Label', 'Enable pan', 'Accelerator', 'a', 'Callback', @(src,evt)pan( fig, 'on'));
uimenu(hHotKeyMenu, 'Label', 'Disable zoom/pan', 'Accelerator', 'q', 'Callback', @disableZoomAndPan);

hHelpMenu = uimenu(fig, 'label', 'Help');
hHelpWiki = uimenu(hHelpMenu, 'label', 'IMOS Toolbox Wiki');

%set menu callbacks
set(hHelpWiki, 'callBack', @openWikiPage);
set(hHelpWiki, 'callBack', @openWikiPage);

%% Widget Callbacks

Expand Down Expand Up @@ -634,6 +639,11 @@ function displayLineMooringVar(source,ev, isQC)

end

function disableZoomAndPan(source, ev)
pan(fig, 'off');
zoom(fig, 'off');
end

function displayLineCastVar(source,ev, isQC)
%DISPLAYLINECASTVAR Opens a new window where all the
% variables collected by the CTD cast are line-plotted.
Expand Down

0 comments on commit 633c5ab

Please sign in to comment.