Exemplo n.º 1
0
 def testSizeWH(self):
     """SetSizeWH, GetSizeTuple"""
     for w,h in testSize.getSizes(self.testControl, wxtest.SIZE):
         self.testControl.SetSizeWH(w,h)
         # if a control has a min/max size, do not assert if attempts to
         # size the control outside those bounds do not work.
         if (w,h) >= self.testControl.GetMinSize() and (w,h) <= self.testControl.GetMaxSize():
             self.assertEquals((w,h), self.testControl.GetSizeTuple())
Exemplo n.º 2
0
 def testSize(self):
     """SetSize, GetSize"""
     for w,h in testSize.getSizes(self.testControl, wxtest.SIZE):
         size = wx.Size(w,h)
         self.testControl.SetSize(size)
         # if a control has a min/max size, do not assert if attempts to
         # size the control outside those bounds do not work.
         if size >= self.testControl.GetMinSize() and size <= self.testControl.GetMaxSize():
             self.assertEquals(size, self.testControl.GetSize())
Exemplo n.º 3
0
def getRectData(ctrl):
    sizes = testSize.getSizes(ctrl, wxtest.SIZE)
    top = 10
    left = 10
    # TODO: more variation in wx.Rects returned?
    if wxtest.PlatformIsMac():
        # wxMac is (top, left, bottom, right)
        # height = bottom - top; width = right - left
        rects = []
        for width, height in sizes:
            if top + height > 32767:
                height = height - top
            if left + width > 32767:
                width = width - left
            rects.append(wx.Rect(top, left, height, width))
        return rects
    else:
        # others are (top, left, width, height)
        return [wx.Rect(top, left, w, h) for w, h in sizes]
Exemplo n.º 4
0
def getRectData(ctrl):
    sizes = testSize.getSizes(ctrl, wxtest.SIZE)
    top  = 10
    left = 10
    # TODO: more variation in wx.Rects returned?
    if wxtest.PlatformIsMac():
        # wxMac is (top, left, bottom, right)
        # height = bottom - top; width = right - left
        rects = []
        for width,height in sizes:
            if top + height > 32767:
                height = height - top
            if left + width > 32767:
                width = width - left
            rects.append(wx.Rect(top, left, height, width))
        return rects
    else:
        # others are (top, left, width, height)
        return [ wx.Rect(top,left,w,h) for w,h in sizes ]
Exemplo n.º 5
0
 def testVirtualSizeWH(self):
     """SetVirtualSizeWH, GetVirtualSizeTuple"""
     for w,h in testSize.getSizes(self.testControl, wxtest.VIRTUAL_SIZE):
         self.testControl.SetVirtualSizeWH(w,h)
         self.assertEquals((w,h),self.testControl.GetVirtualSizeTuple())
Exemplo n.º 6
0
 def testVirtualSize(self):
     """SetVirtualSize, GetVirtualSize"""
     for x,y in testSize.getSizes(self.testControl, wxtest.VIRTUAL_SIZE):
         self.testControl.SetVirtualSize(wx.Size(x,y))
         self.assertEquals(wx.Size(x,y), self.testControl.GetVirtualSize())
Exemplo n.º 7
0
 def testMinSize(self):
     """SetMinSize, GetMinSize"""
     for min_size in testSize.getSizes(self.testControl, wxtest.SIZE):
         self.testControl.SetMinSize(min_size)
         self.assertEquals(min_size, self.testControl.GetMinSize())