problems with customtreectrl ...

hello (Andrea),

Although CT has some very nice features,
I think it still a bit buggy (or I don't use it correct :wink:
(I might have mentioned a few of these items in this list)
Solutions I found are created by trial and error, because this code is far beyond my knowledge)

* editor is multiline editor, which is quit ugly in single line applications
(remove wx.TE_MULTILINE in TreeTextCtrl at line 950)

* dragging is ugly when full line width highlight is on
(no solution)

* making the treewindow wider, when full line width highlight is o, gives weird rendering
( no solution)

* when focus is lost in edit mode, editor doesn't disappear.
This is a very serious bug, because also moving to another item in the tree while editing,
can give very weird effects (and even hang the program)
solution:
聽聽聽聽def OnKillFocus(self, event):
聽聽聽聽聽聽聽聽self._aboutToFinish = True
聽聽聽聽聽聽聽聽self.AcceptChanges()
聽聽聽聽聽聽聽聽wx.CallAfter(self.Finish)
聽聽聽聽聽聽聽聽event.Skip()

Now this gives an error, so we also change
聽聽聽聽def Finish(self):
聽聽聽聽聽聽try:
聽聽聽聽聽聽聽聽if not self._finished:
聽聽聽聽聽聽聽聽聽聽聽聽self._finished = True
聽聽聽聽聽聽聽聽聽聽聽聽self._owner.SetFocusIgnoringChildren()
聽聽聽聽聽聽聽聽聽聽聽聽self._owner.ResetTextControl()
聽聽聽聽聽聽except:
聽聽聽聽聽聽聽聽pass

* Del-Key bound as an accelerator key prevents the use of del-key in editor.
solution, catch the onkeydown with a normal Bind :

聽聽聽聽self.Bind ( wx.EVT_KEY_DOWN, self.OnMyKeyDown)
聽聽def OnMyKeyDown ( self, event ) :
聽聽聽聽if not ( self.GetEditControl () ) :
聽聽聽聽聽聽if event.GetKeyCode() == wx.WXK_DELETE :
聽聽聽聽聽聽聽聽self.Delete_Item ( self.GetSelection () )
聽聽聽聽聽聽else :
聽聽聽聽聽聽聽聽event.Skip()
聽聽聽聽else :
聽聽聽聽聽聽event.Skip()

* InsertItemBefore is not implemented,
solution, can be done through PrependItem

cheers,
Stef

Andrea,
thanks for your fast response, ...

Andrea Gavana wrote:

Hi Stef and All,

hello (Andrea),

Although CT has some very nice features,
I think it still a bit buggy (or I don't use it correct :wink:
(I might have mentioned a few of these items in this list)
Solutions I found are created by trial and error, because this code is far
beyond my knowledge)

* editor is multiline editor, which is quit ugly in single line
applications
(remove wx.TE_MULTILINE in TreeTextCtrl at line 950)
    
Have you tried the version in SVN (or the latest wxPython
pre-release)? You can find the SVN version here:
  

gives an error on this:
from wx.lib.embeddedimage import PyEmbeddedImage

cheers,
Stef

路路路

On Wed, Apr 2, 2008 at 10:46 PM, Stef Mientki wrote:

Hi Stef,

Andrea,
thanks for your fast response, ...

Andrea Gavana wrote:
> Hi Stef and All,
>
>
>
> > hello (Andrea),
> >
> > Although CT has some very nice features,
> > I think it still a bit buggy (or I don't use it correct :wink:
> > (I might have mentioned a few of these items in this list)
> > Solutions I found are created by trial and error, because this code is
far
> > beyond my knowledge)
> >
> > * editor is multiline editor, which is quit ugly in single line
> > applications
> > (remove wx.TE_MULTILINE in TreeTextCtrl at line 950)
> >
> >
>
> Have you tried the version in SVN (or the latest wxPython
> pre-release)? You can find the SVN version here:
>
>
gives an error on this:
from wx.lib.embeddedimage import PyEmbeddedImage

Yes, sorry, I always forget to mention that... in the next release,
the way the images can be embedded in an application (using img2py)
will change, and has changed in SVN too. The only other thing you need
to get is this file:

http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/wx/lib/embeddedimage.py?revision=51015&view=markup

And you will be able to run the latest version of CustomTreeCtrl. You
might also want to read this thread:

It highlights some of the modififcations I have made to CustomTreeCtrl in SVN.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

路路路

On Thu, Apr 3, 2008 at 11:30 PM, Stef Mientki wrote:

> On Wed, Apr 2, 2008 at 10:46 PM, Stef Mientki wrote: