RE: [Pythoncard-users] component/event support in the codeEditor
by Kevin Altis other posts by this author
Jan 6 2003 11:29PM messages near this date
[Pythoncard-users] component/event support in the codeEditor
|
[Pythoncard-users] added codeEditor page to web site
I've checked in the codeEditorR.py and codeEditorR.rsrc.py files.
codeEditorR is a subclass of the normal codeEditor but it is resource file
aware, so only the new functions and methods and the ones changed from the
original are in the source. This makes it pretty easy to see what is done
differently and to experiment without impacting the real codeEditor.
All the current version does is check for a corresponding .rsrc.py file when
you open a source file and if one exists it fills in the dropdown menu with
a list of component names. The event names dropdown changes as you select
different components and a '+' will appear in front of an event if a handler
already exists. Selecting an event that has a handler defined will cause the
selection to jump to the beginning of that handler. If a handler doesn't
exist, a stub will be created. The text insertion is undoable, so if you
make a mistake, just select Undo from the Edit menu or type Ctrl+Z.
Since I didn't get any comments on the material I posted earlier I'll
probably just let these files sit in cvs for a while. I don't plan on
including codeEditorR in the next release. Just post any comments you have
to the list if you try codeEditorR.
ka
> -----Original Message-----
> From: pythoncard-users-admin@[...].net
> [mailto:pythoncard-users-admin@[...].net]On Behalf Of Kevin
> Altis
> Sent: Friday, January 03, 2003 12:10 PM
> To: pythoncard-Users
> Subject: [Pythoncard-users] component/event support in the codeEditor
>
>
> I have a modified version of the codeEditor that I'm playing with that I
> plan to check into cvs in the next week if I can solve a couple
> of problems.
> See the attached screenshots.
>
> When you edit a Python script such as widgets.py, if there is a
> corresponding .rsrc.py file (widgets.rsrc.py) then the codeEditor
> reads that
> file, provides a menu of all the components and when you select a
> component,
> it displays the events for that component.
>
> 1. What should the UI be for displaying components and events? Are the
> dropdown (Choice) menus fine?
>
> 2. How should events that have already been defined be indicated? I don't
> think I can do bold in the dropdown menu, so I'm thinking of
> sticking a + or
> * in front of an event that has been defined.
>
> 3. Should only the most common events be displayed with an option
> to display
> all events? Another possibility is to display the most common
> events at the
> top of the menu rather than showing all of the events in
> alphabetical order.
> I can't do either of these options without adding special hints to the
> supported events for each component, so neither would be in the first
> release.
>
> 4. The plan for the current code is to find and select an event handler if
> it exists, placing the cursor at the end of the line. If an event handler
> doesn't exist then a stub would be created. For example, selecting a
> component named 'btnSave' and an event named 'mouseClick' would
> result in a
> stub being created
>
> def on_btnSave_mouseClick(self, event):
> pass
>
> with the text 'pass' selected so that you can just start typing
> code if you
> want. The view would auto-scroll to show the method.
>
> 5. I have to figure out where to place the new handlers. At the
> beginning or
> more likely end of the class is one possibility. I haven't really figured
> out the regular expressions/parsing to decide what is what in the source.
> Another possibility is to try and group event handlers for a
> given component
> together.
>
> 6. I plan to check the modification date/time of the .rsrc.py file during
> idle so that changes would automatically be re-loaded. If you were working
> in the resourceEditor with the codeEditor open, your component list would
> automatically be updated. Other suggestions?
>
> 7. Should this be part of the standard codeEditor? Initially,
> I'll probably
> check it in as codeEditor2.py just so I can experiment with it and give
> other people a chance to try it without disturbing the stable
> codeEditory.py
> code.
>
> 8. On a related note, I'm thinking of making a resourceEditor
> that combines
> the codeEditor, so the events can show up in the Property Editor and the
> source code can be displayed in a separate window while you're in the
> resourceEditor. I haven't started that yet, but the IDE seems to be what a
> lot of people want. This would likely replace the existing resourceEditor.
>
> Feel free to bring up any other issues on this topic here.
>
> ka
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Pythoncard-users mailing list
Pythoncard-users@[...].net
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
Thread:
Kevin Altis
Kevin Altis
|