box = wxBoxSizer(wxVERTICAL)
# Make and layout the controls
- bf = wxFont(14, wxSWISS, wxNORMAL, wxBOLD)
- nf = wxFont(11, wxSWISS, wxNORMAL, wxNORMAL)
+ fs = self.GetFont().GetPointSize()
+ bf = wxFont(fs+4, wxSWISS, wxNORMAL, wxBOLD)
+ nf = wxFont(fs+2, wxSWISS, wxNORMAL, wxNORMAL)
t = wxStaticText(self, -1, "wxFileHistory")
t.SetFont(bf)
EVT_RIGHT_UP(self, self.OnRightClick)
EVT_MENU(self, wxID_OPEN, self.OnFileOpenDialog)
EVT_MENU_RANGE(self, wxID_FILE1, wxID_FILE9, self.OnFileHistory)
+ EVT_WINDOW_DESTROY(self, self.Cleanup)
-
- def __del__(self):
+ def Cleanup(self, *args):
del self.filehistory
self.menu.Destroy()
def OnFileOpenDialog(self, evt):
dlg = wxFileDialog(self,
defaultDir = os.getcwd(),
+ wildcard = "All Files|*",
style = wxOPEN | wxCHANGE_DIR)
if dlg.ShowModal() == wxID_OK:
path = dlg.GetPath()
</body></html>
"""
+
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])
+