home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 November
/
VPR9711A.ISO
/
VPR_DATA
/
Special
/
Tmedt180
/
tmedt180.exe
/
TM_HM.CWS
< prev
next >
Wrap
Text File
|
1997-08-25
|
21KB
|
612 lines
@echo off
#----------------------------------#
# メインウィンンドのハンドルを取得 #
#----------------------------------#
window get main -&eax
let hwndMain=%eax%
#----------------------#
# 以前のリソースを削除 #
#----------------------#
menubar get %hwndMain% -&eax
let hMenu=%eax%
menubar set %hwndMain% 0
menubar destory %hMenu%
menubar draw %hwndMain%
menubar getpopup %hwndMain% -&eax
let hPopMenu=%eax%
menubar destory %hPopMenu%
toolbar get %hwndMain% -&eax
let hTBar=%eax%
toolbar destory %hTBar%
functionkey get %hwndMain% -&eax
let hFKey=%eax%
functionkey destroy %hFKey%
accelkey get %hwndMain% -&eax
let hAccel=%eax%
accelkey destroy %hAccel%
strokekey get %hwndMain% -&eax
let hStroke=%eax%
strokekey destroy %hStroke%
#------------------#
# 表示属性を決める #
#------------------#
let @ Hex = %hwndMain% ^| 0
#setwindowpos %Hex% 0 0 0 640 480 0006
console size 0
window sdi
set tm.win.tbar=1 ; toolbar show
set tm.win.fkey=1 ; functionkey show
set tm.con.hsb=0 ; console scrollbar horz hide
set tm.con.vsb=1 ; console scrollbar vert show
set tm.edt.hsb=0 ; edit scrollbar horz hide
set tm.edt.vsb=1 ; edit scrollbar vert show
set tm.edt.line=0 ; edit mode noline
set tm.edt.ruler=1 ; edit mode ruler
window get edit -&eax
window set focus %eax%
#mode edit font "-f:FixedSys"
#mode edit color -fg:0x000000 -bg:0xFFFFFF -ctl:0x808000
#--------------------#
# メニューバーの登録 #
#--------------------#
menubar create -&eax
let hMenu=%eax%
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "ファイル(&F)"
menubar append %hPopMenu% 0x0000 "tmNew" "新規作成(&N)"
menubar append %hPopMenu% 0x0000 "tmOpen" "開く(&O)..."
menubar append %hPopMenu% 0x0000 "tmLoad" "閉じて開く(&L)..."
menubar append %hPopMenu% 0x0000 "tmSave" "上書き保存(&S)"
menubar append %hPopMenu% 0x0000 "tmSaveAs" "名前を付けて保存(&A)..."
menubar append %hPopMenu% 0x0001 "tmDummy" "カーソル位置への読み込み(&I)..."
menubar append %hPopMenu% 0x0000 "tmPrint" "印刷(&P)..."
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmQuit" "保存して終了(&E)"
menubar append %hPopMenu% 0x0000 "tmQuit" "終了(&X)"
menubar append %hPopMenu% 0x0001 "tmDummy" "全保存終了(&T)"
menubar append %hPopMenu% 0x0001 "tmDummy" "全終了(&Q)"
menubar append %hPopMenu% 0x0800 -1 0
for (i = 1; $i <= 5; i++)
edit logfile get %i% -&tm.logfile
menubar append %hPopMenu% 0 "tmLogFile %i%" "%tm.logfile%"
set @ tm.logfile[%i%] = $tm.logfile
end
set tm.logfile=
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "編集(&E)"
menubar append %hPopMenu% 0x0000 "tmUndo" "やり直し(&U) Alt+Bksp"
menubar append %hPopMenu% 0x0001 "tmDummy" "やり直しのやり直し(&R) Shift+Alt+Bksp"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmCut" "切り抜き(&T) F7"
menubar append %hPopMenu% 0x0000 "tmCopy" "コピー(&C) F8"
menubar append %hPopMenu% 0x0001 "tmDummy" "追加切り抜き(&W) Shift+F7"
menubar append %hPopMenu% 0x0001 "tmDummy" "追加コピー(&A) Shift+F8"
menubar append %hPopMenu% 0x0000 "tmPaste" "貼り付け(&P) F9"
menubar append %hPopMenu% 0x0000 "tmDel" "削除(&L) Del"
menubar append %hPopMenu% 0x0001 "tmDummy" "変換(&V)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmSelect" "すべてを選択(&S)"
menubar append %hPopMenu% 0x0001 "tmDummy" "クリップボード履歴(&H)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0001 "tmDummy" "最初からやり直し(&O)"
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "検索(&S)"
menubar append %hPopMenu% 0x0000 "tmFind" "検索(&F)... Ctrl+F"
menubar append %hPopMenu% 0x0000 "tmFindLeft" "上候補(&P) Ctrl+P"
menubar append %hPopMenu% 0x0000 "tmFindRight" "下候補(&N) Ctrl+N"
menubar append %hPopMenu% 0x0000 "tmReplace" "置換(&R)... Ctrl+R"
menubar append %hPopMenu% 0x0001 "tmDummy" "検索開始位置へ戻る(&S)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmJump" "指定行(&J)... Ctrl+J"
menubar append %hPopMenu% 0x0001 "tmDummy" "最後に編集した所(&L) Ctrl+L"
menubar append %hPopMenu% 0x0000 "tmTop" "ファイルの先頭(&T) Ctrl+Home"
menubar append %hPopMenu% 0x0000 "tmBottom" "ファイルの最後(&B) Ctrl+End"
menubar append %hPopMenu% 0x0001 "tmDummy" "編集マークの上検索(&U)"
menubar append %hPopMenu% 0x0001 "tmDummy" "編集マークの下検索(&D)"
menubar append %hPopMenu% 0x0001 "tmDummy" "前のカーソル位置(&V)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0001 "tmDummy" "マーク一覧(&M) Ctrl+M"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmGrep" "grepの実行(&G)..."
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "ウィンドウ(&W)"
menubar append %hPopMenu% 0x0000 "tmExec" "縦に並べる(&V)"
menubar append %hPopMenu% 0x0001 "tmDummy" "横に並べる(&H)"
menubar append %hPopMenu% 0x0001 "tmDummy" "重ねて表示(&C)"
menubar append %hPopMenu% 0x0001 "tmDummy" "並べて表示(&T)"
menubar append %hPopMenu% 0x0001 "tmDummy" "全部アイコン化(&N)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0000 "tmExec" "2つに分割(&D)"
menubar append %hPopMenu% 0x0001 "tmDummy" "同時スクロール(&L)"
menubar append %hPopMenu% 0x0001 "tmDummy" "内容比較(&F)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0001 "tmDummy" "デスクトップ保存(&S)"
menubar append %hPopMenu% 0x0001 "tmDummy" "デスクトップ復元(&R)"
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "マクロ(&M)"
menubar append %hPopMenu% 0x0000 "tmKeyMacR" "キー操作の記録開始/終了(&R) Shift+F1"
menubar append %hPopMenu% 0x0000 "tmKeyMacP" "キー操作の再生(&P) Shift+F2"
menubar append %hPopMenu% 0x0000 "tmDummy" "キー操作の保存(&S)..."
menubar append %hPopMenu% 0x0000 "tmDummy" "キー操作の読込み(&L)..."
menubar append %hPopMenu% 0x0001 "tmDummy" "マクロ実行(&X)..."
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0x0001 "tmDummy" "マクロ登録(&E)..."
menubar append %hPopMenu% 0x0001 "tmDummy" "マクロヘルプ(&H)..."
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hMenu% 0x0010 %hPopMenu% "その他(&O)"
menubar createpopup -&eax
let hPop2Menu=%eax%
menubar append %hPopMenu% 0x0010 %hPop2Menu% "設定(&C)"
menubar append %hPop2Menu% 0x0000 "tmDisp" "画面の設定(&D)..."
menubar append %hPop2Menu% 0x0000 "tmIndent" "インデント追加/なし(&I)"
menubar append %hPop2Menu% 0x0000 "tmFont" "フォント(&F)..."
menubar append %hPop2Menu% 0x0000 "tmBgColor" "背景色(&B)..."
menubar append %hPop2Menu% 0x0000 "tmCtlColor" "制御文字色(&C)..."
menubar append %hPop2Menu% 0x0000 "tmLnColor" "行番号(&L)..."
menubar createpopup -&eax
let hPop2Menu=%eax%
menubar append %hPopMenu% 0x0010 %hPop2Menu% "動作環境(&F)"
menubar append %hPop2Menu% 0x0000 "tmTBar" "ツールバー標示/非表示"
menubar append %hPop2Menu% 0x0000 "tmFKey" "ファンクションキー標示/非表示"
menubar append %hPop2Menu% 0x0000 "tmEdtHS" "エディットスクロールバー水平表示/非表示"
menubar append %hPop2Menu% 0x0000 "tmEdtVS" "エディットスクロールバー垂直表示/非表示"
menubar append %hPop2Menu% 0x0000 "tmConHS" "コンソールスクロールバー水平表示/非表示"
menubar append %hPop2Menu% 0x0000 "tmConVS" "コンソールスクロールバー垂直表示/非表示"
menubar append %hPopMenu% 0x0001 "tmDummy" "キー割り当て(&K)..."
menubar append %hPopMenu% 0x0001 "tmDummy" "ユーザーメニュー編集(&M)..."
menubar append %hPopMenu% 0x0001 "tmDummy" "外部ヘルプ(&H) Ctrl+F1"
menubar append %hPopMenu% 0x0001 "tmDummy" "タグジャンプ(&T) F10"
menubar append %hPopMenu% 0x0001 "tmDummy" "ダイレクトダグジャンプ(&D) Ctrl+F10"
menubar append %hPopMenu% 0x0001 "tmDummy" "バッグタグジャンプ(&B) Shift+F10"
menubar append %hPopMenu% 0x0000 "tmExec" "制御コード入力(&I)"
menubar append %hPopMenu% 0x0000 "tmHelpCmd" "関数一覧(&L)... F11"
menubar append %hPopMenu% 0x0001 "tmDummy" "tagsファイルの作成(&G)..."
menubar append %hPopMenu% 0x0000 "tmExec" "コマンド実行(&X)..."
menubar append %hPopMenu% 0x0000 "tmView" "閲覧モード(&R)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0 "tmContent" "目次(&C)"
menubar append %hPopMenu% 0x0800 -1 0
menubar append %hPopMenu% 0 "tmAbout" "バージョン情報(&A)..."
menubar append %hPopMenu% 0 "tmRegist" "ユーザー登録(&R)..."
menubar set %hwndMain% %hMenu%
menubar draw %hwndMain%
#--------------------------#
# ファンクションキーの登録 #
#--------------------------#
functionkey create -&eax
let hFKey=%eax%
functionkey append %hFKey% 0x00 0x70 "tmContent" "ヘルプ"
functionkey append %hFKey% 0x00 0x74 "tmCopy" "単語をコピー"
functionkey append %hFKey% 0x00 0x75 "tmBlock" "選択開始"
functionkey append %hFKey% 0x00 0x76 "tmCut" "切り抜き"
functionkey append %hFKey% 0x00 0x77 "tmCopy" "コピー"
functionkey append %hFKey% 0x00 0x78 "tmPaste" "貼り付け"
#functionkey append %hFKey% 0x00 0x79 "tmDummy" "タグジャンプ"
functionkey append %hFKey% 0x00 0x7A "tmHelpCmd" "関数一覧..."
functionkey append %hFKey% 0x00 0x7B "tmLine" "行番号表示/非表示"
functionkey append %hFKey% 0x04 0x70 "tmKeyMacR" "記録開始/記録終了"
functionkey append %hFKey% 0x04 0x71 "tmKeyMacP" "再生"
functionkey append %hFKey% 0x04 0x74 "tmCopy" "行をコピー"
#functionkey append %hFKey% 0x04 0x75 "tmDummy" "BOX選択開始"
#functionkey append %hFKey% 0x04 0x76 "tmDummy" "追加切り抜き"
#functionkey append %hFKey% 0x04 0x77 "tmDummy" "追加コピー"
#functionkey append %hFKey% 0x04 0x78 "tmDummy" "BOX貼り付け"
#functionkey append %hFKey% 0x04 0x79 "tmDummy" "バックタグジャンプ"
#functionkey append %hFKey% 0x08 0x70 "tmDummy" "外部ヘルプ"
#functionkey append %hFKey% 0x08 0x73 "tmDummy" "ファイルを閉じる"
#functionkey append %hFKey% 0x08 0x79 "tmDummy" "ダイレクトタグジャンプ"
#functionkey append %hFKey% 0x0C 0x70 "tmDummy" "外部ヘルプ2"
#------------------#
# ツールバーの登録 #
#------------------#
toolbar create -&eax
let hTBar=%eax%
toolbar append %hTBar% 0 "tmNew" "新規作成" 0
toolbar append %hTBar% 0 "tmOpen" "開く..." 1
toolbar append %hTBar% 0 "tmSave" "上書き保存" 2
toolbar append %hTbar% 0x0800 0 0 -1
toolbar append %hTBar% 0 "tmUndo" "やり直し" 0
toolbar append %hTBar% 0 "tmCopy" "コピー" 4
toolbar append %hTBar% 0 "tmCut" "切り抜き" 3
toolbar append %hTBar% 0 "tmPaste" "貼り付け" 5
toolbar append %hTbar% 0x0800 0 0 -1
toolbar append %hTBar% 0 "tmFind" "検索..." 0
toolbar append %hTBar% 0 "tmFindRight" "下候補" 0
toolbar append %hTBar% 0 "tmFindLeft" "上候補" 0
toolbar append %hTbar% 0x0800 0 0 -1
toolbar append %hTBar% 0 "tmDummy" "現在行のマーク" 0
toolbar append %hTBar% 0 "tmExec" "ウィンドウ分割" 0
toolbar append %hTBar% 0 "tmAbout" "バージョン情報" 7
#----------------------------#
# ポップアップメニューの登録 #
#----------------------------#
menubar createpopup -&eax
let hPopMenu=%eax%
menubar append %hPopMenu% 0 "tmNew" "新規作成"
menubar append %hPopMenu% 0 "tmOpen" "開く..."
menubar append %hPopMenu% 0 "tmSave" "上書き保存"
menubar append %hPopMenu% 0 "tmSaveAs" "名前をつけて保存..."
menubar append %hPopMenu% 1 "tmDummy" "ファイルを閉じる"
menubar append %hPopMenu% 1 "tmDummy" "別ファイルへの追加保存"
menubar append %hPopMenu% 0 "tmLoad" "閉じて開く..."
menubar append %hPopMenu% 1 "tmDummy" "最初からやり直し..."
menubar append %hPopMenu% 0 "tmView" "上書き禁止切り替え"
menubar setpopup %hwndMain% %hPopMenu%
#----------------------------#
# アクセラレーターキーの登録 #
#----------------------------#
accelkey create -&eax
let hAccel=%eax%
let @ flags = 0x09 ; let @ key = 0x27 # VK_RIGHT
accelkey append %hAccel% %flags% "tmWordRight" %key%
let @ flags = 0x09 ; let @ key = 0x25 # VK_LEFT
accelkey append %hAccel% %flags% "tmWordLeft" %key%
let @ flags = 0x09 ; let @ key = C:0
accelkey append %hAccel% %flags% "tmExec" %key%
let @ flags = 0x09 ; let @ key = F:0
accelkey append %hAccel% %flags% "tmFind" %key%
let @ flags = 0x09 ; let @ key = J:0
accelkey append %hAccel% %flags% "tmJump" %key%
let @ flags = 0x09 ; let @ key = N:0
accelkey append %hAccel% %flags% "tmFindRight" %key%
let @ flags = 0x09 ; let @ key = P:0
accelkey append %hAccel% %flags% "tmFindLeft" %key%
let @ flags = 0x09 ; let @ key = R:0
accelkey append %hAccel% %flags% "tmReplace" %key%
accelkey set %hwndMain% %hAccel%
#------------#
# メッセージ #
#------------#
echo ^#**************************************************************^#
echo ^# ToolMan Editor Ver 1.80 Copyright (c) 1995-97 M.Maedera(JPN) ^#
echo ^# (Hidemaru like Script) ^#
echo ^# If you have any question, please input "help[enter]." ^#
echo ^#**************************************************************^#
return
#======================================================================
#--------------#
# プロシジャー #
#--------------#
#----------------------------------------------------------------------
proc tmDummy
echo not implement
return
#----------------------------------------------------------------------
proc tmNew
edit new
return
#----------------------------------------------------------------------
proc tmOpen
edit open
return
#----------------------------------------------------------------------
proc tmLoad
edit close ;edit open
return
#----------------------------------------------------------------------
proc tmSave
edit save
return
#----------------------------------------------------------------------
proc tmSaveAs
edit saveas
return
#----------------------------------------------------------------------
proc tmQuit
exit
return
#----------------------------------------------------------------------
proc tmUndo
edit -f undo
return
#----------------------------------------------------------------------
proc tmCut
edit -f select cut
return
#----------------------------------------------------------------------
proc tmCopy
edit -f select copy
return
#----------------------------------------------------------------------
proc tmPaste
edit -f select paste
return
#----------------------------------------------------------------------
proc tmDel
edit -f select delete
return
#----------------------------------------------------------------------
proc tmSelect
edit -f cursor get max -&eax -&ebx
edit -f cursor set eax ebx
edit -f select start
edit -f cursor set 1 1
edit -f select end
return
#----------------------------------------------------------------------
proc tmFind
edit -f find
return
#----------------------------------------------------------------------
proc tmFindRight
edit -f find right
return
#----------------------------------------------------------------------
proc tmFindLeft
edit -f find left
return
#----------------------------------------------------------------------
proc tmReplace
edit -f replace
return
#----------------------------------------------------------------------
proc tmJump
edit -f jump
return
#----------------------------------------------------------------------
proc tmTop
edit -f cursor set 1 1
return
#----------------------------------------------------------------------
proc tmBottom
edit -f cursor set 1 0
return
#----------------------------------------------------------------------
proc tmExec
console size 128
window get console -&eax
window set focus %eax%
return
#----------------------------------------------------------------------
proc tmKeyMacR
if "%tm.edt.rec%" == "1" then
set tm.edt.rec=0
edit record end
else
set tm.edt.rec=1
edit record start
endif
return
#----------------------------------------------------------------------
proc tmKeyMacP
edit record play
return
#----------------------------------------------------------------------
proc tmDisp
mode edit disp
return
#----------------------------------------------------------------------
proc tmIndent
if "%tm.edt.indent%" == "1" then
set tm.edt.indent=0
edit mode noindent
else
set tm.edt.indent=1
edit mode indent
endif
return
#----------------------------------------------------------------------
proc tmFont
mode edit font
return
#----------------------------------------------------------------------
proc tmBgColor
mode edit color -bg
return
#----------------------------------------------------------------------
proc tmCtlColor
mode edit color -ctl
return
#----------------------------------------------------------------------
proc tmLnColor
mode edit color -ln
return
#----------------------------------------------------------------------
proc tmTBar
if "%tm.win.tbar%" == "1" then
set tm.win.tbar=0
toolbar hide
else
set tm.win.tbar=1
toolbar show
endif
return
#----------------------------------------------------------------------
proc tmFKey
if "%tm.win.fkey%" == "1" then
set tm.win.fkey=0
functionkey hide
else
set tm.win.fkey=1
functionkey show
endif
return
#----------------------------------------------------------------------
proc tmEdtHS
if "%tm.edt.hsb%" == "0" then
set tm.edt.hsb=1
edit scrollbar horz show
else
set tm.edt.hsb=0
edit scrollbar horz hide
endif
return
#----------------------------------------------------------------------
proc tmEdtVS
if "%tm.edt.vsb%" == "0" then
set tm.edt.vsb=1
edit scrollbar vert show
else
set tm.edt.vsb=0
edit scrollbar vert hide
endif
return
#----------------------------------------------------------------------
proc tmConHS
if "%tm.con.hsb%" == "0" then
set tm.con.hsb=1
console scrollbar horz show
else
set tm.con.hsb=0
console scrollbar horz hide
endif
return
#----------------------------------------------------------------------
proc tmConVS
if "%tm.con.vsb%" == "0" then
set tm.con.vsb=1
console scrollbar vert show
else
set tm.con.vsb=0
console scrollbar vert hide
endif
return
#----------------------------------------------------------------------
proc tmHelpCmd
console size 128
window get console -&eax
window set focus %eax%
help
return
#----------------------------------------------------------------------
proc tmView
if "%tm.edt.view%" == "1" then
set tm.edt.view=0
edit mode edit
else
set tm.edt.view=1
edit mode view
endif
return
#----------------------------------------------------------------------
proc tmContent
window help
return
#----------------------------------------------------------------------
proc tmAbout
window about
return
#----------------------------------------------------------------------
proc tmRegist
window regist
return
#----------------------------------------------------------------------
proc tmBlock
window get edit -&eax
window get focus -&ebx
if (%eax% == %ebx%) then
if "%tm.edt.sel%" == "1" then
set tm.edt.sel=0
edit select end
else
set tm.edt.sel=1
edit select start
endif
else
if "%tm.con.sel%" == "1" then
set tm.con.sel=0
console select end
else
set tm.con.sel=1
console select start
endif
endif
return
#----------------------------------------------------------------------
proc tmLine
if "%tm.edt.line%" == "1" then
set tm.edt.line=0
edit mode noline
else
set tm.edt.line=1
edit mode line
endif
return
#----------------------------------------------------------------------
proc tmWordLeft
edit -f cursor left word
return
#----------------------------------------------------------------------
proc tmWordRight
edit -f cursor right word
return
#----------------------------------------------------------------------
proc tmPrint
edit print
return
#----------------------------------------------------------------------
proc tmLogFile
set @ tm.logfile = $tm.logfile[%1]
edit open "%tm.logfile%"
set tm.logfile=
return
#----------------------------------------------------------------------
proc tmGrep
window get main -&eax ;console size 320
comwin dll cwgrep grep -gj%eax%
return
#----------------------------------------------------------------------