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

Just van Rossum jvr@users.sourceforge.net
2001年11月02日 14:51:46 -0800


Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory usw-pr-cvs1:/tmp/cvs-serv1074
Modified Files:
	Wcontrols.py 
Log Message:
use 32bit APIs for control values, refactor slightly
Index: Wcontrols.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Wcontrols.py	2001年11月02日 21:12:52	1.9
--- Wcontrols.py	2001年11月02日 22:51:42	1.10
***************
*** 95,99 ****
--- 95,112 ----
 	def gettitle(self):
 		return self._title
+ 	
+ 	def set(self, value):
+ 		if self._control:
+ 			self._control.SetControl32BitValue(value)
+ 		else:
+ 			self._value = value
+ 	
+ 	def get(self):
+ 		if self._control:
+ 			return self._control.GetControl32BitValue()
+ 		else:
+ 			return self._value
 
+ 
 class Button(ControlWidget):
 	
***************
*** 166,182 ****
 	def toggle(self):
 		self.set(not self.get())
! 	
! 	def set(self, value):
! 		if self._control:
! 			self._control.SetControlValue(value)
! 		else:
! 			self._value = value
! 	
! 	def get(self):
! 		if self._control:
! 			return self._control.GetControlValue()
! 		else:
! 			return self._value
! 	
 
 class RadioButton(ControlWidget):
--- 179,183 ----
 	def toggle(self):
 		self.set(not self.get())
! 
 
 class RadioButton(ControlWidget):
***************
*** 218,228 ****
 			else:
 				button._value = (button == self)
! 	
! 	def get(self):
! 		if self._control:
! 			return self._control.GetControlValue()
! 		else:
! 			return self._value
! 	
 
 class Scrollbar(ControlWidget):
--- 219,223 ----
 			else:
 				button._value = (button == self)
! 
 
 class Scrollbar(ControlWidget):
***************
*** 235,241 ****
 	
 	# interface
! 	def set(self, value):
! 		if self._callback:
! 			Wbase.CallbackCall(self._callback, 1, value)
 	
 	def up(self):
--- 230,236 ----
 	
 	# interface
! #	def set(self, value):
! #		if self._callback:
! #			Wbase.CallbackCall(self._callback, 1, value)
 	
 	def up(self):
***************
*** 256,269 ****
 	
 	def setmin(self, min):
! 		self._control.SetControlMinimum(min)
 	
! 	def setmax(self, min):
! 		self._control.SetControlMinimum(max)
 	
 	def getmin(self):
! 		return self._control.GetControlMinimum()
 	
 	def getmax(self):
! 		return self._control.GetControlMinimum()
 	
 	# internals
--- 251,267 ----
 	
 	def setmin(self, min):
! 		self._control.SetControl32BitMinimum(min)
 	
! 	def setmax(self, max):
! 		self._control.SetControl32BitMaximum(max)
 	
+ 	def setviewsize(self, view):
+ 		self._control.SetControlViewSize(view)
+ 	
 	def getmin(self):
! 		return self._control.GetControl32BitMinimum()
 	
 	def getmax(self):
! 		return self._control.GetControl32BitMaximum()
 	
 	# internals
***************
*** 300,304 ****
 	def _hit(self, part):
 		if part == Controls.inThumb:
! 			value = self._control.GetControlValue()
 		elif part == Controls.inUpButton:
 			value = "+"
--- 298,302 ----
 	def _hit(self, part):
 		if part == Controls.inThumb:
! 			value = self._control.GetControl32BitValue()
 		elif part == Controls.inUpButton:
 			value = "+"
***************
*** 330,346 ****
 				Qd.FrameRect(self._bounds)
 			self.GetWindow().ValidWindowRect(self._bounds)
! 	
! 	def set(self, value):
! 		if self._control:
! 			self._control.SetControlValue(value)
! 		else:
! 			self._value = value
! 	
! 	def get(self):
! 		if self._control:
! 			return self._control.GetControlValue()
! 		else:
! 			return self._value
! 	
 
 def _scalebarvalue(absmin, absmax, curmin, curmax):
--- 328,332 ----
 				Qd.FrameRect(self._bounds)
 			self.GetWindow().ValidWindowRect(self._bounds)
! 
 
 def _scalebarvalue(absmin, absmax, curmin, curmax):

AltStyle によって変換されたページ (->オリジナル) /