[Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.8,1.9

Just van Rossum jvr@users.sourceforge.net
Fri, 02 Nov 2001 13:12:54 -0800


Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory usw-pr-cvs1:/tmp/cvs-serv7475

Modified Files:
	Wcontrols.py 
Log Message:
use proper APIs for activate/deactivate

Index: Wcontrols.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Wcontrols.py	2001/11/02 19:17:16	1.8
--- Wcontrols.py	2001/11/02 21:12:52	1.9
***************
*** 66,70 ****
  		self._activated = onoff
  		if self._enabled:
! 			self._control.HiliteControl((not onoff) and 255)
  	
  	def draw(self, visRgn = None):
--- 66,73 ----
  		self._activated = onoff
  		if self._enabled:
! 			if onoff:
! 				self._control.ActivateControl()
! 			else:
! 				self._control.DeactivateControl()
  	
  	def draw(self, visRgn = None):
***************
*** 106,110 ****
  			return
  		import time
! 		self._control.HiliteControl(1)
  		time.sleep(0.1)
  		self._control.HiliteControl(0)
--- 109,113 ----
  			return
  		import time
! 		self._control.HiliteControl(Controls.kControlButtonPart)
  		time.sleep(0.1)
  		self._control.HiliteControl(0)
***************
*** 117,125 ****
  			self._enabled = onoff
  	
- 	def activate(self, onoff):
- 		self._activated = onoff
- 		if self._enabled:
- 			self._control.HiliteControl((not onoff) and 255)
- 	
  	def show(self, onoff):
  		ControlWidget.show(self, onoff)
--- 120,123 ----
***************
*** 333,346 ****
  			self.GetWindow().ValidWindowRect(self._bounds)
  	
- 	def activate(self, onoff):
- 		self._activated = onoff
- 		if self._visible:
- 			if onoff:
- 				self._control.ShowControl()
- 			else:
- 				self._control.HideControl()
- 				self.draw(None)
- 				self.GetWindow().ValidWindowRect(self._bounds)
- 		
  	def set(self, value):
  		if self._control:
--- 331,334 ----