[wxPython-users] AGW Revamped

173 views
Skip to first unread message

Andrea Gavana

unread,
Apr 16, 2010, 8:04:29 AM4/16/10
to wxPython-users, wxPyth...@googlegroups.com
Hi All,

I have just committed some fairly large changes to the AGW library,
and I hope I am going to explain myself clearly enough about what I
have done.

First of all, I would like to apologize to those (3 or 4) wxPython
users/developers who are actually using AGW. If you update your copy
of AGW from SVN, you will be forced to make (relatively small) changes
to your applications.

As you may know, for some widgets in AGW (most notably CustomTreeCtrl,
AuiNotebook, HyperTreeList, FlatNotebook, UltimateListCtrl), the
AGW-specific window style conflicted with the underlying wx.Window
window styles (one mention is in bug #11861 at the tracker:
http://trac.wxwidgets.org/ticket/11861). So, my approach has been the
following:

1) For all the AGW widgets in which the "style" keyword used mixed
wx.Window styles and AGW styles, I have added a new keyword for their
constructor (termed "agwStyle"). So, if you were using CustomTreeCtrl
like this before:

class CustomTreeCtrl(CT.CustomTreeCtrl):

def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.SUNKEN_BORDER | CT.TR_HAS_BUTTONS
| CT.TR_HAS_VARIABLE_ROW_HEIGHT):


CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style)


Now you should construct it like this:

class CustomTreeCtrl(CT.CustomTreeCtrl):

def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.SUNKEN_BORDER,
agwStyle=CT.TR_HAS_BUTTONS | CT.TR_HAS_VARIABLE_ROW_HEIGHT):


CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, agwStyle)


Which means, the "style" keyword is now reserved for the underlying
wx.Window only and it's left untouched by AGW.

2) As the constructors have been modified, methods like HasFlag,
SetWindowStyle, SetWindowStyleFlag, GetWindowStyle, GetWindowStyleFlag
and so on do *not* return the AGW style anymore. For these modified
widgets, you should use:

- SetAGWWindowStyleFlag;
- GetAGWWindowStyleFlag;
- HasAGWFlag (this method is not present everywhere)

3) There are no more "extra styles" in UltimateListCtrl (everything is
clamped inside the "agwStyle" keyword);

4) There are no more limitations on the number of styles a widget can
have (this is a positive outcome).

The AGW widgets affected by these changes are:

- AdvancedSplash
- AUI
- ButtonPanel
- CubeColourDialog
- CustomTreeCtrl
- FlatNotebook
- FloatSpin
- FourWaySplitter
- GenericMessageDialog
- HyperTreeList
- KnobCtrl
- LabelBook
- MultiDirDialog
- PeakMeter
- PyProgress
- RibbonBar
- SpeedMeter
- UltimateListCtrl

In the meanwhile, I believe I have managed to fix tickets #11825
(AuiNotebook), #11861 (FlatNotebook), #11953 (AuiNotebook), #11954
(HyperTreeList).

The updated documentation for AGW is here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/index.html

If you encounter any issue/problem, please let me know. I have tested
the changes quite a bit but it was a huge commit and something may
have slipped in.

Sorry for the disruption, happy wxPython hacking.

Andrea.

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

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==

--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Steven Sproat

unread,
Apr 16, 2010, 8:28:17 AM4/16/10
to wxpytho...@googlegroups.com
Hey Andrea,

On 16 April 2010 13:04, Andrea Gavana <andrea...@gmail.com> wrote:
> Hi All,
>
> I have just committed some fairly large changes to the AGW library,
> and I hope I am going to explain myself clearly enough about what I
> have done.
>
> First of all, I would like to apologize to those (3 or 4) wxPython
> users/developers who are actually using AGW.


I'm sure there's more users than that :D
Thanks for the update - I'm currently using flatnotebook but since
I've done some edits to it I'm basically importing a custom version of
the module

Mike Driscoll

unread,
Apr 16, 2010, 9:41:34 AM4/16/10
to wxPython-users
Hi Andrea,

On Apr 16, 7:04 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:
> Hi All,
>
> I have just committed some fairly large changes to the AGW library,
> and I hope I am going to explain myself clearly enough about what I
> have done.
>
> First of all, I would like to apologize to those (3 or 4) wxPython
> users/developers who are actually using AGW. If you update your copy
> of AGW from SVN, you will be forced to make (relatively small) changes
> to your applications.


I agree with Steven...give yourself more credit. The blog post I wrote
about your controls has had over 150 views and I'm sure its mirror on
the wiki has had plenty of views too.

Of course, your changes break the tutorials, but I'll get them fixed
on the wiki and probably just do a special post about it on my blog.
Thanks for the good work!

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

pyt...@bdurham.com

unread,
Apr 16, 2010, 9:46:58 AM4/16/10
to wxpytho...@googlegroups.com, wxPython-users, wxPyth...@googlegroups.com
Andrea,

Thanks for sharing all your hard work with the rest of the wxPython
community - great stuff!!!

Sorry to hear about your Removal Group problems. I spent a year in the
UK and have a similar horror story.

Cheers,

Malcolm
Reply all
Reply to author
Forward
0 new messages