Don,
On Thu, Apr 29, 2010 at 12:11 PM, Don Dwiggins <
ddwi...@advpubtech.com> wrote:
> Is there an option to alphabetize the items in the Code Explorer at each
> level, rather than showing them in "code order"?
Not currently. :)
> If not, and if you don't
> have the time, and if it's not too hairy, I'd be willing to take a crack at
> implementing it, with some pointers to get me started.
It would be great if you could give it a shot. It might be a bit of a
twisty road at times because I need to improve my documentation, but
this would be a great way to do that. I started some docs here:
http://trac.flipturn.org/wiki/CodeExplorer
There are probably three real issues:
1) make new code to alphabetize the items
2) add some user interface control to turn this on and off
3) make the alphabetization state persistent
It seems like the sorting should be done on the tree itself using
SortChildren and a custom OnCompareItems.
The user interface could be a right click in the minor mode window,
which would be implemented as an action. The place to look for an
example of that would be in peppy/plugins/macro.py: the
getPopupActions() method of MacroListMinorMode. It returns a list of
action classes (EditMacro, RenameMacro, DeleteMacro, etc.) that are
then instantiated to create the popup. So, I imagine that would be a
way to do it for whether or not you want alphabetization.
Note that action instances are created and destroyed on demand and as
such can't save any state themselves, they always have to point back
to their parent mode. So a logical place to store the persistent flag
as a BoolParam the major mode classprefs of FundamentalMode.
Well... What do you think?
Rob