]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxFileHistory}}\label{wxfilehistory} |
2 | ||
3 | The wxFileHistory encapsulates a user interface convenience, the | |
4 | list of most recently visited files as shown on a menu (usually the File menu). | |
5 | ||
7f555861 JS |
6 | wxFileHistory can manage one or more file menus. More than one menu may be required |
7 | in an MDI application, where the file history should appear on each MDI child menu | |
8 | as well as the MDI parent frame. | |
9 | ||
a660d684 KB |
10 | \wxheading{Derived from} |
11 | ||
12 | \helpref{wxObject}{wxobject} | |
13 | ||
954b8ae6 JS |
14 | \wxheading{Include files} |
15 | ||
16 | <wx/docview.h> | |
17 | ||
a660d684 KB |
18 | \wxheading{See also} |
19 | ||
7f555861 | 20 | \helpref{wxFileHistory overview}{wxfilehistoryoverview}, \helpref{wxDocManager}{wxdocmanager} |
a660d684 KB |
21 | |
22 | \latexignore{\rtfignore{\wxheading{Members}}} | |
23 | ||
24 | \membersection{wxFileHistory::m\_fileHistory} | |
25 | ||
26 | \member{char**}{m\_fileHistory} | |
27 | ||
28 | A character array of strings corresponding to the most recently opened | |
29 | files. | |
30 | ||
31 | \membersection{wxFileHistory::m\_fileHistoryN} | |
32 | ||
e49c85af | 33 | \member{size_t}{m\_fileHistoryN} |
a660d684 KB |
34 | |
35 | The number of files stored in the history array. | |
36 | ||
37 | \membersection{wxFileHistory::m\_fileMaxFiles} | |
38 | ||
e49c85af | 39 | \member{size_t}{m\_fileMaxFiles} |
a660d684 KB |
40 | |
41 | The maximum number of files to be stored and displayed on the menu. | |
42 | ||
43 | \membersection{wxFileHistory::m\_fileMenu} | |
44 | ||
45 | \member{wxMenu*}{m\_fileMenu} | |
46 | ||
47 | The file menu used to display the file history list (if enabled). | |
48 | ||
49 | \membersection{wxFileHistory::wxFileHistory} | |
50 | ||
e49c85af | 51 | \func{}{wxFileHistory}{\param{size_t}{ maxFiles = 9}, \param{wxWindowID}{ idBase = wxID_FILE1}} |
a660d684 KB |
52 | |
53 | Constructor. Pass the maximum number of files that should be stored and displayed. | |
54 | ||
e49c85af VZ |
55 | idBase defaults to wxID_FILE1 and represents the id given to the first history menu item. |
56 | Since menu items can't share the same ID you should change idBase (To one of your own | |
57 | defined IDs) when using more than one wxFileHistory in your application. | |
58 | ||
59 | ||
a660d684 KB |
60 | \membersection{wxFileHistory::\destruct{wxFileHistory}} |
61 | ||
62 | \func{}{\destruct{wxFileHistory}}{\void} | |
63 | ||
64 | Destructor. | |
65 | ||
66 | \membersection{wxFileHistory::AddFileToHistory} | |
67 | ||
68 | \func{void}{AddFileToHistory}{\param{const wxString\& }{filename}} | |
69 | ||
70 | Adds a file to the file history list, if the object has a pointer to an appropriate file menu. | |
71 | ||
7f555861 | 72 | \membersection{wxFileHistory::AddFilesToMenu}\label{wxfilehistoryaddfilestomenu} |
a660d684 | 73 | |
7f555861 | 74 | \func{void}{AddFilesToMenu}{\void} |
a660d684 | 75 | |
7f555861 | 76 | Appends the files in the history list, to all menus managed by the file history object. |
a660d684 | 77 | |
7f555861 | 78 | \func{void}{AddFilesToMenu}{\param{wxMenu*}{ menu}} |
a660d684 | 79 | |
7f555861 | 80 | Appends the files in the history list, to the given menu only. |
a660d684 | 81 | |
7f555861 | 82 | \membersection{wxFileHistory::GetHistoryFile}\label{wxfilehistorygethistoryfile} |
a660d684 | 83 | |
e49c85af | 84 | \constfunc{wxString}{GetHistoryFile}{\param{size_t}{ index}} |
a660d684 | 85 | |
7f555861 | 86 | Returns the file at this index (zero-based). |
a660d684 KB |
87 | |
88 | \membersection{wxFileHistory::GetMaxFiles} | |
89 | ||
e49c85af | 90 | \constfunc{size_t}{GetMaxFiles}{\void} |
a660d684 KB |
91 | |
92 | Returns the maximum number of files that can be stored. | |
93 | ||
94 | \membersection{wxFileHistory::GetNoHistoryFiles} | |
95 | ||
e49c85af | 96 | \constfunc{size_t}{GetNoHistoryFiles}{\void} |
a660d684 KB |
97 | |
98 | Returns the number of files currently stored in the file history. | |
99 | ||
7f555861 JS |
100 | \membersection{wxFileHistory::Load} |
101 | ||
102 | \func{void}{Load}{\param{wxConfigBase\& }{config}} | |
103 | ||
104 | Loads the file history from the given config object. This function should be called explicitly by the application. | |
105 | ||
106 | \wxheading{See also} | |
107 | ||
108 | \helpref{wxConfig}{wxconfigbase} | |
109 | ||
110 | \membersection{wxFileHistory::RemoveMenu} | |
111 | ||
112 | \func{void}{RemoveMenu}{\param{wxMenu* }{menu}} | |
113 | ||
114 | Removes this menu from the list of those managed by this object. | |
115 | ||
116 | \membersection{wxFileHistory::Save} | |
117 | ||
118 | \func{void}{Save}{\param{wxConfigBase\& }{config}} | |
119 | ||
120 | Saves the file history into the given config object. This must be called | |
121 | explicitly by the application. | |
122 | ||
123 | \wxheading{See also} | |
124 | ||
125 | \helpref{wxConfig}{wxconfigbase} | |
126 | ||
127 | \membersection{wxFileHistory::UseMenu} | |
128 | ||
129 | \func{void}{UseMenu}{\param{wxMenu* }{menu}} | |
130 | ||
131 | Adds this menu to the list of those managed by this object. | |
132 | ||
a660d684 | 133 |