Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • ANN: CustomTreeCtrl For wxPython ;-)

    7 answers - 4876 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello NG,
    thank you for your answers :-)
    From: news [mailto:news (AT) sea (DOT) gmane.org] Behalf Franz
    Steinhaeusler
    <snip>
    1) So now if you press cursor down, nothing happens (I would
    expect to select item0-b.
    Yes, you are right. The problem is, in a normal wx.TreeCtrl, you don't have inactive items, so pressing cursor down would simply select item0-a-0. In the demo, this item is inactive (because its parent is a radiobutton non selected), so it should jump to the next active sibling. I am trying to find a way to efficiently implement some method like GetNextActiveItem() to handle that. I am working on it.
    2) if you press cursor left, I would expect to close the
    current branch but it jump to item0.
    Right, this is the default behavior on MSW and, unless I am missing something, the C++ implementation is buggy here. I have fixed it now, thanks.
    You should have the wxPython contribution award (at least for
    the second quarter of 2006 beside Robin of course) for your work! :-)
    Hehehehehehe, thank you Unfortunately, I don't think that such award exists ;-). I was in the need of having a TreeCtrl with radio and check buttons: I started by tweaking the Ricardo's CheckTreeCtrl , but I was unable to adapt it to my needs. So I started implementing this new control and, as usual when I code new things, I became an overblown coder ;-)
    The Python binding can soon more than the C++ wxWidgets itself!!! :)
    I think it already is Not only for the contributions: Python itself is infinitely superior to C++, so coding in Python can be a joy while doing it in C++ can easily turn into a PITA Not talking about compiling, debugging, spot the errors, recompiling That's a nightmare :-)
    From: Michele Petrazzo [mailto:michele.petrazzo (AT) unipex (DOT) it]
    linux (deb 3.1 + wx 2.6.x) all work except into the left
    side of demo where I see the buttons cut:
    Thanks for this Michele, I think I have fixed it now. Unfortunately, I can't test it because I don't have a *nix machine. If it's possible, I would like to ask you if you can please send me a screenshot of the control The picture in that web site doesn't show the tree control itself, only the problem with the demo. I am interested in seeing the control expanded to show the attached windows. Thank you.
    From: John Jackson [mailto:jjackson (AT) pobox (DOT) com]
    the Mac, CustomTreeCtrl.py is broken at line 1822. It should be
    platform, major, minor = wx.GVersion()
    Thanks, fixed it.
    It will then run the demo. But it throws an exception:
    L:~/ jjackson$ pythonw CTDemo.py
    Traceback (most recent call last):
    File "/", line 4494, in Paint
    self.PaintLevel(self._anchor, dc, 0, y)
    File "/", line 4321, in PaintLevel
    pen = wx.Pen(((item.IsSelected() and self._hasFocus) and [self._borderPen] or [wx.TRANSPARENT])[0])
    File "//", line 322, in __init__
    newobj = _gdi_.new_Pen(*args, **kwargs)
    TypeError: Expected a wxColour object or a string containing a colour name or '#RRGGBB'.
    Thank you, that was my misenterpretation of the C++ code. I have fixed it now.
    The tree doesn't show at all on the Mac
    I was expecting that, as usual. I wonder why Mac is *so* hostile versus owner-drawn controls. In every new control (as PyAUI, NotebookCtrl, and so on), the most awkward "if" switches are there just to keep Mac running. Platform independency and Apple are surely not synonyms.
    and the buttons on the left don't arrange properly after scrolling.
    Looks like a sizer problem for the buttons.
    This seems to me a wxMac bug. Here I don't see any problem, and from the screenshot Michele posted, also on GTK everything seems to work fine for the checkboxes on the left. Sounds like you can't correctly put controls in a wx.StaticBoxSizer inside a wx.ScrolledWindow.
    Shouldn't the "Themes" buttons be a radio set rather than check
    buttons, as one of the themes is always active?
    Mhm Does that disturb you so much? By using radiobuttons I would end up having nested RB_GRUP radiobuttons, which I prefer to avoid.
    Thanks to everyone for your comments! And please, if you can, I would appreciate to receive a screenshot of the control running on your machine ;-) . I am just curious, nothing more.
    Andrea.
    Andrea Gavana (gavana (AT) kpo (DOT) kz)
    Reservoir Engineer
    KPDL
    4, Millbank
    SW1P 3JA London
    Direct Tel: +44 (0) 20 717 08936
    Mobile Tel: +44 (0) 77 487 70534
    Fax: +44 (0) 20 717 08900
    Web:
    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.1 | | 4468 bytes | |

    Hi Andrea,

    May 19, 2006, at 2:19 AM, Gavana, Andrea wrote:

    [snip]

    >The tree doesn't show at all on the Mac
    >

    I was expecting that, as usual. I wonder why Mac is *so* hostile
    versus owner-drawn controls. In every new control (as PyAUI,
    NotebookCtrl, and so on), the most awkward "if" switches are there
    just to keep Mac running. Platform independency and Apple are
    surely not synonyms.

    It's not totally Mac's fault here - the issue is that wx generic
    controls were often built before Mac was around, and never really
    made to work with Mac,. Plus, there is Mac S 9 and S X which are
    very different. For example, a generic control may not consider that
    the native control has a highlight around it, and when it invalidates
    the region, it doesn't invalidate a large enough region (say, on S
    X) to get the highlight erased too. that the default size of the
    editable text ctrl that wxListCtrl pops up is bigger than on other
    platforms, but wxListCtrl assumes a certain size. Lots of little
    details like that. A big aspect of all this is that most of the
    generic control developers don't have Macs, and/or don't test on them
    often. ;-/ I'm pretty sure we'd have similar problems with Win/Linux
    if they got that same amount of exposure and testing

    BTW, if you're curious, the way to do this on Mac would be to use the
    S X DataBrowser control, which would allow you to create "owner
    drawn" controls based around tree/list controls and is very flexible.
    You can also add in native controls, like progress bars, and the S
    will handle the drawing/invalidation issues. The problem is, wx
    hasn't wrapped the DataBrowser control yet, and there've been debates
    about whether wxListCtrl/wxTreeCtrl should be implemented using it.
    (The new wxDataViewCtrl will most certainly use it, whenever someone
    gets around to finishing that) I wish someone would implement
    these controls using the DataBrowser, because the 'generic'
    wxTreeCtrl and wxListCtrl just have so many little glitches in them
    that using the DataBrowser control would fix, and it would make the
    list/tree controls *so* much slicker on S X to boot.

    Anyways, sorry for the rant. ;-) But I just wanted to point out that
    yes, Mac is different, but that it's not that there aren't solutions
    to make these things work well. It's just that what we're really
    doing, in many cases, is porting the "Windows/Linux way" over to Mac,
    rather than designing with Mac in mind (<cough>MDI/DocView</cough>),
    which is somewhat like using Babelfish to translate. ;-) You might be
    able to get the gist, but it certainly looks awkward. ;-)

    Regards,

    Kevin

    >and the buttons on the left don't arrange properly after scrolling.
    >Looks like a sizer problem for the buttons.
    >

    This seems to me a wxMac bug. Here I don't see any problem, and
    from the screenshot Michele posted, also on GTK everything seems to
    work fine for the checkboxes on the left. Sounds like you can't
    correctly put controls in a wx.StaticBoxSizer inside a
    wx.ScrolledWindow.
    >
    >Shouldn't the "Themes" buttons be a radio set rather than check
    >buttons, as one of the themes is always active?
    >

    Mhm Does that disturb you so much? By using radiobuttons I would
    end up having nested RB_GRUP radiobuttons, which I prefer to avoid.
    --
    Thanks to everyone for your comments! And please, if you can, I
    would appreciate to receive a screenshot of the control running on
    your machine ;-) . I am just curious, nothing more.

    Andrea.

    Andrea Gavana (gavana (AT) kpo (DOT) kz)
    Reservoir Engineer
    KPDL
    4, Millbank
    SW1P 3JA London

    Direct Tel: +44 (0) 20 717 08936
    Mobile Tel: +44 (0) 77 487 70534
    Fax: +44 (0) 20 717 08900
    Web:

    --

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-
    help (AT) lists (DOT) wxwidgets.org
    --

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.2 | | 1913 bytes | |

    Andrea's changes fixed the problems with the display of the tree on
    the Mac. Looks great. Do you need a screen snapshot?

    May 19, 2006, at 2:19 AM, Gavana, Andrea wrote:

    >and the buttons on the left don't arrange properly after scrolling.
    >Looks like a sizer problem for the buttons.
    >

    This seems to me a wxMac bug. Here I don't see any problem, and
    from the screenshot Michele posted, also on GTK everything seems to
    work fine for the checkboxes on the left. Sounds like you can't
    correctly put controls in a wx.StaticBoxSizer inside a
    wx.ScrolledWindow.

    The problems with the demo's CustomTreeCtrl Styles checkboxes are a
    wxMac bug. I played around with the code, and always the fifth item
    is the one that greats messed up. A resize event always clears it.

    >Shouldn't the "Themes" buttons be a radio set rather than check
    >buttons, as one of the themes is always active?
    >

    Mhm Does that disturb you so much? By using radiobuttons I would
    end up having nested RB_GRUP radiobuttons, which I prefer to avoid.

    It is bothersome, because that's what radio buttons are for: to
    indicate that one, and only one, of a group is selected. Checkboxes
    are independent, unless they are used in a hierarchy.

    Does your control properly handle KeyEvents passed with
    EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one year)
    bug that it doesn't pass Shift/Ctrl/Alt as part of the KeyEvents.
    (Hint to Robin: any idea when that might get fixed? I was going to
    use it)

    Thanks for the new control!

    John Jackson

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.3 | | 415 bytes | |

    John Jackson wrote:

    Does your control properly handle KeyEvents passed with
    EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one year) bug
    that it doesn't pass Shift/Ctrl/Alt as part of the KeyEvents. (Hint to
    Robin: any idea when that might get fixed? I was going to use it)

    I don't know. I haven't heard about anybody working on it. Is there a
    bug report for it?
  • No.4 | | 525 bytes | |

    May 19, 2006, at 12:17 PM, Robin Dunn wrote:

    John Jackson wrote:
    >
    >Does your control properly handle KeyEvents passed with
    >EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one
    >year) bug that it doesn't pass Shift/Ctrl/Alt as part of the
    >KeyEvents. (Hint to Robin: any idea when that might get fixed? I
    >was going to use it)
    >

    I don't know. I haven't heard about anybody working on it. Is
    there a bug report for it?
  • No.5 | | 768 bytes | |

    John Jackson wrote:

    May 19, 2006, at 12:17 PM, Robin Dunn wrote:

    >John Jackson wrote:
    >>

    Does your control properly handle KeyEvents passed with
    EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one year)
    bug that it doesn't pass Shift/Ctrl/Alt as part of the KeyEvents.
    (Hint to Robin: any idea when that might get fixed? I was going to
    use it)
    >>

    >I don't know. I haven't heard about anybody working on it. Is there
    >a bug report for it?
    >>

    >Dunn


    The bug report is #1244537, assigned to a Robin Dunn. :)

    ! Thanks.
  • No.6 | | 744 bytes | |

    Hello John,

    >Andrea's changes fixed the problems with the display of the tree on
    >the Mac. Looks great. Do you need a screen snapshot?


    I am happy you liked it :-) Yes, if you could send me a screenshot with the
    tree expanded to show the controls, it would be nice.

    >Does your control properly handle KeyEvents passed with
    >EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one year)
    >bug that it doesn't pass Shift/Ctrl/Alt as part of the KeyEvents.


    Mhm, I didn't know anything about that bug,,, what the shift/ctrl/alt are
    supposed to do? For multiple item selection? something else?

    Andrea.
  • No.7 | | 1475 bytes | |

    May 19, 2006, at 4:05 PM, Andrea Gavana wrote:

    Hello John,
    >
    >Andrea's changes fixed the problems with the display of the tree on
    >the Mac. Looks great. Do you need a screen snapshot?
    >

    I am happy you liked it :-) Yes, if you could send me a screenshot
    with the tree expanded to show the controls, it would be nice.

    A screenshot from the Mac is at http://www.sonic.net/~jginc/software/
    mac_customtreectrl.jpg

    >Does your control properly handle KeyEvents passed with
    >EVT_TREE_SEL_CHANGING? The wxTreeCtrl has a long-standing (one year)
    >bug that it doesn't pass Shift/Ctrl/Alt as part of the KeyEvents.
    >

    Mhm, I didn't know anything about that bug,,, what the shift/ctrl/
    alt are supposed to do? For multiple item selection? something
    else?

    It should (I think) include a KeyEvent in with the event, so one can
    test if the modifier keys are down. You should be able to get the
    event, call GetKeyEvent() on it, and then call the KeyEvent methods
    to get the information you need.

    It goes in your code around line 3554, where you say:

    # TD : Here we don't send any selection mode yet !

    John Jackson

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org

Re: ANN: CustomTreeCtrl For wxPython ;-)


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Python"

EMSDN.COM