/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/resource.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/resource.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 648 by jonathan, Fri Apr 11 14:26:54 2003 UTC revision 1303 by jonathan, Wed Jun 25 09:39:51 2003 UTC
# Line 8  Line 8 
8  import os  import os
9  import Thuban  import Thuban
10    
11  from wxPython.wx import wxBITMAP_TYPE_XPM, wxBitmap  from wxPython.wx import wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_ANY, wxBitmap, wxImage
12    
13    
14  bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")  bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")
15  EXT_XPM  = ".xpm"  bitmap_extensions = {wxBITMAP_TYPE_XPM: ".xpm",
16  EXT_NONE = ""                       wxBITMAP_TYPE_ANY: ""}
17                        
   
18  def GetBitmapResource(file, type):  def GetBitmapResource(file, type):
19      if type == wxBITMAP_TYPE_XPM:      filename = os.path.join(bitmapdir, file) + bitmap_extensions[type]
         ext = EXT_XPM  
     else:  
         ext = EXT_NONE  
   
     filename = os.path.join(bitmapdir, file) + ext  
20      return wxBitmap(filename, type)      return wxBitmap(filename, type)
21    
22    def GetImageResource(file, type):
23        filename = os.path.join(bitmapdir, file) + bitmap_extensions[type]
24        return wxImage(filename, type)
25    

Legend:
Removed from v.648  
changed lines
  Added in v.1303

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26