wx.FileDropTarget doesn't like wx.StaticBoxSizer?

In the following tiny program you can drop files into the TextCtrl.
If you set the variable problem=True you can not drop files into the TextCtrl.

What's wrong with FileDropTargets inside StaticBoxSizers?

I'm using python2.3.5, wxpython2.6.1.0-unicode on WinXPpro-SP2.

Thanks for any help!
Jens

import wx

···

#----------------------------------------------------------------------------

class OnAddFileFromDrop(wx.FileDropTarget):
    def __init__(self, parent):
        wx.FileDropTarget.__init__(self)
        self.parent = parent
        parent.SetDropTarget(self)

    def OnDropFiles(self, x, y, filenames):
        result = self.parent.SetValue(filenames[0])

#----------------------------------------------------------------------------

class MyApp(wx.App):
       def OnInit(self):
        wx.InitAllImageHandlers()
        frame = wx.Frame( None, -1, "Drop File In TextCtrl")
        #--------------------------------------------
        problem = False
        if problem:
            sb = wx.StaticBox( frame, -1, "Text" )
            sizer = wx.StaticBoxSizer( sb, wx.HORIZONTAL )
        else:
            sizer = wx.BoxSizer( wx.HORIZONTAL )
        #--------------------------------------------
        textCtrl = wx.TextCtrl( frame, -1, "", wx.DefaultPosition, [300,-1], 0 )
        sizer.Add( textCtrl, 1, wx.ALIGN_CENTER|wx.ALL, 5 )
        frame.SetSizer( sizer )
        sizer.SetSizeHints( frame )
        OnAddFileFromDrop(textCtrl)
        frame.Show(True)
        return True

#----------------------------------------------------------------------------

app = MyApp(False)
app.MainLoop()

See this thread, maybe it's related to:
http://thread.gmane.org/gmane.comp.python.wxpython/24356

Ricardo

···

On Wed, 2005-08-24 at 19:50 +0200, Helmers, Jens Bloch wrote:

In the following tiny program you can drop files into the TextCtrl.
If you set the variable problem=True you can not drop files into the
TextCtrl.

What's wrong with FileDropTargets inside StaticBoxSizers?

I'm using python2.3.5, wxpython2.6.1.0-unicode on WinXPpro-SP2.

Without any change of result I tried:

        problem = True
        if problem:
            wx.SystemOptions.SetOptionInt("msw.staticbox.optimized-paint", 0)
            sb = wx.StaticBox( frame, -1, "Text" )
            sizer = wx.StaticBoxSizer( sb, wx.HORIZONTAL )
        else:
            sizer = wx.BoxSizer( wx.HORIZONTAL )

Jens

Ricardo Pedroso wrote:

···

On Wed, 2005-08-24 at 19:50 +0200, Helmers, Jens Bloch wrote:

In the following tiny program you can drop files into the TextCtrl.
If you set the variable problem=True you can not drop files into the TextCtrl.

What's wrong with FileDropTargets inside StaticBoxSizers?

I'm using python2.3.5, wxpython2.6.1.0-unicode on WinXPpro-SP2.
   
See this thread, maybe it's related to:
http://thread.gmane.org/gmane.comp.python.wxpython/24356

Ricardo

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Fill a bug report with the catagory "wxMSW specific" since I think it's
a bug?

Ricardo

···

On Wed, 2005-08-24 at 22:33 +0200, Helmers, Jens Bloch wrote:

Without any change of result I tried:

        problem = True
        if problem:
            
wx.SystemOptions.SetOptionInt("msw.staticbox.optimized-paint", 0)
            sb = wx.StaticBox( frame, -1, "Text" )
            sizer = wx.StaticBoxSizer( sb, wx.HORIZONTAL )
        else:
            sizer = wx.BoxSizer( wx.HORIZONTAL )