Jump to content

sepheri0n

Banned
  • Posts

    3
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by sepheri0n

  1. 1 hour ago, .ZeNu said:
    
    class ImageBox(Window):
    	def __init__(self, layer = "UI"):
    		Window.__init__(self, layer)
    
    		self.eventDict={}	
    		self.eventFunc = {
    			"MOUSE_LEFT_BUTTON_UP" : None, 
    			"MOUSE_LEFT_BUTTON_DOWN" : None, 
    			"MOUSE_RIGHT_BUTTON_UP" : None, 
    			"MOUSE_RIGHT_BUTTON_DOWN" : None, 
    			"MOUSE_OVER_IN" : None, 
    			"MOUSE_OVER_OUT" : None
    		}
    		self.eventArgs = {
    			"MOUSE_LEFT_BUTTON_UP" : None, 
    			"MOUSE_LEFT_BUTTON_DOWN" : None, 
    			"MOUSE_RIGHT_BUTTON_UP" : None, 
    			"MOUSE_RIGHT_BUTTON_DOWN" : None, 
    			"MOUSE_OVER_IN" : None, 
    			"MOUSE_OVER_OUT" : None
    		}
    
    	def __del__(self):
    		Window.__del__(self)	
    		self.eventFunc = None
    		self.eventArgs = None
    
    	def RegisterWindow(self, layer):
    		self.hWnd = wndMgr.RegisterImageBox(self, layer)
    
    	def LoadImage(self, imageName):
    		self.name=imageName
    		wndMgr.LoadImage(self.hWnd, imageName)
    
    	def GetImageName(self):
    		return self.name
    		
    	def SetAlpha(self, alpha):
    		wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha)
    		
    	def SetColor(self, r, g, b, a):
    		wndMgr.SetDiffuseColor(self.hWnd, r, g, b, a)
    
    	def GetWidth(self):
    		return wndMgr.GetWidth(self.hWnd)
    
    	def GetHeight(self):
    		return wndMgr.GetHeight(self.hWnd)
    
    	def SetEvent(self, func, *args) :
    		result = self.eventFunc.has_key(args[0])		
    		if result :
    			self.eventFunc[args[0]] = func
    			self.eventArgs[args[0]] = args
    		else :
    			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
    			
    	def SAFE_SetEvent(self, func, *args):
    		result = self.eventFunc.has_key(args[0])		
    		if result :
    			self.eventFunc[args[0]] = __mem_func__(func)
    			self.eventArgs[args[0]] = args
    		else :
    			print "[ERROR] ui.py SAFE_SetEvent, Can`t Find has_key : %s" % args[0]
    
    	def OnMouseLeftButtonUp(self):
    		if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] :
    			apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"])
    			
    	def OnMouseLeftButtonDown(self):
    		if self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"] :
    			apply(self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"], self.eventArgs["MOUSE_LEFT_BUTTON_DOWN"])
    
    	def OnMouseRightButtonUp(self):
    		if self.eventFunc["MOUSE_RIGHT_BUTTON_UP"] :
    			apply(self.eventFunc["MOUSE_RIGHT_BUTTON_UP"], self.eventArgs["MOUSE_RIGHT_BUTTON_UP"])
    			
    	def OnMouseRightButtonDown(self):
    		if self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"] :
    			apply(self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"], self.eventArgs["MOUSE_RIGHT_BUTTON_DOWN"])
    			
    	def OnMouseOverIn(self) :
    		if self.eventFunc["MOUSE_OVER_IN"] :
    			apply(self.eventFunc["MOUSE_OVER_IN"], self.eventArgs["MOUSE_OVER_IN"])
    
    	def OnMouseOverOut(self) :
    		if self.eventFunc["MOUSE_OVER_OUT"] :
    			apply(self.eventFunc["MOUSE_OVER_OUT"], self.eventArgs["MOUSE_OVER_OUT"])
    			
    	def SAFE_SetStringEvent(self, event, func,isa=False):
    		if not isa:
    			self.eventDict[event]=__mem_func__(func)
    		else:
    			self.eventDict[event]=func
    			
    	def LeftRightReverse(self):
    		wndMgr.LeftRightReverseImageBox(self.hWnd)
    	
    	def SetCoolTime(self, time):
    		wndMgr.SetCoolTimeImageBox(self.hWnd, time)
    
    	def SetStartCoolTime(self, time):
    		wndMgr.SetStartCoolTimeImageBox(self.hWnd, time)

     

    same error line 822 in uimessenger.py  attribute error 

    'OnlinePopup' object has no attribute 'SetEvent'
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.