Enhanced tree.py (was Re: mouse event failures (was Re: tree))

John Henry <[email protected]> Mon, 16 Nov 2009 09:40:32 -0800 (PST)
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
After reading the code tree.py, I understand what was wrong: I shouldn't be using the mouse event.  The tree.py was developed to support only those methods invoked by the minimalTree example (which is REALLY ... minimal).  So, I added a couple of events to support drag&drop of items to tree.py, and found an example at http://wiki.wxpython.org/TreeControlsand updated minimalTree to do drag&drag w scrolling.  I've uploaded the file to the Pythoncard Features Request page at:

https://sourceforge.net/tracker/?func=detail&aid=2898599&group_id=19015&atid=369015

I hope this example program can help others see how Pythoncard supports the wxPython card control.

 --
John Henry



----- Original Message ----
> From: John Henry <[email protected]>
> To: [email protected]
> Sent: Sun, November 15, 2009 4:29:42 PM
> Subject: mouse event failures (was Re: [Pythoncard-users] tree)
> 
> I'm now taking a closer look at my tree control program and try to figure out 
> why somethings don't work right.
> 
> In a native wxPython set up, when you get a dragEnd event, you should be able to 
> know the target from:
> 
>         target = evt.GetItem()
> 
> 
> For Pythoncard, you get a "MouseEvent" object has no attribute xxx.  In 
> addition, you can't even do a evt.Veto() for the same reason.
> 
> Something is wrong here.
> 
> 
> --
> John Henry
> 
> 
> 
> ----- Original Message ----
> > From: John Henry 
> > To: [email protected]
> > Sent: Wed, October 28, 2009 8:40:27 PM
> > Subject: Re: [Pythoncard-users] tree
> > 
> > With the help of a debugger and plenty of Google searches, and a lot of 
> > guessing, I was able to invoke most of the wx tree functions.  It proves that 
> > the minimal tree wrapper does work.
> > 
> > --
> > John Henry
> > 
> > 
> > 
> > ----- Original Message ----
> > > From: Neil Hughes 
> > > To: John Henry 
> > > Cc: [email protected]
> > > Sent: Wed, October 28, 2009 4:24:03 AM
> > > Subject: Re: [Pythoncard-users] tree
> > > 
> > > On 21/10/09 00:27, John Henry wrote:
> > > > Does anybody have more examples on the tree control?  The minimum tree 
> only 
> > > show very simple functions and I'm able to do those.  But there is no 
> > > information on how I can traverse the tree - start with the root, get to the 
> 
> > > NextChild, get the label, delete a branch, programmatically expand or 
> contract 
> > a 
> > > branch, ... - all the standard things one would do with a tree...
> > > 
> > > My use of the tree control hasn't been much more sophisticated than the 
> > > example. I did add a couple of extra method aliases to 
> > > PythonCard\components\tree.py because the ones already there are only 
> > > enough to support the example. So in __init__ I added
> > > 
> > > setExpanded = wx.TreeCtrl.Expand
> > > clearTree = wx.TreeCtrl.DeleteAllItems
> > > 
> > > so that having built the tree from a dictionary I could open up all of 
> > > the nodes at startup, and I could tear it down and rebuild it 
> > > differently later on.
> > > 
> > > -- 
> > > Neil Hughes
> > > 
> > > 
> ------------------------------------------------------------------------------
> > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> > > is the only developer event you need to attend this year. Jumpstart your
> > > developing skills, take BlackBerry mobile applications to market and stay 
> > > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> > > http://p.sf.net/sfu/devconference
> > > _______________________________________________
> > > Pythoncard-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/pythoncard-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july