wex  v21.04.0
Public Member Functions | List of all members
wex::frame Class Reference

Offers a frame with easy statusbar methods, find/replace, and allows for file dropping. More...

#include <wex/frame.h>

Inheritance diagram for wex::frame:
Inheritance graph
[legend]

Public Member Functions

 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 gridget_grid ()
 Virtual interface. More...
 
virtual listviewget_listview ()
 Returns a listview.
 
virtual processget_process (const std::string &command)
 Allows you to e.g. More...
 
virtual stcget_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 stcopen_file (const path &filename, const data::stc &data=data::stc())
 Default opens the file using get_stc. More...
 
virtual stcopen_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 stcopen_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 void set_recent_file (const path &path)
 Allows derived class to update file history.
 
virtual void statusbar_clicked (const std::string &pane)
 When (left) clicked, uses the get_stc() for some dialogs.
 
virtual void statusbar_clicked_right (const std::string &)
 Do something when statusbar is (right) clicked.
 
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.
 
statusbarsetup_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.
 

Detailed Description

Offers a frame with easy statusbar methods, find/replace, and allows for file dropping.

Also helps in maintaining access to the base controls (grid, listview and stc).

Member Function Documentation

◆ get_grid()

virtual grid* wex::frame::get_grid ( )
virtual

Virtual interface.

Returns a grid.

◆ get_process()

virtual process* wex::frame::get_process ( const std::string &  command)
inlinevirtual

Allows you to e.g.

add debugging. Default returns nullptr.

◆ get_statusbar()

auto* wex::frame::get_statusbar ( )
inline

Other methods.

Returns statusbar.

◆ get_statustext()

std::string wex::frame::get_statustext ( const std::string &  pane) const

Returns text on specified pane.

Don't forget to call setup_statusbar first.

◆ open_file() [1/3]

virtual stc* wex::frame::open_file ( const path filename,
const data::stc data = data::stc() 
)
virtual

Default opens the file using get_stc.

Returns stc component opened, or nullptr.

Reimplemented in wex::managed_frame.

◆ open_file() [2/3]

virtual stc* wex::frame::open_file ( const path filename,
const std::string &  text,
const data::stc data = data::stc() 
)
virtual

Allows you to open a filename with specified contents.

Returns stc component opened, or nullptr.

◆ open_file() [3/3]

virtual stc* wex::frame::open_file ( const path filename,
const vcs_entry vcs,
const data::stc data = data::stc() 
)
virtual

Allows you to open a filename with info from vcs.

Returns stc component opened, or nullptr.

◆ output()

virtual bool wex::frame::output ( const std::string &  text) const
inlinevirtual

Allows you to handle output text, .e.g.

from a process. Default no action is taken, and false is returned, and some methods default send output to stdout.

◆ SetMenuBar()

void wex::frame::SetMenuBar ( wxMenuBar *  bar)
override

Override from base class.

Sets menubar.

◆ setup_statusbar()

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 intializes other static data.

◆ statustext()

virtual bool wex::frame::statustext ( const std::string &  text,
const std::string &  pane 
) const
virtual

Sets text on specified pane.

Don't forget to call setup_statusbar first.