2 from wxPython
.wx
import *
3 from wxPython
.xrc
import *
6 #----------------------------------------------------------------------
8 RESFILE
= opj("data/resource_wdr.xrc")
10 class TestPanel(wxPanel
):
11 def __init__(self
, parent
, log
):
12 wxPanel
.__init
__(self
, parent
, -1)
16 label
= wxStaticText(self
, -1, "The lower panel was built from this XML:")
17 label
.SetFont(wxFont(12, wxSWISS
, wxNORMAL
, wxBOLD
))
19 text
= wxTextCtrl(self
, -1, open(RESFILE
).read(),
20 style
=wxTE_READONLY|wxTE_MULTILINE
)
21 text
.SetInsertionPoint(0)
23 line
= wxStaticLine(self
, -1)
25 res
= wxXmlResource(RESFILE
)
26 panel
= res
.LoadPanel(self
, "MyPanel")
29 sizer
= wxBoxSizer(wxVERTICAL
)
30 sizer
.Add(label
, 0, wxEXPAND|wxTOP|wxLEFT
, 5)
31 sizer
.Add(text
, 1, wxEXPAND|wxALL
, 5)
32 sizer
.Add(line
, 0, wxEXPAND
)
33 sizer
.Add(panel
, 1, wxEXPAND|wxALL
, 5)
36 self
.SetAutoLayout(true
)
39 #----------------------------------------------------------------------
41 def runTest(frame
, nb
, log
):
42 win
= TestPanel(nb
, log
)
45 #----------------------------------------------------------------------