wex
v21.10.0
|
Offers an aui managed frame with a notebook multiple document interface, used by the notebook classes, and toolbar, findbar and vibar support. More...
#include <wex/frame.h>
Public Types | |
enum | { HIDE_BAR , HIDE_BAR_FOCUS_STC , HIDE_BAR_FORCE , HIDE_BAR_FORCE_FOCUS_STC , SHOW_BAR , SHOW_BAR_SYNC_CLOSE_ALL } |
Enums for show_ex_bar. More... | |
typedef std::vector< std::pair< wxWindow *, wxAuiPaneInfo > > | panes_t |
Panes vector with a pair of panes. | |
typedef std::vector< std::pair< std::pair< std::string, std::string >, int > > | toggled_panes_t |
Toggled panes type. | |
Public Member Functions | |
frame (size_t maxFiles=9, const data::window &data=data::window().style(wxDEFAULT_FRAME_STYLE)) | |
Default constructor, registers the aui manager, and creates the bars. | |
~frame () override | |
Destructor, uninits the aui manager. | |
virtual bool | allow_close (wxWindowID id, wxWindow *page) |
Virtual interface. More... | |
virtual void | append_vcs (menu *, const menu_item *i) const |
Appends vcs menu. | |
virtual void | bind_accelerators (wxWindow *parent, const std::vector< wxAcceleratorEntry > &v, bool debug=false) |
Binds accelerators. | |
virtual void | debug_add_menu (menu &, bool) |
Adds debug menu. | |
virtual void | debug_exe (int menu_id, factory::stc *stc) |
Runs debug action. | |
virtual void | debug_exe (const std::string &command, factory::stc *stc) |
Runs debug command. | |
virtual void | debug_exe (const path &p) |
Invoked when a debug exe path is opened. | |
virtual wxEvtHandler * | debug_handler () |
Sets a debug handler. | |
virtual bool | debug_is_active () const |
Runs true if we are debugging. | |
virtual bool | debug_print (const std::string &text) |
Prints a debug variable. | |
virtual bool | debug_toggle_breakpoint (int line, factory::stc *stc) |
Toggles a breakpoint on line. | |
virtual bool | exec_ex_command (ex_command &command) |
Executes a ex command. More... | |
virtual void | on_notebook (wxWindowID id, wxWindow *page) |
Called if the notebook changed page. More... | |
virtual bool | print_ex (factory::stc *stc, const std::string &text) |
Allows you to override print ex. | |
virtual bool | process_async_system (const std::string &command, const std::string &start_dir=std::string()) |
Runs async process. | |
virtual void | record (const std::string &command) |
Allows you to perform action for a (vi) command. More... | |
virtual factory::stc * | restore_page (const std::string &key) |
Restores a previous saved current page. More... | |
virtual bool | save_current_page (const std::string &key) |
Saves the current page, to restore later on. | |
virtual void | show_ex_bar (int action=HIDE_BAR_FOCUS_STC, factory::stc *stc=nullptr) |
Shows or hides the ex bar. More... | |
virtual void | show_ex_message (const std::string &text) |
Shows text in ex bar. | |
virtual int | show_stc_entry_dialog (bool modal=false) |
Shows or updates stc entry dialog. | |
virtual factory::stc * | stc_entry_dialog_component () |
Returns stc component for stc entry dialog. | |
virtual std::string | stc_entry_dialog_title () const |
Returns stc entry dialog title. | |
virtual void | stc_entry_dialog_title (const std::string &title) |
Sets stc entry dialog title. | |
virtual void | stc_entry_dialog_validator (const std::string ®ex) |
Sets stc entry dialog vaildator. | |
virtual void | sync_all () |
Called after you checked the Sync checkbox on the options toolbar. | |
virtual void | sync_close_all (wxWindowID id) |
Called after all pages from the notebooks are deleted. More... | |
const auto * | debug_entry () const |
Other methods. More... | |
auto & | file_history () |
Returns file history. | |
auto * | get_find_toolbar () |
Returns the find toolbar. | |
auto * | get_options_toolbar () |
Returns the options toolbar. | |
auto * | get_statusbar () |
Returns statusbar. | |
auto * | get_toolbar () |
Returns the toolbar. | |
const std::string | pane_add (wxWindow *pane) |
Adds a window as a pane, generating a unique name. More... | |
bool | pane_add (const panes_t &panes, const std::string &perspective="managed frame") |
Add panes to the manager. More... | |
wxWindow * | pane_get (const std::string &pane) |
Returns window related to window, or nullptr if pane is not present. | |
bool | pane_is_maximized (const std::string &pane) |
Returns true if the managed pane is maximized. | |
bool | pane_is_shown (const std::string &pane) |
Returns true if pane is shown. | |
bool | pane_maximize (const std::string &pane) |
Maximizes the managed pane. More... | |
bool | pane_restore (const std::string &pane) |
Restores the managed pane. More... | |
bool | pane_set (const std::string &pane, const wxAuiPaneInfo &info) |
Updates pane info for managed pane. More... | |
bool | pane_show (const std::string &pane, bool show=true) |
Shows or hides the managed pane. More... | |
bool | pane_toggle (const std::string &pane) |
Toggles the managed pane: if shown hides it, otherwise shows it. More... | |
size_t | panes () const |
Returns number of panes. | |
void | set_debug_entry (wex::debug_entry *de) |
Sets debug entry. | |
statusbar * | setup_statusbar (const std::vector< statusbar_pane > &panes, long style=wxST_SIZEGRIP, const std::string &name="statusBar") |
Sets up the status bar if you want to use statustext. More... | |
bool | show_ex_command (factory::stc *stc, const std::string &label) |
Returns a command line ex command. More... | |
bool | show_ex_input (factory::stc *stc, char command) |
Shows ex bar, and enters input mode. More... | |
void | show_process (bool show) |
Shows or hide process pane. | |
const auto & | toggled_panes () const |
Returns the toggled panes. | |
std::string | get_statustext (const std::string &pane) const override |
overridden methods | |
factory::stc * | open_file (const path &filename, const data::stc &data=data::stc()) override |
Default opens the file using get_stc. More... | |
void | set_recent_file (const path &path) override |
Allows derived class to update file history. | |
void | statusbar_clicked_right (const std::string &) override |
Do something when statusbar is (right) clicked. | |
bool | statustext (const std::string &text, const std::string &pane) const override |
Sets text on specified pane. More... | |
![]() | |
virtual factory::grid * | get_grid () |
Virtual interface. More... | |
virtual factory::listview * | get_listview () |
Returns a listview. | |
virtual factory::process * | get_process (const std::string &command) |
Allows you to e.g. More... | |
virtual factory::stc * | get_stc () |
Returns an stc. | |
virtual bool | is_open (const path &filename) |
Returns true if file is opened in a window. | |
virtual void | on_command_item_dialog (wxWindowID, const wxCommandEvent &) |
Called when an item dialog command event is triggered. | |
virtual factory::stc * | open_file (const path &filename, const std::string &text, const data::stc &data) |
Allows you to open a filename with specified contents. More... | |
virtual factory::stc * | open_file (const path &filename, const vcs_entry &vcs, const data::stc &data) |
Allows you to open a filename with info from vcs. More... | |
virtual bool | output (const std::string &text) const |
Allows you to handle output text, .e.g. More... | |
virtual void | statusbar_clicked (const std::string &pane) |
When (left) clicked, uses the get_stc() for some dialogs. | |
bool | is_closing () const |
Other methods. More... | |
void | set_find_focus (wxWindow *focus) |
Sets the find focus to specified window. | |
bool | update_statusbar (const wxListView *lv) |
Updates statusbar pane items pane with values from specified listview. | |
bool | update_statusbar (factory::stc *stc, const std::string &pane) |
Updates the specified statusbar pane with values from specified stc. | |
void | SetMenuBar (wxMenuBar *bar) override |
Override from base class. | |
Offers an aui managed frame with a notebook multiple document interface, used by the notebook classes, and toolbar, findbar and vibar support.
anonymous enum |
Enums for show_ex_bar.
|
virtual |
Virtual interface.
Returns true if the page can be closed. Default resets the find focus.
id | notebook id |
page | page |
|
inline |
Other methods.
Returns current debugger.
|
inlinevirtual |
Executes a ex command.
Returns true if this command is handled. This method is invoked at the beginning of the ex command handling, allowing you to override any command.
|
inlinevirtual |
Called if the notebook changed page.
Default sets the focus to page and adds page as recently used.
Reimplemented in wex::del::frame.
|
overridevirtual |
Default opens the file using get_stc.
Returns stc component opened, or nullptr.
Reimplemented from wex::factory::frame.
bool wex::frame::pane_add | ( | const panes_t & | panes, |
const std::string & | perspective = "managed frame" |
||
) |
Add panes to the manager.
Returns false if one of the panes could not be added.
panes | panes |
perspective | name of perspective to load / save |
const std::string wex::frame::pane_add | ( | wxWindow * | pane | ) |
Adds a window as a pane, generating a unique name.
Return the name of the pane.
bool wex::frame::pane_maximize | ( | const std::string & | pane | ) |
Maximizes the managed pane.
Returns false if pane is not managed.
bool wex::frame::pane_restore | ( | const std::string & | pane | ) |
Restores the managed pane.
Returns false if pane is not managed.
bool wex::frame::pane_set | ( | const std::string & | pane, |
const wxAuiPaneInfo & | info | ||
) |
Updates pane info for managed pane.
Returns false if pane is not managed.
bool wex::frame::pane_show | ( | const std::string & | pane, |
bool | show = true |
||
) |
Shows or hides the managed pane.
Returns false if pane is not managed.
|
inline |
Toggles the managed pane: if shown hides it, otherwise shows it.
Returns false if pane is not managed.
|
inlinevirtual |
Allows you to perform action for a (vi) command.
This method is invoked after command is executed.
|
inlinevirtual |
Restores a previous saved current page.
Returns restored page (default returns nullptr).
statusbar* wex::frame::setup_statusbar | ( | const std::vector< statusbar_pane > & | panes, |
long | style = wxST_SIZEGRIP , |
||
const std::string & | name = "statusBar" |
||
) |
Sets up the status bar if you want to use statustext.
And initializes other static data.
|
inlinevirtual |
Shows or hides the ex bar.
Default it hides the ex bar and sets focus back to stc component associated with current ex. If current ex has ex mode enabled, the ex bar is always shown.
action | action |
stc | stc component to use for showing ex bar (for SHOW_ actions) |
Reimplemented in wex::del::frame.
bool wex::frame::show_ex_command | ( | factory::stc * | stc, |
const std::string & | label | ||
) |
Returns a command line ex command.
Shows the ex bar, sets the label and sets focus to it, allowing you to enter a command. Returns false if label is not supported.
stc | the ex on which command is to be done |
label | label for the ex bar (/, ?, :, =) |
bool wex::frame::show_ex_input | ( | factory::stc * | stc, |
char | command | ||
) |
Shows ex bar, and enters input mode.
Returns false if command is not supported.
stc | the ex on which command is to be done |
command | the command (a, c, or i) |
|
overridevirtual |
Sets text on specified pane.
Don't forget to call setup_statusbar first.
Reimplemented from wex::factory::frame.
|
virtual |
Called after all pages from the notebooks are deleted.
Default resets the find focus.