Revision: 8637 https://osdn.net/projects/ttssh2/scm/svn/commits/8637 Author: zmatsuo Date: 2020-03-28 00:47:12 +0900 (Sat, 28 Mar 2020) Log Message: ----------- テストの文字列に日本語や韓国語をいれた - gui_commands_test_utf8.ttl は削除 - gui_commands_test.ttl に統合 Modified Paths: -------------- branches/unicode_macro_2/tests/gui_commands_test.ttl Removed Paths: ------------- branches/unicode_macro_2/tests/gui_commands_test_utf8.ttl -------------- next part -------------- Modified: branches/unicode_macro_2/tests/gui_commands_test.ttl =================================================================== --- branches/unicode_macro_2/tests/gui_commands_test.ttl 2020-03-27 15:47:02 UTC (rev 8636) +++ branches/unicode_macro_2/tests/gui_commands_test.ttl 2020-03-27 15:47:12 UTC (rev 8637) @@ -9,10 +9,9 @@ call test_passwordbox call test_statusbox call test_macrodialogbox -type = 1 call test_listbox -type = 2 -call test_listbox +call test_filenamebox +call test_dirnamebox messagebox "finish all tests" "test" end @@ -19,9 +18,9 @@ ;;;;;;;;;;;;;;;; ;;; messagebox :test_messagebox -s = "messagebox test\nthis is basic test\n3 lines" +s = "メッセージボックス\nthis is basic test\n3 행" strspecial s -messagebox s "test messagebox" +messagebox s "メッセージボックス" messagebox "finish messagebox test" "test messagebox" return @@ -43,7 +42,7 @@ yes = 0 no = 0 while ((yes == 0) or (no == 0)) - yesnobox "push yes or no" "test yesnobox" + yesnobox "push 是的(yes) or 没有(no)" "test yesnobox" if result == 1 yes = yes + 1 if result == 0 no = no + 1 sprintf "yes=%d no=%d" yes no @@ -63,9 +62,9 @@ s = "default string" match = 0 while match == 0 - inputbox "input `ok` to finish" "test inputbox" s + inputbox "入力 `ok` to finish" "test inputbox" s s = inputstr - sprintf "input string is `%s`" s + sprintf "入力文字列 は `%s`" s messagebox inputstr "test inputbox" strmatch s "^ok$" match = result @@ -80,9 +79,9 @@ :test_passwordbox match = 0 while match == 0 - passwordbox "input `password` to finish" "test passwordbox" + passwordbox "`password` と入力すると終了" "test passwordbox" s = inputstr - sprintf "input string is `%s`" s + sprintf "入力文字列 は `%s`" s messagebox inputstr "test inputbox" strmatch s "^password$" match = result @@ -98,7 +97,7 @@ ;;; messagebox :test_statusbox call test_statusbox_centerwindow -call test_statusbox_setdlgpos +;call test_statusbox_setdlgpos return ; 表示されていない→表示する 時 センタリングされる @@ -203,21 +202,19 @@ ;;; messagebox :test_listbox N = 7 -if type == 1 then - intdim done N - strdim strs N - strdim srcs N -endif +intdim done N +strdim strs N +strdim srcs N for i 0 N-1 done[i] = 0 next -srcs[0] = "No man should understand where his dreams come from, Data. (Soong to Data, Birthright pt. 1)" -srcs[1] = "The Advocate will refrain from making her opponent disappear. (Data to Ardra, Devil's Due)" -srcs[2] = "He's comparing the Enterprise to a cruise ship? (Picard, The Neutral Zone)" -srcs[3] = "What's the first rule of acquisition?" -srcs[4] = "Once you have their money, you never give it back." -srcs[5] = "Don't thank me, I already regret it. (Odo)" -srcs[6] = "How long can two people talk about nothing? (Deanna, Starship Mine) " +srcs[0] = "本気の失敗には価値がある" +srcs[1] = "俺の敵は だいたい俺です" +srcs[2] = "ちょっとだけ無理なことに挑戦してこーぜ" +srcs[3] = "リーダーというのはやはり安心と興奮を同時にくれる" +srcs[4] = "”止まる”も”進む”もコントロールするのはお前だ" +srcs[5] = "どっちが楽しいかで決めなさい。" +srcs[6] = "悩むなら、なってから悩みなさい" done_all = 0 done_cancel = 0 prev = 0 @@ -239,11 +236,6 @@ else msg = "push `cancel`" endif - if type == 2 then - strconcat msg "===================================================================================================" - strconcat msg "\n=\n=\n" - strspecial msg - endif listbox msg "test listbox" strs prev if result < 0 then done_cancel = 1 @@ -266,4 +258,29 @@ messagebox "finish listbox test" "test listbox" return +;;;;;;;;;;;;;;;; +;;; filenamebox +;;; - Dependence +;;; messagebox +:test_filenamebox +filenamebox "ファイルを選んでください(load)" 0 "c:\" +sprintf2 s "result %d inputstr %s" result inputstr +messagebox s "test fienamebox" +filenamebox "ファイルを選んでください(save)" 1 "c:\windows" +sprintf2 s "result %d inputstr %s" result inputstr +messagebox s "test fienamebox" +messagebox "finish filenaebox test" "test filenamebox" +return +;;;;;;;;;;;;;;;; +;;; dirnamebox +;;; - Dependence +;;; messagebox +:test_dirnamebox +dirnamebox "whereディレクトリ" "c:\" +sprintf2 s "result %d inputstr %s" result inputstr +messagebox s "test fienamebox" +messagebox "finish dirnamebox test" "test dirnambox" +return + + Deleted: branches/unicode_macro_2/tests/gui_commands_test_utf8.ttl =================================================================== --- branches/unicode_macro_2/tests/gui_commands_test_utf8.ttl 2020-03-27 15:47:02 UTC (rev 8636) +++ branches/unicode_macro_2/tests/gui_commands_test_utf8.ttl 2020-03-27 15:47:12 UTC (rev 8637) @@ -1,286 +0,0 @@ -;;; -;;; test gui commands -;;; -; -call test_messagebox -call test_errordialogbox -call test_yesnobox -call test_inputbox -call test_passwordbox -call test_statusbox -call test_macrodialogbox -call test_listbox -call test_filenamebox -call test_dirnamebox -messagebox "finish all tests" "test" -end - -;;;;;;;;;;;;;;;; -;;; messagebox -:test_messagebox -s = "メッセージボックス\nthis is basic test\n3 행" -strspecial s -messagebox s "メッセージボックス" -messagebox "finish messagebox test" "test messagebox" -return - -;;;;;;;;;;;;;;;; -;;; error dialog -;;; - Dependence -;;; messagebox -:test_errordialogbox -messagebox "Please push `continue` button in next window" "test errordialogbox" -this_line_is_error_push_continue -messagebox "finish error dialog test" "test error dialog" -return - -;;;;;;;;;;;;;;;; -;;; yesnobox -;;; - Dependence -;;; messagebox -:test_yesnobox -yes = 0 -no = 0 -while ((yes == 0) or (no == 0)) - yesnobox "push 是的(yes) or 没有(no)" "test yesnobox" - if result == 1 yes = yes + 1 - if result == 0 no = no + 1 - sprintf "yes=%d no=%d" yes no - messagebox inputstr "test yesnobox" -endwhile -sprintf "finish yesnobox test\nyes=%d no=%d" yes no -s = inputstr -strspecial s -messagebox s "test yesnobox" -return - -;;;;;;;;;;;;;;;; -;;; inputbox -;;; - Dependence -;;; messagebox -:test_inputbox -s = "default string" -match = 0 -while match == 0 - inputbox "入力 `ok` to finish" "test inputbox" s - s = inputstr - sprintf "入力文字列 は `%s`" s - messagebox inputstr "test inputbox" - strmatch s "^ok$" - match = result -endwhile -messagebox "finish inputbox test" "test inputbox" -return - -;;;;;;;;;;;;;;;; -;;; passwordbox -;;; - Dependence -;;; messagebox -:test_passwordbox -match = 0 -while match == 0 - passwordbox "`password` と入力すると終了" "test passwordbox" - s = inputstr - sprintf "入力文字列 は `%s`" s - messagebox inputstr "test inputbox" - strmatch s "^password$" - match = result -endwhile -messagebox "finish passwordbox test" "test passwordbox" -return - -;;;;;;;;;;;;;;;; -;;; statusbox -;;; setdlgpos -;;; closesbox -;;; - Dependence -;;; messagebox -:test_statusbox -call test_statusbox_centerwindow -;call test_statusbox_setdlgpos -return - -; 表示されていない→表示する 時 センタリングされる -; 表示されている時 width=変化しない height=変化する(フィット) pos=変化しない -:test_statusbox_centerwindow -pause_time = 3 -statusbox "statusbox message" "test statusbox" -pause pause_time -sprintf2 s "1 line1\n2 line2 \n3 line3\n4 long long long long long line" -strspecial s -statusbox s "test statusbox" -pause pause_time -closesbox -statusbox s "test statusbox" -pause pause_time -statusbox "statusbox message" "test statusbox" -pause pause_time -closesbox -statusbox "statusbox message" "test statusbox" -pause pause_time -closesbox -messagebox "finish statusbox centerwindow test" "test statusbox" -return - -:test_statusbox_setdlgpos -pause_time = 1 -last_val = 3 -statusbox "statusbox message" "test statusbox" -pause pause_time -for i 1 last_val - x = i*10 - y = i*10 - setdlgpos x y - sprintf2 s "setdlgpos\ni=%d/%d\n(%d,%d)" i last_val x y - strspecial s - statusbox s "test statusbox/setdlgpos" - pause pause_time -next -closesbox -s = "Please overwrap other window\nwait 5 sec\nbringupbox test" -strspecial s -setdlgpos 0 0 -statusbox s "test statusbox" -pause 5 -bringupbox -statusbox "bringupbox" "test statusbox" -pause 5 -closesbox -setdlgpos -10000 0 ; go center -messagebox "finish statusbox setdlgpos test" "test statusbox" -return - -;;;;;;;;;;;;;;;; -;;; macrodialog box -;;; show -;;; - Dependence -;;; messagebox -:test_macrodialogbox -call test_macrodialogbox_show -call test_macrodialogbox_move_resize -messagebox "finish macro dialogbox test" "test macro dialogbox" -return - -:test_macrodialogbox_show -N = 5 -intdim show_flag_list N -show_flag_list[0] = 1 -show_flag_list[1] = -1 -show_flag_list[2] = 1 -show_flag_list[3] = 0 -show_flag_list[4] = 1 -for i 0 N-1 - show_flag = show_flag_list[i] - show show_flag - if show_flag < 0 then - s = "macro dialog box was hidden\ncheck task bar" - elseif show_flag == 0 then - s = "macro dialog box was minimize\ncheck task bar" - elseif show_flag > 0 then - s = "macro dialog box was shown\nmove this messagebox and check macro dialog box" - endif - sprintf "show %d\n%s" show_flag s - s = inputstr - strspecial s - messagebox s "test macrodialog/show" -next -return - -:test_macrodialogbox_move_resize -w = 15 -sprintf "move and resize test\nwait %d sec" w -s = inputstr -strspecial s -messagebox s "test macro dialog" -pause w -messagebox "finish move and resize test" "test macro dialog/move and resize" -return - -;;;;;;;;;;;;;;;; -;;; listbox -;;; - Dependence -;;; messagebox -:test_listbox -N = 7 -intdim done N -strdim strs N -strdim srcs N -for i 0 N-1 - done[i] = 0 -next -srcs[0] = "本気の失敗には価値がある" -srcs[1] = "俺の敵は だいたい俺です" -srcs[2] = "ちょっとだけ無理なことに挑戦してこーぜ" -srcs[3] = "リーダーというのはやはり安心と興奮を同時にくれる" -srcs[4] = "”止まる”も”進む”もコントロールするのはお前だ" -srcs[5] = "どっちが楽しいかで決めなさい。" -srcs[6] = "悩むなら、なってから悩みなさい" -done_all = 0 -done_cancel = 0 -prev = 0 -while ((done_all == 0) or (done_cancel == 0)) - for i 0 N-1 - if done[i] == 0 then - s = "" - else - s = "[selected]" - endif - sprintf2 s "%s %s" s srcs[i] - strs[i] = s - next - if done_all == 0 then - msg = "select one from list and `ok`" - if done_cancel == 0 then - strconcat msg " or `cancel`" - endif - else - msg = "push `cancel`" - endif - listbox msg "test listbox" strs prev - if result < 0 then - done_cancel = 1 - continue - endif - prev = result - if done[result] == 0 then - done[result] = 1 - else - done[result] = 0 - endif - done_all = 1 - for i 0 N-1 - if done[i] == 0 then - done_all = 0 - break - endif - next -endwhile -messagebox "finish listbox test" "test listbox" -return - -;;;;;;;;;;;;;;;; -;;; filenamebox -;;; - Dependence -;;; messagebox -:test_filenamebox -filenamebox "ファイルを選んでください(load)" 0 "c:\" -sprintf2 s "result %d inputstr %s" result inputstr -messagebox s "test fienamebox" -filenamebox "ファイルを選んでください(save)" 1 "c:\windows" -sprintf2 s "result %d inputstr %s" result inputstr -messagebox s "test fienamebox" -messagebox "finish filenaebox test" "test filenamebox" -return - -;;;;;;;;;;;;;;;; -;;; dirnamebox -;;; - Dependence -;;; messagebox -:test_dirnamebox -dirnamebox "whereディレクトリ" "c:\" -sprintf2 s "result %d inputstr %s" result inputstr -messagebox s "test fienamebox" -messagebox "finish dirnamebox test" "test dirnambox" -return - -