TreeListCtrl and its edit control

Hi

Back to Python (and wxPython) from some really frustrating C coding, i
have immediately some problems. :slight_smile:

I want to use a TreeListCtrl with editable labels. But the edit control
shows some strange behaviours.

- If an item has childs, the control is positioned too far to the left,
聽聽so it covers the +/- sign (if TR_HAS_BUTTONS is used).
- The width is a few pixels too small to show all of the text (i'd like
聽聽to have a width, that the control reaches to the end of the column).
- If the label is an empty string, than a rectangle covers almost all of
聽聽the control, only the top 3-4 pixels are visible.

I think I could solve all these problems, if I could only get the
control - but I'm missing GetEditCtrl()...

In a TreeCtrl all works and looks as expected.

I'm working on XP SP1 with wxPython 2.6.1.0 and Python 2.3.5

thx & cu boesi

路路路

--
So stellt sich der Atheist doch die #1671 : icq-intern
Unsterblichkeit vor - Lokalverbot #73628288 : icq-extern
auf dem Friedhof. boesi111 : aim
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽i171 : reallife

Hi

路路路

Am 24.08.2005 16:20:43 schrieb Alexander 'boesi' B枚secke:

[...]

Hmm isn't here anybody who is able to help?
Or does nobody use the TreeListCtrl with editable labels?

thx & cu boesi
--
baka baka #1671 : icq-intern
                                                 #73628288 : icq-extern
                                                  boesi111 : aim
                                                      i171 : reallife

Hi

[...]

Hello Alexander,

Hmm isn't here anybody who is able to help?

Apparantly it is so :wink:

Or does nobody use the TreeListCtrl with editable labels?

this could also be the reason.

But you could provide a small sample?

Or try to ask in comp.soft-sys.wxwindows?

as written in
http://wxcode.sourceforge.net/showcomp.php?name=wxTreeListCtrl
Otto Wyss is the maintainer of this control,
maybe he can help you.

Sorry for not helping much,

路路路

On Wed, 31 Aug 2005 09:23:29 +0200, Alexander 'boesi' B枚secke <boesi.josi@gmx.net> wrote:

Am 24.08.2005 16:20:43 schrieb Alexander 'boesi' B枚secke:

thx & cu boesi

--
Franz Steinhaeusler

Hi

But you could provide a small sample?

Ofcourse I could and I will do so... :slight_smile:
I've attached an example and two images that show what I mean.
At 1.gif you can see, that the edit Control is positioned too far to the
left.
At 2.gif the label has been an empty string, when I start editing and
now the text in the control is "Hallo". When I end the editing (in the
image the control is still activated) the given text is immediately
shown.

Or try to ask in comp.soft-sys.wxwindows?

Oh now not one more list to get... (with ISDN it's really annoying to
retrieve some bigger mailing lists or usenet groups)

as written in
http://wxcode.sourceforge.net/showcomp.php?name=wxTreeListCtrl
Otto Wyss is the maintainer of this control,
maybe he can help you.

thanks
But meanwhile I've switched to a normal TreeCtrl and add the additional
information directly to the label text. All in all that looks clearer
and it just works...

cu boesi

TreeListCtrl.py (755 Bytes)

1.GIF

路路路

Am 31.08.2005 10:36:46 schrieb Franz Steinh盲usler:
--
Wenn de L眉ch net waer un dr Neid #1671 : icq-intern
g盲bs lauter gl眉ckliche Leid #73628288 : icq-extern
Uhne L眉ch un Neid = ganz gewi脽 boesi111 : aim
w盲r uf dr Ard is Paradies i171 : reallife

Hi

But you could provide a small sample?

Hello boesi,

Ofcourse I could and I will do so... :slight_smile:
I've attached an example and two images that show what I mean.
At 1.gif you can see, that the edit Control is positioned too far to the
left.
At 2.gif the label has been an empty string, when I start editing and
now the text in the control is "Hallo". When I end the editing (in the
image the control is still activated) the given text is immediately
shown.

thanks.
With your sample, I got exactly the same results in WinXP, wxPy 2.6.1.1 pre.

Or try to ask in comp.soft-sys.wxwindows?

Oh now not one more list to get... (with ISDN it's really annoying to
retrieve some bigger mailing lists or usenet groups)

Really? :wink: for one newsgroup to subscribe?
You could also post with google groups.

as written in
http://wxcode.sourceforge.net/showcomp.php?name=wxTreeListCtrl
Otto Wyss is the maintainer of this control,
maybe he can help you.

thanks
But meanwhile I've switched to a normal TreeCtrl and add the additional
information directly to the label text. All in all that looks clearer
and it just works...

cu boesi

I compiled the treelistctrl and treelistctrltest, which
I downloaded directly from the wxcode page, and all looks
fine (size and position of the edittext controls).

Comparing the treelistctrl.cpp from the src download of wxPython 2.6.0
with the new one shows some differences in the size and position
of the ::editlabel (there is a "wxEditTextCtrl" and for this,
there is no possibility to access it from wxPython).

So this should be wrapped again into the wxPython distribution,
and this problems should be solved then.

Or someone translates the cpp code to wxPython,
as Andrea did with FoldPanelBar, but not me :wink:
(the cpp file has 4500 lines).

Cheers,

路路路

