[wxpython-users] ScrolledPanel scrolls without touching the ScrollBar
by Antoine De Groote other posts by this author
Jul 8 2008 10:40AM messages near this date
RE: [wxpython-users] Simple scope question
|
Re: [wxpython-users] ScrolledPanel scrolls without touching the ScrollBar
Hello,
I have a Notebook, which I put a NotebookPage into.
The notebook gets a scrolledpanel, which in turn gets a Panel. This last
Panel contains some widgets, mostly labels and textfields.
Now if I scroll this ScrolledPanel down an want to click a textfield (or
by clicking anywhere in the ScrolledPanel), the Scroll moves
automaticall to the top again. So I'm not able to put anything in that
textfield. If I scroll down again, and click the SAME textfield, it
works fine. Clicking another textfield however, results in the same
strange behaviour as described above.
Does anybody have an idea what this could come from?
Best regards,
antoine
Here's the relevant code of the notebookpage, just in case:
class page1(wx.NotebookPage):
def __init__(self, parent, id):
#wx.Panel.__init__(self, parent, -1)
wx.NotebookPage.__init__(self, parent, -1)
self.paths = []
#form panel
self.createcenterpanel()
mainsizer = wx.BoxSizer(wx.VERTICAL)
mainsizer.Add(self.spanel, 1, wx.EXPAND)
self.SetSizer(mainsizer)
self.SetAutoLayout(True)
def createcenterpanel(self):
sizer = wx.BoxSizer(wx.VERTICAL)
self.spanel = scroll.ScrolledPanel(self, -1)#,
style=wx.RAISED_BORDER)
formsizer = wx.BoxSizer(wx.VERTICAL)
formsizer1 = wx.FlexGridSizer(0, 4, vgap=2, hgap=10)
formpanel = wx.Panel(self.spanel, -1)
formpanel.SetSizer(formsizer)
formsizer.Add(formsizer1, 0, border=10)
gui_util.addcontrols1(formpanel, formsizer1)
sizer.Add(formpanel, 0, wx.EXPAND)
sizer.Add((58,0), 0)
self.spanel.SetSizer(sizer)
self.spanel.SetAutoLayout(1)
self.spanel.SetupScrolling()
the function gui_util.addcontrols1 is like this:
def addcontrols1(parent, sizer):
text = wx.StaticText(parent, 1, LA.CAT_TITLE_1)
text.SetForegroundColour('Blue')
sizer.Add(text, 0, flag=wx.ALIGN_LEFT|wx.ALL, border=5)
sizer.Add(wx.StaticText(parent, -1, LA.MARQ), 0,
flag=wx.ALIGN_LEFT|wx.ALIGN_BOTTOM|wx.LEFT, border=5)
sizer.Add(wx.ComboBox(parent, -1, '', choices=clist, size=(120,-1),
style=wx.CB_DROPDOWN|wx.CB_SORT, name='marq'), 0,
flag=wx.ALIGN_LEFT|wx.EXPAND|wx.LEFT, border=5)
[...]
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Antoine De Groote
Robin Dunn
Antoine De Groote
|