[Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.2, 1.3

Adam Walker xenogeist at users.sourceforge.net
Thu Aug 14 18:37:22 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv7658/Outlook2000/dialogs

Modified Files:
	processors.py 
Log Message:
Added ImageProcessor class that loads images for picture boxes.

Index: processors.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** processors.py	10 Aug 2003 07:26:50 -0000	1.2
--- processors.py	15 Aug 2003 00:37:20 -0000	1.3
***************
*** 37,40 ****
--- 37,58 ----
          pass
  
+ class ImageProcessor(ControlProcessor):
+     def Init(self):
+         filename = ""
+         rcp = self.window.manager.dialog_parser;
+         text = win32gui.GetWindowText(self.GetControl())
+         name = rcp.names[int(text)]
+         filename = rcp.bitmaps[name]
+         import os
+         if not os.path.isabs(filename):
+             filename = os.path.join( os.path.dirname( __file__ ), "resources", filename)
+         handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0,
+                                     win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED)
+         win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle)
+         
+ 
+     def GetPopupHelpText(self, cid):
+         return None
+     
  class ButtonProcessor(ControlProcessor):
      def OnCommand(self, wparam, lparam):





More information about the Spambayes-checkins mailing list