2015-04-01 56 views
-2

如何在popu菜单中将此选项1,选项2,选项3更改为特殊字(通过数组中的变量传递)。无需使用弹出式属性菜单。意思是:数组svar [2]的内容而不是选择1 数组的内容svar [3]而不是选择2 ..等等。 所以每次选择1的值,选择2都会有所不同。 全局searchStr全局replaceStr全局Ftext全局myArrayToBe全局myArraylength全局gvar on menuPick pItemName将(myArrayToBe的键)的行数放入myArraylength中 如果myArrayToBe [i]包含Ftext,则将i = 1重复为myArraylength,然后将myArrayToBe [i ]转换成Svar的答案Svar分割Svar的冒号把Svar [2]转换成gvar答案gvar end如果结束重复切换pItemName把gvar转换成pitemName的情况gvar的答案Ftext break case“Choice 2”answer“bye”break case“Choice 3”answer“请”破发结束开关结束menuPick如何在弹出式菜单项中分配值而不是选择在livecode中选择1选择2

+1

Pleasesplityourquestionintoparagraphsandusether estofthetoolstoformatitcorrectly。 Walloftextsarenoteasytoread。 – 2015-04-01 13:31:39

回答

0

很难看到你的问题你问的,但你可以通过使用the text of button

如果要更改设置的菜单选项在运行菜单当用户点击,你可以做的是,在on mouseDown处理:

on mouseDown 
    set the text of me to "One" & return & "Two" & return & "three" 
end mouseDown 

如果再有一个全局变量SVAR,想填充菜单只是当它即将被显示,你可以这样做也:

on mouseDown 
    global sVar 
    put sVar into tVar # Copy array 
    combine tVar with return 
    set the text of me to tVar 
end mouseDown 

如果你想改变一个基于阵列sVar前两个方案,你可以使用:

put the text of button "myMenuButton" into tText 
put sVar[1] into line 1 of tText 
put sVar[2] into line 2 of tText 
set the text of button "myMenuButton" to tText 
+0

我需要通过在变量中传递文本来更改弹出菜单中选项1,选项2的文本。 – Zam 2015-04-02 06:30:02

相关问题