mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
* Changed imports to use either absolute or explicit relative imports. Implicit relative imports are no longer allowed. * Changes to accomodate standard library classes or modues moving to other locations, or being removed entirely. * Changes related to print becoming a function, execfile being removed, u'' no longer allowed, and other syntax related issues. * Working around C APIs that have changed or simply vanished. (PyInt, PyString, PyBytes, etc.) * Dealing with text file objects using strings vs binary file objects using bytes, auto-encoding, and etc. * Replacing the use of PyCObject with PyCapsule and dealing with an apparent bug where PyCapsule objects can't be imported from submodules within a package. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
97 lines
2.3 KiB
Python
97 lines
2.3 KiB
Python
import imp_unittest, unittest
|
|
import wtc
|
|
import wx
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class WindowTests(wtc.WidgetTestCase):
|
|
|
|
def test_SimpleWindowCtor(self):
|
|
w = wx.Window(self.frame, -1, (10,10), (50,50),
|
|
wx.BORDER_SIMPLE|wx.VSCROLL)
|
|
self.assertTrue(w.GetWindowStyle() == wx.BORDER_SIMPLE|wx.VSCROLL)
|
|
self.assertTrue(w.Parent is self.frame)
|
|
|
|
def test_windowHandle(self):
|
|
w = wx.Window(self.frame, -1, (10,10), (50,50))
|
|
hdl = w.GetHandle()
|
|
if wtc.isPython3():
|
|
base = int
|
|
else:
|
|
base = (int, long)
|
|
self.assertTrue(isinstance(hdl, base))
|
|
|
|
|
|
def test_windowProperties(self):
|
|
w = wx.Window(self.frame, -1, (10,10), (50,50))
|
|
# Just test that these properties exist for now. More tests can be
|
|
# added later to ensure that they work correctly.
|
|
w.AcceleratorTable
|
|
w.AutoLayout
|
|
w.BackgroundColour
|
|
w.BackgroundStyle
|
|
w.EffectiveMinSize
|
|
w.BestSize
|
|
w.BestVirtualSize
|
|
w.Border
|
|
w.Caret
|
|
w.CharHeight
|
|
w.CharWidth
|
|
w.Children
|
|
w.ClientAreaOrigin
|
|
w.ClientRect
|
|
w.ClientSize
|
|
w.Constraints
|
|
w.ContainingSizer
|
|
w.Cursor
|
|
w.DefaultAttributes
|
|
w.DropTarget
|
|
w.EventHandler
|
|
w.ExtraStyle
|
|
w.Font
|
|
w.ForegroundColour
|
|
w.GrandParent
|
|
w.TopLevelParent
|
|
w.Handle
|
|
w.HelpText
|
|
w.Id
|
|
w.Label
|
|
w.LayoutDirection
|
|
w.MaxHeight
|
|
w.MaxSize
|
|
w.MaxWidth
|
|
w.MinHeight
|
|
w.MinSize
|
|
w.MinWidth
|
|
w.Name
|
|
w.Parent
|
|
w.Position
|
|
w.Rect
|
|
w.ScreenPosition
|
|
w.ScreenRect
|
|
w.Size
|
|
w.Sizer
|
|
w.ThemeEnabled
|
|
w.ToolTip
|
|
w.UpdateClientRect
|
|
w.UpdateRegion
|
|
w.Validator
|
|
w.VirtualSize
|
|
w.WindowStyle
|
|
w.WindowStyleFlag
|
|
w.WindowVariant
|
|
w.Shown
|
|
w.Enabled
|
|
w.TopLevel
|
|
w.MinClientSize
|
|
w.MaxClientSize
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|