wex
v20.04.0
|
Offers file history methods. More...
#include <wex/filehistory.h>
Public Member Functions | |
file_history (size_t maxFiles=9, wxWindowID idBase=wxID_FILE1, const std::string &key=std::string()) | |
Default constructor. More... | |
~file_history () | |
Destructor. | |
void | append (const path &p) |
Appends a file to the file history list. | |
void | clear () |
Clears history. | |
wxWindowID | get_base_id () const |
Returns baseid. | |
path | get_history_file (size_t index=0) const |
Returns the file at this index (zero-based). | |
std::vector< path > | get_history_files (size_t max) const |
Returns a vector of max recent opened files. | |
int | get_max_files () const |
Returns max files. | |
void | popup_menu (wxWindow *win, int clear_id=-1, const wxPoint &pos=wxDefaultPosition) const |
Shows popup menu containing all recent opened files. More... | |
void | save () |
Saves the file history into the config. | |
size_t | size () const |
Returns number of items. | |
void | use_menu (wxWindowID id, wex::menu *menu) |
Adds a recent file submenu to specified menu, and sets the file history to use it. | |
Offers file history methods.
wex::file_history::file_history | ( | size_t | maxFiles = 9 , |
wxWindowID | idBase = wxID_FILE1 , |
||
const std::string & | key = std::string() |
||
) |
Default constructor.
Fills the file history with items available from the connfig.
maxFiles | number of files to use |
idBase | base for menu id |
key | if key is empty string, files are loaded / saved to default keys, otherwise to specified key. |
void wex::file_history::popup_menu | ( | wxWindow * | win, |
int | clear_id = -1 , |
||
const wxPoint & | pos = wxDefaultPosition |
||
) | const |
Shows popup menu containing all recent opened files.
win | window which will get the popup menu |
clear_id | adds a clear menu items as well (if not -1) |
pos | position for popup menu |