You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, June 6th 2016, 11:32am

altering the contextmenu, when vtourskin.xml is active [solved]

again lost in peril... (on krpano 1.19pr5)

i just ran into problems changing the contextmenu,
when i have included the standard vtourskin.xml

having this in one of my xmls

Source code

1
<contextmenu fullscreen="false" />

does not change the context menu at all.


next try was this:

Source code

1
2
3
<action name="contextmenu_init" autorun="preinit">
 for(set(i,0), i LT contextmenu.item.count, inc(i), set(contextmenu.item[get(i)].visible, false) );
	</action>

which works, but strangely still does NOT remove the Fullscreen item.

ofc i could modify the vtourskin.xml,
but i rather leave it as it is and work only with overrides in my xmls.

anybody with a solution for this?


for me it looks like the contextmenu property fullscreen does not have an effect,
if there is still an item with name fs present.

ps.
i also tried removearrayitem(), but it seems that this is only supported in js.

so, as a side question... is there a way to remove an array item with action code?

This post has been edited 5 times, last edit by "indexofrefraction" (Jun 7th 2016, 1:07pm)


2

Monday, June 6th 2016, 11:57am

Hi,

the caption=KRPANO and caption=FULLSCREEN are special items, their visible setting can not be changed.

That means it would be necessary to remove the items - here two possibilities:

Set the name of an array item to 'null' to remove to it:

Source code

1
2
3
<action name="contextmenu_init" autorun="preinit">
  loop(contextmenu.item.count GT 0, set(contextmenu.item[0].name, null); );
</action>


or use the removearrayitem function:

Source code

1
2
3
<action name="contextmenu_init" autorun="preinit">
  loop(contextmenu.item.count GT 0, contextmenu.item.removearrayitem(0), null); );
</action>


Btw - editing the vtourskin.xml itself would be also no problem of course.

Best regards,
Klaus

3

Monday, June 6th 2016, 1:08pm

thanks for the fast support, klaus!

this works now: (i didn't catch the array "prototype" functions, my bad)
interesting that it doesn't work when using contextmenu.item.count directly in the for() condition.

copy(j, contextmenu.item.count);
for(set(i,0), i LT j, inc(i), contextmenu.item.removearrayitem(0) );

anyway, for clearing all this is even simpler:

set(contextmenu.item.count, 0);

-----

by the way...
shouldnt this this ignore the font and use the native menu?

<contextmenu native="true" customstyle="MYFONT|....." />

4

Monday, June 6th 2016, 1:22pm

interesting that it doesn't work when using contextmenu.item.count directly in the for() condition.

copy(j, contextmenu.item.count);
for(set(i,0), i LT j, inc(i), contextmenu.item.removearrayitem(0) );
That code should work too...

anyway, for clearing all this is even simpler:

set(contextmenu.item.count, 0);
haha, of course - that's the even better solution ;-)

shouldnt this this ignore the font and use the native menu?

The native setting is a Flashplayer setting!

Best regards,
Klaus