Script on grouped object doesn't work ?

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Nicolas2121
Posts: 19
Joined: Fri Apr 12, 2013 11:00 am

Script on grouped object doesn't work ?

Post by Nicolas2121 »

Hello,

Can I execute a script event on a grouped object ?

I have a button and a rectangle which are grouped. When I want to execute a "MouseDown" event script of this object, it doesn't work, but if I execute this script on "MouseDown" event of the rectangle or the button, it works. Why ?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Script on grouped object doesn't work ?

Post by mark.monroe »

Which version of iX are you using? The latest version 2.0.463 seems to work as expected. I know that in Version 1.31 of iX there was a bug in the groups that may cause what you are seeing.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Nicolas2121
Posts: 19
Joined: Fri Apr 12, 2013 11:00 am

Re: Script on grouped object doesn't work ?

Post by Nicolas2121 »

I have the version 2.0.463, so I don't understand.

Have you an idea ?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Script on grouped object doesn't work ?

Post by mark.monroe »

You shouldn't use actions and scripts at the same time. I would create some new objects and group them.

Putting the script code in the MouseDown event of the individual object will not work most likely.

Code: Select all

		void Group1_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e)
		{
			Globals.Screen2.Show();
		}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Nicolas2121
Posts: 19
Joined: Fri Apr 12, 2013 11:00 am

Re: Script on grouped object doesn't work ?

Post by Nicolas2121 »

I don't use actions and scripts at the same time.

I did the test with a script on "MouseDown" event of the grouped object, and after, the same script on "MouseDown" event of the rectangle of this grouped object.

I have noticed that the script worked only on parts of sub objects of the grouped object. But I need do run the script on the one that is grouped.

Post Reply