On Fri, 02 Sep 2005 10:12:59 +0200, Alexander 'boesi' B枚secke <boesi.josi@gmx.net> wrote:

Am 31.08.2005 10:36:46 schrieb Franz Steinh盲usler:

--
Franz Steinhaeusler

Yes, the treelistctrl that it's ship with wxpython is a bit out of date.

I wrapped it to wxPython and looks fine under msw and gtk2.

Ricardo

路路路

On Fri, 2005-09-02 at 12:34 +0200, Franz Steinh盲usler wrote:

I compiled the treelistctrl and treelistctrltest, which
I downloaded directly from the wxcode page, and all looks
fine (size and position of the edittext controls).

Comparing the treelistctrl.cpp from the src download of wxPython 2.6.0
with the new one shows some differences in the size and position
of the ::editlabel (there is a "wxEditTextCtrl" and for this,
there is no possibility to access it from wxPython).

So this should be wrapped again into the wxPython distribution,
and this problems should be solved then.

Or someone translates the cpp code to wxPython,
as Andrea did with FoldPanelBar, but not me :wink:
(the cpp file has 4500 lines).

Cheers,

Hello Ricardo,

really, how did you do that?

I know, SWIG and all the stuff is described,
but if this is not to longwinded,
could you describe shortly the steps
and/or post the changed files please? :wink:

I'm particulary interested, how you did that
under MSW.

Cheers,

路路路

On Fri, 02 Sep 2005 11:57:31 +0100, Ricardo Pedroso <ricardo.pedroso@netvisao.pt> wrote:

On Fri, 2005-09-02 at 12:34 +0200, Franz Steinh盲usler wrote:

I compiled the treelistctrl and treelistctrltest, which
I downloaded directly from the wxcode page, and all looks
fine (size and position of the edittext controls).

Comparing the treelistctrl.cpp from the src download of wxPython 2.6.0
with the new one shows some differences in the size and position
of the ::editlabel (there is a "wxEditTextCtrl" and for this,
there is no possibility to access it from wxPython).

So this should be wrapped again into the wxPython distribution,
and this problems should be solved then.

Or someone translates the cpp code to wxPython,
as Andrea did with FoldPanelBar, but not me :wink:
(the cpp file has 4500 lines).

Cheers,

Yes, the treelistctrl that it's ship with wxpython is a bit out of date.

I wrapped it to wxPython and looks fine under msw and gtk2.

Ricardo

--
Franz Steinhaeusler

Comparing this to a war, you have several battles to win.

First of all you must install the build environment, I follow this one
Building Python Extensions with the MS Toolkit Compiler for python2.4.
For python2.3 you will need the visual studio 6

Next I read this:
http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/wxPython/docs/BUILD.txt?rev=1.34&sortby=date&content-type=text/vnd.viewcvs-markup
That I had to install at the cygwin(http://www.cygwin.com/) to use some
scripts that Robin has to help him build the beast and to compile the
patched swig on windows.

Then I take a look into this doc (but this one is not necessary):
http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/wxPython/distrib/howto-distrib.txt?rev=1.8&sortby=date&content-type=text/vnd.viewcvs-markup
This one you cannot follow blindly because is a little bit specific to
Robins environment and it's the steps that Robin take to make the
distrib files (at least I think).
I read this mainly because I had the time and I want to know I to make
distribution files and I had successfully made them for linux and
windows. For mac I don't know, I never had one.

In the end I replace the treelistctrl.cpp and treelistctrl.h under
contrib/gizmos/wxCode with newer ones. I had to change the swig
interface too(see attachment), since there was some treelistctrl api
changes.

The sources of wxWidgets/wxPython that I use was a recent CVS copy from
http://cvs.wxwidgets.org

It's all. I hope didn't forget anything.

Ricardo

gizmos.tar.gz (9.26 KB)

路路路

On Fri, 2005-09-02 at 13:17 +0200, Franz Steinh盲usler wrote:

On Fri, 02 Sep 2005 11:57:31 +0100, Ricardo Pedroso <ricardo.pedroso@netvisao.pt> wrote:

>On Fri, 2005-09-02 at 12:34 +0200, Franz Steinh盲usler wrote:
>
>> I compiled the treelistctrl and treelistctrltest, which
>> I downloaded directly from the wxcode page, and all looks
>> fine (size and position of the edittext controls).
>>
>>
>> Comparing the treelistctrl.cpp from the src download of wxPython 2.6.0
>> with the new one shows some differences in the size and position
>> of the ::editlabel (there is a "wxEditTextCtrl" and for this,
>> there is no possibility to access it from wxPython).
>>
>> So this should be wrapped again into the wxPython distribution,
>> and this problems should be solved then.
>>
>> Or someone translates the cpp code to wxPython,
>> as Andrea did with FoldPanelBar, but not me :wink:
>> (the cpp file has 4500 lines).
>>
>> Cheers,
>
>Yes, the treelistctrl that it's ship with wxpython is a bit out of date.
>
>I wrapped it to wxPython and looks fine under msw and gtk2.
>
>Ricardo

Hello Ricardo,

really, how did you do that?

I know, SWIG and all the stuff is described,
but if this is not to longwinded,
could you describe shortly the steps
and/or post the changed files please? :wink:

I'm particulary interested, how you did that
under MSW.