wex
v21.04.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/managed-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 | |
managed_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. | |
virtual | ~managed_frame () |
Destructor, uninits the aui manager. | |
virtual bool | allow_close (wxWindowID id, wxWindow *page) |
Virtual interface. More... | |
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 void | print_ex (ex *ex, const std::string &text) |
Prints text in ex dialog. More... | |
virtual void | record (const std::string &command) |
Allows you to perform action for a (vi) command. More... | |
virtual 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 | sync_all () |
Called after you checked the Sync checkbox on the options toolbar. More... | |
virtual void | sync_close_all (wxWindowID id) |
Called after all pages from the notebooks are deleted. More... | |
stc * | open_file (const path &filename, const data::stc &data=data::stc()) override |
overridden methods | |
void | set_recent_file (const path &path) override |
Allows derived class to update file history. | |
void | statusbar_clicked (const std::string &) override |
When (left) clicked, uses the get_stc() for some dialogs. | |
void | statusbar_clicked_right (const std::string &) override |
Do something when statusbar is (right) clicked. | |
auto & | file_history () |
Other methods. More... | |
auto * | get_debug () |
Debugging interface. | |
auto * | get_find_toolbar () |
Returns the find toolbar. | |
auto * | get_options_toolbar () |
Returns the options toolbar. | |
auto * | get_toolbar () |
Returns the toolbar. | |
bool | pane_add (const panes_t &panes, const std::string &perspective="managed frame") |
Add panes to the manager. More... | |
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 | show_ex_bar (int action=HIDE_BAR_FOCUS_STC, ex *ex=nullptr) |
Shows or hides the ex bar. More... | |
bool | show_ex_command (ex *ex, const std::string &label) |
Returns a command line ex command. More... | |
bool | show_ex_input (ex *ex, char command) |
Shows ex bar, and enters input mode. More... | |
void | show_ex_message (const std::string &text) |
Shows text in ex bar. | |
void | show_process (bool show) |
Shows or hide process pane. | |
const auto & | toggled_panes () const |
Returns the toggled panes. | |
![]() | |
frame (const data::window &data=data::window()) | |
Default constructor,. | |
virtual | ~frame () |
Destructor. | |
void | SetMenuBar (wxMenuBar *bar) override |
Override from base class. More... | |
bool | Show (bool show=true) override |
Shows or hides window. | |
virtual grid * | get_grid () |
Virtual interface. More... | |
virtual listview * | get_listview () |
Returns a listview. | |
virtual process * | get_process (const std::string &command) |
Allows you to e.g. More... | |
virtual 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 stc * | open_file (const path &filename, const vcs_entry &vcs, const data::stc &data=data::stc()) |
Allows you to open a filename with info from vcs. More... | |
virtual stc * | open_file (const path &filename, const std::string &text, const data::stc &data=data::stc()) |
Allows you to open a filename with specified contents. More... | |
virtual bool | output (const std::string &text) const |
Allows you to handle output text, .e.g. More... | |
virtual bool | statustext (const std::string &text, const std::string &pane) const |
Sets text on specified pane. More... | |
auto * | get_statusbar () |
Other methods. More... | |
std::string | get_statustext (const std::string &pane) const |
Returns text on specified pane. More... | |
bool | is_closing () const |
Are we closing? | |
void | set_find_focus (wxWindow *focus) |
Sets the find focus to specified window. | |
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 | update_statusbar (const wxListView *lv) |
Updates statusbar pane items pane with values from specified listview. | |
bool | update_statusbar (stc *stc, const std::string &pane) |
Updates the specified statusbar pane with values from specified stc. | |
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 |
|
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.
|
inline |
Other methods.
Returns file history.
|
virtual |
Called if the notebook changed page.
Default sets the focus to page and adds page as recently used.
bool wex::managed_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 |
bool wex::managed_frame::pane_maximize | ( | const std::string & | pane | ) |
Maximizes the managed pane.
Returns false if pane is not managed.
bool wex::managed_frame::pane_restore | ( | const std::string & | pane | ) |
Restores the managed pane.
Returns false if pane is not managed.
bool wex::managed_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::managed_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.
|
virtual |
Prints text in ex dialog.
ex | the ex for the dialog |
text | the text to be printed |
|
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).
void wex::managed_frame::show_ex_bar | ( | int | action = HIDE_BAR_FOCUS_STC , |
ex * | ex = nullptr |
||
) |
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 |
ex | component to use for showing ex bar (for SHOW_ actions) |
bool wex::managed_frame::show_ex_command | ( | ex * | ex, |
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.
ex | the ex on which command is to be done |
label | label for the ex bar (/, ?, :, =) |
bool wex::managed_frame::show_ex_input | ( | ex * | ex, |
char | command | ||
) |
Shows ex bar, and enters input mode.
Returns false if command is not supported.
ex | the ex on which command is to be done |
command | the command (a, c, or i) |
|
virtual |
Called after you checked the Sync checkbox on the options toolbar.
Default syncs current stc.
|
virtual |
Called after all pages from the notebooks are deleted.
Default resets the find focus.