Mercurial > octave
diff libinterp/corefcn/event-manager.h @ 27669:271b5cd640d7
Add functions to show GUI windows (bug #57213)
* event-manager.h (interpreter_events::focus_window): New empty method.
(event_manager::focus_window): New vistual method that executes the instance's
focus_window method.
* event_manager.cc (commandwindow, commandhistory, filebrowser, workspace): New
builtin interpreter functions.
* qt-interpreter-events.[h, cc] (qt_interpreter_events::focus_window_signal):
New signal.
(qt_interpreter_events::focus_window): Implements event_manager::focus_window,
emits focus_window_signal.
* main-window.[h, cc] (main_window::focus_window): New slot that activates the
named window.
* octave-qobject.cc (gui_qobject::gui_qobject): Connect
qt_interpreter_events::focus_window_signal to main_window::focus_window.
* __unimplemented__.m: Remove commandwindow, commandhistory, filebrowser, and
workspace from the list.
* gui.txi: Add commandwindow, commandhistory, filebrowser, workspace docstrings.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Tue, 12 Nov 2019 14:54:25 +0100 |
parents | ba317c535adb |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/libinterp/corefcn/event-manager.h Mon Nov 11 20:22:52 2019 +0100 +++ b/libinterp/corefcn/event-manager.h Tue Nov 12 14:54:25 2019 +0100 @@ -184,6 +184,9 @@ return false; } + virtual void focus_window (const std::string /*win_name*/) + { } + virtual void execute_command_in_terminal (const std::string& /*command*/) { } @@ -458,6 +461,12 @@ return enabled () ? instance->copy_image_to_clipboard (file) : false; } + virtual void focus_window (const std::string win_name) + { + if (enabled ()) + instance->focus_window (win_name); + } + // Preserves pending input. void execute_command_in_terminal (const std::string& command) {