### Copyright (C) 1995, 1996, 1997 Jeppe Buk (buk@imada.ou.dk) ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### You should have received a copy of the GNU General Public License ### along with this program; if not, write to the Free Software ### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ### ### Mon Feb 23 1998 Japanized by Mashio Motoyama ### proc menus {} { # メニューとバインド / ポップアップメニュー Desc "ポップアップメニューの定義" ShortDesc "ポップアップメニュー" Header h -text "ポップアップメニュー" -frame:relief flat \ -help "このページではポップアップメニューの定義を行います。" Line l Entry pixmapDD -text "メニューの広域標準ピックスマップ" \ -help "ここではメニューエントリに何のピックスマップも指定されていない場合の、広域的に使われる標準ピックスマップを設定します(タイトルやセパレータなど)。" Radio placeDD -entries { "Left" "Top" } \ -help "テキストの左にピックスマップを置くならば 'Left' を選択します。同様にテキストの上に置きたければ 'Top' を選択します。" Frame f_pixmapDD -entries { pixmapDD placeDD } Line lineDD Entry popupName -text "ポップアップメニュー名" \ -help "このポップアップメニューの名前を入力します。" Entry pixmapD -text "標準ピックスマップ" \ -help "このメニューで使われる標準のピックスマップを入力します。これは上記の広域標準ピックスマップを上書きします。" Radio placeD -entries { "Left" "Top" } \ -help "ピックスマップをテキストの左に置くならば 'Left' を選択し、上に置くならば 'Top' を選択します。" Frame f_pixmapD -entries { pixmapD placeD } Radio place -entries { "L" "T" } \ -help "ピックスマップをテキストの左に置くならば 'Left' を選択し、上に置くならば 'Top' を選択します。"\ -packSubFrame:side top Entry pixmap -text "ピックスマップ" \ -help "このメニューで使うピックスマップを入力します。" \ -packLabel:side top Entry name -text "名前" \ -help "メニューでの名前を入力します。" \ -packLabel:side top global Builtins ComboBox builtinCall -noedit 1 -text "組み込み関数" -default Beep \ -entryhelp $Builtins \ -help "これが呼び出す組み込みコマンドを設定します。" \ -packLabel:side top Entry arguments -text "引数" \ -help "付加的な引数を記述します(その文法はあなたの自身が責任を持って下さい)。そのコマンドのヘルプを見て下さい。"\ -packLabel:side top ExtEntry popupEntry -entries {place pixmap name builtinCall arguments} \ -count 5 ExtEntry popup -lines 1 -entries { popupName f_pixmapD popupEntry } \ -orient top -index popupName -count 1 Label funcArgs -justify left -wraplength 600 Change { if {$changeElm == "builtinCall"} { set bcindex -1 set found "no" foreach bc $Builtins { incr bcindex if {$bc == $builtinCall} { set found "yes" break } } if {$found == "yes"} { set help [lindex $Builtins [expr $bcindex + 1]] } else { set help "\[Help not found\]" } set funcArgs "\"$builtinCall\" のヘルプ:\n$help" eval "[pick [funcWithArgs $builtinCall] Enable Disable] arguments" } } ShowPage { set funcArgs "" } Change { if {$changeElm == "pixmap"} { if {$pixmap == ""} {Disable place} else {Enable place} } if {$changeElm == "pixmapD"} { if {$pixmapD == ""} {Disable placeD} else {Enable placeD} } if {$changeElm == "pixmapDD"} { if {$pixmapDD == ""} {Disable placeDD} else {Enable placeDD} } } Save { forevery popup { if {$popupName != {}} { print "AddToMenu \"$popupName\"" forevery popupEntry { if { $pixmap != "" && $place(name) == "L" } { set Gname "%$pixmap%$name" } elseif { $pixmap != "" && $place(name) == "T" } { set Gname "*$pixmap*$name" } elseif { $builtinCall != "Title" && $builtinCall != "Nop" } { # Titles and Nops shouldn't use default pixmaps if { $pixmapD != "" && $placeD(name) == "Left" } { set Gname "%$pixmapD%$name" } elseif { $pixmapD != "" && $placeD(name) == "Top" } { set Gname "*$pixmapD*$name" } elseif { $pixmapDD != "" && $placeDD(name) == "Left" } { set Gname "%$pixmapDD%$name" } elseif { $pixmapDD != "" && $placeDD(name) == "Top" } { set Gname "*$pixmapDD*$name" } else { set Gname $name } } else { set Gname $name } print "+\t\"$Gname\"\t$builtinCall $arguments" } } } } }