2 from wxPython
.wx
import *
3 from wxPython
.xrc
import *
5 #----------------------------------------------------------------------
7 RESFILE
= "data/resource_wdr.xrc"
9 class TestPanel(wxPanel
):
10 def __init__(self
, parent
, log
):
11 wxPanel
.__init
__(self
, parent
, -1)
15 label
= wxStaticText(self
, -1, "The lower panel was built from this XML:")
16 label
.SetFont(wxFont(12, wxSWISS
, wxNORMAL
, wxBOLD
))
18 text
= wxTextCtrl(self
, -1, open(RESFILE
).read(),
19 style
=wxTE_READONLY|wxTE_MULTILINE
)
20 text
.SetInsertionPoint(0)
22 line
= wxStaticLine(self
, -1)
24 res
= wxXmlResource(RESFILE
)
25 panel
= res
.LoadPanel(self
, "MyPanel")
28 sizer
= wxBoxSizer(wxVERTICAL
)
29 sizer
.Add(label
, 0, wxEXPAND|wxTOP|wxLEFT
, 5)
30 sizer
.Add(text
, 1, wxEXPAND|wxALL
, 5)
31 sizer
.Add(line
, 0, wxEXPAND
)
32 sizer
.Add(panel
, 1, wxEXPAND|wxALL
, 5)
35 self
.SetAutoLayout(true
)
38 #----------------------------------------------------------------------
40 def runTest(frame
, nb
, log
):
41 win
= TestPanel(nb
, log
)
44 #----------------------------------------------------------------------