Sie sind nicht angemeldet.

1

Mittwoch, 11. Januar 2012, 00:58

combobox : dynamic populate + dynamic action

Hi,

Here is the function to populate my combobox:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<action name="listScenes">       

if(%1 != NEXT,set(i,0);); 
		
		if(i LT scene.count,
			plugin[combobox].addIdItem(get(i),'get(scene[get(i)].title)', loadscene(get(scene[get(i)].name),null,MERGE,BLEND(1)); );
			inc(i);
			listScenes(NEXT);	
		  ); 

</action>


It populates well the titles, but when it come to action, it always try to load scene from the current i value, that is to say when you select an item, i always = scene.count+1.

How to do in order to have the item action to load the selected pano?

Thanks!

2

Donnerstag, 12. Januar 2012, 14:52

Hi,

get passed action 'get(scene[get(i)].title)' will be resolved then the item was clicked,
but then at this time, the 'i' variable is scene.count+1 of course,

to change that build the correct calling string and pass that,

e.g.

Quellcode

1
2
3
4
5
6
7
8
9
10
<action name="listScenes">
  if(%1 != NEXT, set(i,0));

  if(i LT scene.count,
	txtadd(callstring, 'loadscene(', get(scene[get(i)].name), ',null,MERGE,BLEND(1));');
	plugin[combobox].addIdItem(get(i), get(scene[get(i)].title), get(callstring) );
	inc(i);
	listScenes(NEXT);
  );
</action>


best regards,
Klaus