2015-04-01 30 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

相關問題