Esempio n. 1
0
 def testRect(self):
     """SetRect, GetRect"""
     for rect in testRect.getRectData(self.testControl):
         self.testControl.SetRect(rect)
         # if a control has a min/max size, do not assert if attempts to
         # size the control outside those bounds do not work.
         size = rect.GetSize()
         if size >= self.testControl.GetMinSize() and size <= self.testControl.GetMaxSize():
             self.assertEquals(rect, self.testControl.GetRect())
Esempio n. 2
0
 def testClientRect(self):
     """SetClientRect, GetClientRect"""
     # Robin says:
     # "Both GetClientAreaOrigin and GetClientSize will call platform specific
     # methods located in the derived classes, so they can (and do) vary across
     # platforms and window types.  IMO because of this potential variability
     # the only valid test for GetClientRect is that it returns a rectangle
     # positioned at GetClientAreaOrigin and with a size of GetClientSize."
     for rect in testRect.getRectData(self.testControl):
         self.testControl.SetClientRect(rect)
         r = self.testControl.GetClientRect()
         self.assertEquals(r.GetTopLeft(), self.testControl.GetClientAreaOrigin())
         self.assertEquals(r.GetSize(), self.testControl.GetClientSize())