contents up previous next

wxfilehistory

the wxfilehistory encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the file menu).

wxfilehistory can manage one or more file menus. more than one menu may be required in an mdi application, where the file history should appear on each mdi child menu as well as the mdi parent frame.

derived from

wxobject

include files

<wx/docview.h>

see also

wxfilehistory overview, wxdocmanager

members

wxfilehistory::m_filehistory
wxfilehistory::m_filehistoryn
wxfilehistory::m_filemaxfiles
wxfilehistory::m_filemenu
wxfilehistory::wxfilehistory
wxfilehistory::~wxfilehistory
wxfilehistory::addfiletohistory
wxfilehistory::addfilestomenu
wxfilehistory::getbaseid
wxfilehistory::getcount
wxfilehistory::gethistoryfile
wxfilehistory::getmaxfiles
wxfilehistory::getmenus
wxfilehistory::load
wxfilehistory::removefilefromhistory
wxfilehistory::removemenu
wxfilehistory::save
wxfilehistory::setbaseid
wxfilehistory::usemenu


wxfilehistory::m_filehistory

char** m_filehistory

a character array of strings corresponding to the most recently opened files.


wxfilehistory::m_filehistoryn

size_t m_filehistoryn

the number of files stored in the history array.


wxfilehistory::m_filemaxfiles

size_t m_filemaxfiles

the maximum number of files to be stored and displayed on the menu.


wxfilehistory::m_filemenu

wxmenu* m_filemenu

the file menu used to display the file history list (if enabled).


wxfilehistory::wxfilehistory

wxfilehistory(size_t maxfiles = 9, wxwindowid idbase = wxid_file1)

constructor. pass the maximum number of files that should be stored and displayed.

idbase defaults to wxid_file1 and represents the id given to the first history menu item. since menu items can't share the same id you should change idbase (to one of your own defined ids) when using more than one wxfilehistory in your application.


wxfilehistory::~wxfilehistory

~wxfilehistory()

destructor.


wxfilehistory::addfiletohistory

void addfiletohistory(const wxstring& filename)

adds a file to the file history list, if the object has a pointer to an appropriate file menu.


wxfilehistory::addfilestomenu

void addfilestomenu()

appends the files in the history list, to all menus managed by the file history object.

void addfilestomenu(wxmenu* menu)

appends the files in the history list, to the given menu only.


wxfilehistory::getbaseid

wxwindowid getbaseid() const

returns the base identifier for the range used for appending items.


wxfilehistory::getcount

size_t getcount() const

returns the number of files currently stored in the file history.


wxfilehistory::gethistoryfile

wxstring gethistoryfile(size_t index) const

returns the file at this index (zero-based).


wxfilehistory::getmaxfiles

int getmaxfiles() const

returns the maximum number of files that can be stored.


wxfilehistory::getmenus

const wxlist& getmenus() const

returns the list of menus that are managed by this file history object.

see also

wxfilehistory::usemenu


wxfilehistory::load

void load(wxconfigbase& config)

loads the file history from the given config object. this function should be called explicitly by the application.

see also

wxconfig


wxfilehistory::removefilefromhistory

void removefilefromhistory(size_t i)

removes the specified file from the history.


wxfilehistory::removemenu

void removemenu(wxmenu* menu)

removes this menu from the list of those managed by this object.


wxfilehistory::save

void save(wxconfigbase& config)

saves the file history into the given config object. this must be called explicitly by the application.

see also

wxconfig


wxfilehistory::setbaseid

void setbaseid(wxwindowid baseid)

sets the base identifier for the range used for appending items.


wxfilehistory::usemenu

void usemenu(wxmenu* menu)

adds this menu to the list of those menus that are managed by this file history object. also see addfilestomenu() for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.