+void wxFileHistory::RemoveFileFromHistory(int i)
+{
+ wxCHECK_RET( i < m_fileHistoryN,
+ wxT("invalid index in wxFileHistory::RemoveFileFromHistory") );
+
+ wxNode* node = m_fileMenus.First();
+ while ( node )
+ {
+ wxMenu* menu = (wxMenu*) node->Data();
+
+ // wxMenu::Delete() is missing from wxGTK, so this can't be done :-(
+#if 0
+ // delete the menu items
+ menu->Delete(wxID_FILE1 + i);
+#endif
+
+ // delete the element from the array (could use memmove() too...)
+ delete [] m_fileHistory[i];
+
+ int j;
+ for ( j = i; j < m_fileHistoryN - 1; j++ )
+ {
+ m_fileHistory[j] = m_fileHistory[j + 1];
+ }
+
+ // shuffle filenames up
+ wxString buf;
+ for ( j = i; j < m_fileHistoryN - 1; j++ )
+ {
+ buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]);
+ menu->SetLabel(wxID_FILE1 + j, buf);
+ }
+
+ // to be removed as soon as wxMenu::Delete() is implemented
+#if 1
+ menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, wxT(""));
+#endif
+
+ node = node->Next();
+ }
+ m_fileHistoryN--;
+}
+