### 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 functions {} { # メニューとバインド / 関数定義 Desc "メニューやバインドで使われる関数の定義" ShortDesc "関数定義" Header functionsH -text "関数定義" -frame:relief flat \ -help "このページではバインドで使う関数の定義を行います。" Header description -text " 二つの特別な関数を作成できます。\n"\ " それは 'InitFunction' と 'RestartFunction' です。\n"\ " Dotfile Generator のヘルプを参照して下さい。" Entry functionName -text "関数名" \ -help "この関数の名前を入力します。" global Builtins ComboBox builtinCall -noedit 1 -text "組み込み関数" -default Beep \ -entryhelp $Builtins \ -help "このメニューから呼び出される組み込み関数を入力します。" Menu events -text "イベント" -entryhelp { Immediate "このコマンドをすぐに実行する" \ Motion "このコマンドをマウスの動作に従って実行する" \ Click "このコマンドをマウスのクリックによって実行する" \ DoubleClick "このコマンドをマウスのダブルクリックによって実行する" } \ -help "このコマンドの実行を引き起こすイベントを選択します。" Entry arguments -text "引数" \ -help "付加的な引数を記述します(その文法はあなたの自身が責任を持って下さい)。そのコマンドのヘルプを見て下さい。" ExtEntry functionEntry -count 10 -entries {builtinCall events arguments} ExtEntry function -entries {functionName functionEntry} -count 1 \ -orient top -index functionName 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 "" } Save { forevery function { if {$functionName != {}} { print "AddToFunc \"$functionName\"" forevery functionEntry { if {[funcWithArgs $builtinCall]} { print "+\t\"[string index $events(name) 0]\"\t$builtinCall $arguments" } else { print "+\t\"[string index $events(name) 0]\"\t$builtinCall" } } } } } }