X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c5ae2d2a6f716e8a89b27579026b9d085f84191..070a4f2d3a2be8e5c8acf15f509a81d014d18703:/wxPython/demo/wxMimeTypesManager.py diff --git a/wxPython/demo/wxMimeTypesManager.py b/wxPython/demo/wxMimeTypesManager.py index 0ad99a74c3..5b0227ebf0 100644 --- a/wxPython/demo/wxMimeTypesManager.py +++ b/wxPython/demo/wxMimeTypesManager.py @@ -10,11 +10,11 @@ from Main import opj class MimeTypesTestPanel(wxPanel): def __init__(self, parent, id, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, + pos = wxDefaultPosition, size = wxDefaultSize, style = wxTAB_TRAVERSAL ): wxPanel.__init__(self, parent, id, pos, size, style) - MakeMimeTypesTestPanel( self, true ) + MakeMimeTypesTestPanel( self, True ) # WDR: handler declarations for MimeTypesTestPanel EVT_LISTBOX(self, ID_LISTBOX, self.OnListbox) @@ -34,8 +34,8 @@ class MimeTypesTestPanel(wxPanel): def OnListbox(self, event): mimetype = event.GetString() self.GetInputText().SetValue(mimetype) - self.GetMimeBtn().SetValue(TRUE) - self.GetExtensionBtn().SetValue(FALSE) + self.GetMimeBtn().SetValue(True) + self.GetExtensionBtn().SetValue(False) self.OnLookup() @@ -102,7 +102,7 @@ class MimeTypesTestPanel(wxPanel): # WDR: methods for MimeTypesTestPanel def GetListbox(self): - return wxPyTypeCast( self.FindWindowById(ID_LISTBOX), "wxListBox" ) + return self.FindWindowById(ID_LISTBOX) def GetIconIndexTxt(self): return self.FindWindowById(ID_ICON_INDEX_TXT) @@ -165,10 +165,19 @@ overview = """\ import mimetypes_wdr +import images def MyBitmapsFunc( index ): - return wxImage( opj("bitmaps/noicon.png"), wxBITMAP_TYPE_PNG ).ConvertToBitmap() + return images.getNoIconBitmap() mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc + + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])])