Jump to content
uniGUI Discussion Forums
Daryl McMurray

Client Events Editor - Help please

Recommended Posts

I am trying to find out how to access the list of possible ClientEvents javascript events for a given UniGui Control.  How does the ClientEvents property editor know what they are?

 

I am building a more functional Property editor for ClientEvents - I find I spend a lot of time searching through js events that I don't care about to get to the ones I've already initiated and just want to tweak.

 

I've created an editor that adds to the context menu (right Click Menu) in the IDE and lists all the existing js events (Ext and Uni) and then can take you directly to that event for editing.  Once the editor is up, you can also quickly get to all other existing events for both Ext and Uni - 

 

I have also made this editor non modal so that you can have several open at a time and switch between them and the form editor and code.  (I also spend a lot of time opening the ClientEvents editor, finding an event, copying some code, closing it then going to another component, opening its ClientEvents editor, finding an event and pasting code.)  This now lets me copy and paste js code bits easily from one component to any other.  I have also added an "Apply" changes function so that I can save the change back to the component and run/test the project without having to close the editor.

 

The only thing stopping me from replacing the default ClientEvents property editor is that I can not figure out how to get the list of all possible events for a given component class.  So, I can edit existing ones that were created with the default editor, but I can't properly Add New ones...   I've searched through all the source code that came with my purchased version, but I have either missed where the possible js event names come from, or it isn't included.

 

For now, I just have a button that launches the default editor for me so I can add an event and then return to my simplified editor.  

 

Any thoughts?  I'd be happy to post and share my finished editor here - it is all contained in a single form file and easy to install.

 

I've included some images to show how it works/looks.

 

post-5050-0-77321600-1518278854_thumb.jpgpost-5050-0-52206000-1518278861_thumb.jpg

Share this post


Link to post
Share on other sites

Dayrl, I am interested in what you are doing.

 

Are you happy to share your code ?

 

Andy - Australia

Share this post


Link to post
Share on other sites

Hi Andy - Yes, I will share my code for the editor once I have tested it a bit more under fire.  I will post it to the "Components and Code Samples" form and notify here that I have done so.

 

I would really like to be able to use it to add Client Events too though... does anyone know where the component ClientEvents possibilities list comes from?  I'm hoping they are not just stored in the ClientEvents Property editor.

Share this post


Link to post
Share on other sites

I believe I have found them! It's going to take some time to code though... I have to access the JSObjects array of a given component (which is protected)... and then locate the correct Resource String in the ExtJS.RES file, parse that out for the events, and then construct a JSfunction prototype...   Here goes :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×