Page 1 of 1

Have a global leftclick action

PostPosted: Sun Jan 23, 2011 6:46 am
by cp4w
A global leftclick action

This means that I could define an action that would apply to any object that has a left click action. Any object leftclick would first execute this code.


An example where this would be useful is that if for some reason I wanted to trace and track what the user actualy did I could put the code in this section.
There is always a need to be able to do things globally

This could be done by defining a special subroutine like onopen and onclose by a custom window.

I would refien it further by having 2 global routines
- global start left click
- the local objects left click code
- global end left click


This could be done for right click as well.

PostPosted: Sun Jan 23, 2011 12:26 pm
by smartmedia
Hi..

Shx, why you don't just create a subroutine and call it.. Is the same thing...

Thanks

PostPosted: Sun Jan 23, 2011 1:52 pm
by cp4w
No.

I don't wan to have to go into each object and have it execute the sub routine.

It would be much easier if the was a way of specifying a global left click action.

PostPosted: Mon Jan 24, 2011 11:52 am
by Neosoft Support
So every object would execute the same script when clicked? Do you have a real world example where this would be useful?

PostPosted: Mon Jan 24, 2011 3:38 pm
by cp4w
It would go something like this.

- first it would execute the global start left click command
- then it would execute the objects left click command
- then it would execute the global end left click command

Example 1

I want to put in a switch in the registry to track exactly what the user is of the application is doing.
So I could put in code in the global left click to check if tracking is turned on and if it is I would save the time and the object [self] that was clicked.

If I want to play a click sound when an object is clicked, It would not have to be coded for each object

If I wanted to do a suspend on each object again it would be coded only once.

Also, as a personal preference in coding, there are many times that I want all the objects actions in one place to make it easy to copy and paste and to change stuff globally. so I might even have a gotoline that would go to the object name routine that was clicked. so it would start with gotoline [self] and if there was particular code for an object there it would execute it.