home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 November / VPR9711A.ISO / VPR_DATA / Special / Tmedt180 / tmedt180.exe / TM_MI.CWS < prev    next >
Text File  |  1997-08-25  |  18KB  |  518 lines

  1. @echo off
  2.  
  3. #----------------------------------#
  4. # メインウィンンドのハンドルを取得 #
  5. #----------------------------------#
  6.  
  7. window get main -&eax
  8. let hwndMain=%eax%
  9.  
  10. #----------------------#
  11. # 以前のリソースを削除 #
  12. #----------------------#
  13.  
  14. menubar get %hwndMain% -&eax
  15. let hMenu=%eax%
  16.  
  17. menubar set %hwndMain% 0
  18. menubar destory %hMenu%
  19. menubar draw %hwndMain%
  20.  
  21. menubar getpopup %hwndMain% -&eax
  22. let hPopMenu=%eax%
  23. menubar destory %hPopMenu%
  24.  
  25. toolbar get %hwndMain% -&eax
  26. let hTBar=%eax%
  27. toolbar destory %hTBar%
  28.  
  29. functionkey get %hwndMain% -&eax
  30. let hFKey=%eax%
  31. functionkey destroy %hFKey%
  32.  
  33. accelkey get %hwndMain% -&eax
  34. let hAccel=%eax%
  35. accelkey destroy %hAccel%
  36.  
  37. strokekey get %hwndMain% -&eax
  38. let hStroke=%eax%
  39. strokekey destroy %hStroke%
  40.  
  41. #------------------#
  42. # 表示属性を決める #
  43. #------------------#
  44. let @ Hex = %hwndMain% ^| 0
  45. setwindowpos %Hex% 0 0 0 640 480 0006
  46. console size 0
  47. window sdi
  48. toolbar     hide
  49. functionkey show
  50. console scrollbar horz hide
  51. console scrollbar vert show
  52. edit    scrollbar horz hide
  53. edit    scrollbar vert show
  54. edit    mode noline
  55. edit    mode noruler
  56. window get edit -&eax
  57. window set focus %eax%
  58. #mode edit font "-f:FixedSys"
  59. mode edit color -fg:0xFFFFFF -bg:0x800000 -ctl:0x00FFFF
  60.  
  61. #--------------------#
  62. # メニューバーの登録 #
  63. #--------------------#
  64.  
  65. menubar create -&eax
  66. let hMenu=%eax%
  67.  
  68. menubar createpopup -&eax
  69. let hPopMenu=%eax%
  70.  
  71.  menubar append %hMenu%    0x0010 %hPopMenu% "ファイル(&F)"
  72.  menubar append %hPopMenu% 0x0000 "tmQuit"   "(&E)Save && Quit    :現テキストのセーブと編集終了"
  73.  menubar append %hPopMenu% 0x0000 "tmSave"   "(&S)Save    :現テキストのセーブ 編集は継続"
  74.  menubar append %hPopMenu% 0x0000 "tmQuit"   "(&Q)Quit    :現テキストの強制的な編集終了"
  75.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&B)Backup file    :バックアップ[作成/非作成]"
  76.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&M)Margin save    :特殊ファイルに表示イメージでセーブ"
  77.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&O)Original file    :現テキストの編集を最初からやり直す""
  78.  menubar append %hPopMenu% 0x0800 -1         0
  79.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&D)Duplicate    :現テキストの二重化"
  80.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&P)Split text    :現テキストの2分割表示"
  81.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&R)Rename    :現テキストのパス名変更"
  82.  menubar append %hPopMenu% 0x0800 -1         0
  83.  menubar append %hPopMenu% 0x0000 "tmQuit"   "(&A)All Save && End    :全テキストのセーブとエディタ終了"
  84.  menubar append %hPopMenu% 0x0000 "tmQuit"   "(&0)End    :強制的なエディタ終了"
  85.  menubar append %hPopMenu% 0x0800 -1         0
  86.  menubar append %hPopMenu% 0x0001 "tmDummy"  "(&I)Insert file    :カーソル行の前にファイルを読み込む"
  87.  menubar append %hPopMenu% 0x0800 -1         0
  88.  menubar append %hPopMenu% 0x0000 "tmRead"   "(&F)Open for read    :参照用にファイルをオープンする"
  89.  menubar append %hPopMenu% 0x0000 "tmOpen"   "(&N)New file    :新しいファイルの編集"
  90.  
  91. menubar createpopup -&eax
  92. let hPopMenu=%eax%
  93.  
  94.  menubar append %hMenu%    0x0010 %hPopMenu%   "移動(&M)"
  95.  menubar append %hPopMenu% 0x0000 "tmTop"      "(&T)Top of text    :テキストの最初の行へ"
  96.  menubar append %hPopMenu% 0x0000 "tmJump"     "(&G)Goto line    :指定する行番号の行へ"
  97.  menubar append %hPopMenu% 0x0800 -1           0
  98.  menubar append %hPopMenu% 0x0000 "tmUndo"     "(&U)Undo    :直前の削除/カット/ペーストのアンドゥ"
  99.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&J)Tag Jump    :タグジャンプ/バック・タグジャンプ"
  100.  menubar append %hPopMenu% 0x0000 "tmBottom"   "(&B)Bottom of text    :テキストの最後の行へ"
  101.  
  102. menubar createpopup -&eax
  103. let hPopMenu=%eax%
  104.  
  105. menubar append %hMenu%    0x0010 %hPopMenu%   "状態(&C)"
  106.  
  107. menubar createpopup -&eax
  108. let hPop2Menu=%eax%
  109.  
  110.  menubar append %hPopMenu%  0x0010 %hPop2Menu%  "(&E)Extension    :拡張メニュー"
  111.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&R)Rool up/dn    :ROOL UP/DOWN 動作[ジャンプ/スムース]"
  112.  menubar append %hPop2Menu% 0x0000 "tmCtlColor" "(&E)[EOF] Disp    :[EOF}マーク[表示/非表示]"
  113.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&K)Key click    :クリック音[OFF/ON]"
  114.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&2)Screen mode    :画面モード[20,31行/25行]"
  115.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&A)Change alph    :[大文字へ/小文字へ]"
  116.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&C)Compare    :ファイル比較モード[OFF/ON]"
  117.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&G)Guideline    :ガイドライン表示[行桁/文字コード]"
  118.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&N)Number type    :左側行番号[論理番号/表示番号]"
  119.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&F)Free Cursor    :フリーカーソルモード[OFF/ON]"
  120.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&P)Stop mode    :行端カーソル[止まらず/止まる]"
  121.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&V)Vertical ln    :バーチカルライン[OFF/ON]"
  122.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&Y)Memo mark    :セーブ時のメモマーク[有効/無効]"
  123.  menubar append %hPop2Menu% 0x0000 "tmDisp"     "(&H)Hard Tab    :デフォルト・ハードタブの変更"
  124.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&L)Lines/page    :1頁あたりの表示桁数"
  125.  menubar append %hPop2Menu% 0x0001 "tmDummy"    "(&S)Scroll marg    :スクロール・マージン"
  126.  
  127.  menubar append %hPopMenu% 0x0800 -1           0
  128.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&S)Split    :スプリット形状[上下/左右]"
  129.  menubar append %hPopMenu% 0x0000 "tmLine"     "(&N)Number    :行番号[非表示/表示]"
  130.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&C)Column    :桁位置ゲージ[非表示/表示]"
  131.  menubar append %hPopMenu% 0x0000 "tmIndent"   "(&I)Auto indent    :オートインデント[OFF/ON]"
  132.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&D)Dual scroll    :両画面スクロール[OFF/ON]"
  133.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&U)Underline    :カーソル行アンダーライン[OFF/ON]"
  134.  menubar append %hPopMenu% 0x0000 "tmCtlColor" "(&R)CR,LF disp    :改行文字[表示/非表示]"
  135.  menubar append %hPopMenu% 0x0000 "tmCtlColor" "(&T)TAB disp    :タブ文字&全角スペース[非表示/表示]"
  136.  menubar append %hPopMenu% 0x0001 "tmDummy"    "(&L)Left margin    :コード825FHでの左マージン[無効/有効]"
  137.  menubar append %hPopMenu% 0x0000 "tmDisp"     "(&G)Margin(def)    :デフォルト右マージンの変更"
  138.  menubar append %hPopMenu% 0x0000 "tmDisp"     "(&M)Margin(tmp)    :デフォルト右マージンの変更"
  139.  
  140. menubar createpopup -&eax
  141. let hPopMenu=%eax%
  142.  
  143.  menubar append %hMenu%    0x0010 %hPopMenu%  "実行(&R)"
  144.  menubar append %hPopMenu% 0x0000 "tmExec"    "(&S)Console    :コマンドの実行"
  145.  
  146. menubar createpopup -&eax
  147. let hPopMenu=%eax%
  148.  
  149.  menubar append %hMenu%    0x0010 %hPopMenu%    "検索(&S)"
  150.  menubar append %hPopMenu% 0x0000 "tmFind"      "(&F)Find Forword    :文字列の前方↓検索"
  151.  menubar append %hPopMenu% 0x0000 "tmFind"      "(&B)Find Backword    :文字列の後方↑検索"
  152.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&G)Global Search    :グローバル検索の実行"
  153.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&M)Find Mode    :英大・小文字[区別/同一視]"
  154.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&X)eXtended Search    :特殊検索の指定[有効/無効]"
  155.  menubar append %hPopMenu% 0x0800 -1            0
  156.  menubar append %hPopMenu% 0x0000 "tmChng"      "(&Q)Replace Query    :文字列の連続置換:確認あり"
  157.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&A)Replace All    :文字列の連続置換:確認なし"
  158.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&R)Replace Range    :文字列の連続置換:範囲指定"
  159.  menubar append %hPopMenu% 0x0001 "tmDummy"     "(&C)Replace Continue    :前回の連続置換の再実行"
  160.  
  161. menubar createpopup -&eax
  162. let hPopMenu=%eax%
  163.  
  164.  menubar append %hMenu%    0x0010 %hPopMenu%  "ヘルプ(&H)"
  165.  menubar append %hPopMenu%      0 "tmContent" "目次(&C)"
  166.  menubar append %hPopMenu% 0x0800 -1          0
  167.  menubar append %hPopMenu%      0 "tmAbout"   "バージョン情報(&A)..."
  168.  menubar append %hPopMenu%      0 "tmRegist"  "ユーザー登録(&R)..."
  169.  
  170. menubar set %hwndMain% %hMenu%
  171. menubar draw %hwndMain%
  172.  
  173. #--------------------------#
  174. # ファンクションキーの登録 #
  175. #--------------------------#
  176.  
  177. functionkey create -&eax
  178. let hFKey=%eax%
  179.  
  180.  functionkey append %hFKey% 0x00 0x70 "tmMenu1"       "メニュー1"
  181.  functionkey append %hFKey% 0x00 0x71 "tmWndw"        "メニュー2"
  182.  functionkey append %hFKey% 0x00 0x72 "tmMenu3"       "メニュー3"
  183.  functionkey append %hFKey% 0x00 0x73 "tmConSizeUp"   "画面割"
  184.  functionkey append %hFKey% 0x00 0x74 "tmFindRight"   "検索↓"
  185.  functionkey append %hFKey% 0x00 0x75 "tmBlock"       "行選択"
  186.  functionkey append %hFKey% 0x00 0x76 "tmCut"         "カット"
  187.  functionkey append %hFKey% 0x00 0x77 "tmCopy"        "コピー"
  188.  functionkey append %hFKey% 0x00 0x78 "tmPaste"       "行ペスト"
  189. #functionkey append %hFKey% 0x00 0x79 "tmDummy"       "タグJP"
  190.  functionkey append %hFKey% 0x04 0x70 "tmMenu4"       "メニュー4"
  191.  functionkey append %hFKey% 0x04 0x71 "tmMenu5"       "メニュー5"
  192.  functionkey append %hFKey% 0x04 0x72 "tmMenu6"       "メニュー6"
  193.  functionkey append %hFKey% 0x04 0x73 "tmConSizeDown" "境界換"
  194.  functionkey append %hFKey% 0x04 0x74 "tmFindLeft"    "検索↑"
  195. #functionkey append %hFKey% 0x04 0x75 "tmDummy"       "文選択"
  196. #functionkey append %hFKey% 0x04 0x76 "tmDummy"       "AZ実行"
  197. #functionkey append %hFKey% 0x04 0x77 "tmDummy"       "AZ実行"
  198. #functionkey append %hFKey% 0x04 0x78 "tmDummy"       "文ペスト"
  199. #functionkey append %hFKey% 0x04 0x79 "tmDummy"       "行2重"
  200.  
  201. #----------------------------#
  202. # アクセラレーターキーの登録 #
  203. #----------------------------#
  204. accelkey create -&eax
  205. let hAccel=%eax%
  206.  
  207. let @ flags = 0x09 ; let @ key = Q:0
  208. accelkey append %hAccel% %flags% "tmStroke" %key%
  209.  
  210. let @ flags = 0x09 ; let @ key = E:0
  211. accelkey append %hAccel% %flags% "tmUp" %key%
  212.  
  213. let @ flags = 0x09 ; let @ key = X:0
  214. accelkey append %hAccel% %flags% "tmDown" %key%
  215.  
  216. let @ flags = 0x09 ; let @ key = S:0
  217. accelkey append %hAccel% %flags% "tmLeft" %key%
  218.  
  219. let @ flags = 0x09 ; let @ key = D:0
  220. accelkey append %hAccel% %flags% "tmRight" %key%
  221.  
  222. let @ flags = 0x09 ; let @ key = C:0
  223. accelkey append %hAccel% %flags% "tmPageDown" %key%
  224.  
  225. let @ flags = 0x09 ; let @ key = R:0
  226. accelkey append %hAccel% %flags% "tmPageUp" %key%
  227.  
  228. let @ flags = 0x09 ; let @ key = F:0
  229. accelkey append %hAccel% %flags% "tmWordRight" %key%
  230.  
  231. let @ flags = 0x09 ; let @ key = A:0
  232. accelkey append %hAccel% %flags% "tmWordLeft" %key%
  233.  
  234. let @ flags = 0x09 ; let @ key = G:0
  235. accelkey append %hAccel% %flags% "tmDelete" %key%
  236.  
  237. let @ flags = 0x09 ; let @ key = H:0
  238. accelkey append %hAccel% %flags% "tmBack" %key%
  239.  
  240. let @ flags = 0x09 ; let @ key = Y:0
  241. accelkey append %hAccel% %flags% "tmCut" %key%
  242.  
  243. let @ flags = 0x09 ; let @ key = L:0
  244. accelkey append %hAccel% %flags% "tmPaste" %key%
  245.  
  246. accelkey set %hwndMain% %hAccel%
  247.  
  248. #------------------------#
  249. # 2ストロークキーの登録 #
  250. #------------------------#
  251. strokekey create -&eax
  252. let hStroke=%eax%
  253.  
  254. let @ flags = 0x01 ; let @ key = S:0
  255. strokekey append %hStroke% %flags% "tmHome" %key%
  256.  
  257. let @ flags = 0x01 ; let @ key = D:0
  258. strokekey append %hStroke% %flags% "tmEnd" %key%
  259.  
  260. let @ flags = 0x01 ; let @ key = R:0
  261. strokekey append %hStroke% %flags% "tmTop" %key%
  262.  
  263. let @ flags = 0x01 ; let @ key = C:0
  264. strokekey append %hStroke% %flags% "tmBottom" %key%
  265.  
  266. let @ flags = 0x01 ; let @ key = F:0
  267. strokekey append %hStroke% %flags% "tmFindRight" %key%
  268.  
  269. let @ flags = 0x01 ; let @ key = B:0
  270. strokekey append %hStroke% %flags% "tmFindLeft" %key%
  271.  
  272. let @ flags = 0x01 ; let @ key = U:0
  273. strokekey append %hStroke% %flags% "tmUndo" %key%
  274.  
  275. let @ flags = 0x01 ; let @ key = W:0
  276. strokekey append %hStroke% %flags% "tmLine" %key%
  277.  
  278. let @ flags = 0x01 ; let @ key = H:0
  279. strokekey append %hStroke% %flags% "tmExec" %key%
  280.  
  281. strokekey set %hwndMain% %hStroke%
  282.  
  283. #------------#
  284. # メッセージ #
  285. #------------#
  286. echo ^#**************************************************************^#
  287. echo ^# ToolMan Editor Ver 1.80 Copyright (c) 1995-97 M.Maedera(JPN) ^#
  288. echo ^# (Mifes like mode)                                            ^#
  289. echo ^# If you have any question, please input "help[enter]."        ^#
  290. echo ^#**************************************************************^#
  291. return
  292. #======================================================================
  293. #--------------#
  294. # プロシジャー #
  295. #--------------#
  296. #----------------------------------------------------------------------
  297. proc tmDummy
  298. echo not implement
  299. return
  300. #----------------------------------------------------------------------
  301. proc tmMenu1
  302. menubar trackpopup 0
  303. return
  304. #----------------------------------------------------------------------
  305. proc tmMenu3
  306. menubar trackpopup 1
  307. return
  308. #----------------------------------------------------------------------
  309. proc tmMenu4
  310. menubar trackpopup 2
  311. return
  312. #----------------------------------------------------------------------
  313. proc tmMenu5
  314. menubar trackpopup 3
  315. return
  316. #----------------------------------------------------------------------
  317. proc tmMenu6
  318. menubar trackpopup 4
  319. return
  320. #----------------------------------------------------------------------
  321. proc tmOpen
  322. edit open
  323. return
  324. #----------------------------------------------------------------------
  325. proc tmSave
  326. edit save
  327. return
  328. #----------------------------------------------------------------------
  329. proc tmRead
  330. edit open ;edit mode view
  331. return
  332. #----------------------------------------------------------------------
  333. proc tmExec
  334. console size 128
  335. window get console -&eax
  336. window set focus %eax%
  337. return
  338. #----------------------------------------------------------------------
  339. proc tmQuit
  340. exit
  341. return
  342. #----------------------------------------------------------------------
  343. proc tmCtlColor
  344. mode edit color -ctl
  345. return
  346. #----------------------------------------------------------------------
  347. proc tmLine
  348. if "%tm.edt.line%" == "1" then
  349.   set tm.edt.line=0
  350.   edit mode noline
  351. else
  352.   set tm.edt.line=1
  353.   edit mode line
  354. endif
  355. return
  356. #----------------------------------------------------------------------
  357. proc tmIndent
  358. if "%tm.edt.indent%" == "1" then
  359.   set tm.edt.indent=0
  360.   edit mode noindent
  361. else
  362.   set tm.edt.indent=1
  363.   edit mode indent
  364. endif
  365. return
  366. #----------------------------------------------------------------------
  367. proc tmDisp
  368. mode edit disp
  369. return
  370. #----------------------------------------------------------------------
  371. proc tmJump
  372. edit -f jump
  373. return
  374. #----------------------------------------------------------------------
  375. proc tmContent
  376. window help
  377. return
  378. #----------------------------------------------------------------------
  379. proc tmRegist
  380. window regist
  381. return
  382. #----------------------------------------------------------------------
  383. proc tmAbout
  384. window about
  385. return
  386. #----------------------------------------------------------------------
  387. proc tmWndw
  388. window get focus   -&eax
  389. window get console -&ebx
  390. window get edit    -&ecx
  391.  
  392. if %eax% == %ebx% then
  393.     window set focus %ecx%
  394. else
  395.     window set focus %ebx%
  396. endif
  397. return
  398. #----------------------------------------------------------------------
  399. proc tmConSizeUp
  400. console size +16
  401. return
  402. #----------------------------------------------------------------------
  403. proc tmConSizeDown
  404. console size -16
  405. return
  406. #----------------------------------------------------------------------
  407. proc tmFind
  408. edit -f find
  409. return
  410. #----------------------------------------------------------------------
  411. proc tmChng
  412. edit -f replace
  413. return
  414. #----------------------------------------------------------------------
  415. proc tmPaste
  416. edit -f select paste
  417. return
  418. #----------------------------------------------------------------------
  419. proc tmBlock
  420. window get edit  -&eax
  421. window get focus -&ebx
  422.  
  423. if (%eax% == %ebx%) then
  424.   if "%tm.edt.sel%" == "1" then
  425.     set tm.edt.sel=0
  426.     edit select end
  427.   else
  428.     set tm.edt.sel=1
  429.     edit select start
  430.   endif
  431. else
  432.   if "%tm.con.sel%" == "1" then
  433.     set tm.con.sel=0
  434.     console select end
  435.   else
  436.     set tm.con.sel=1
  437.     console select start
  438.   endif
  439. endif
  440. return
  441. #----------------------------------------------------------------------
  442. proc tmFindLeft
  443. edit -f find left
  444. return
  445. #----------------------------------------------------------------------
  446. proc tmFindRight
  447. edit -f find right
  448. return
  449. #----------------------------------------------------------------------
  450. proc tmCopy
  451. edit -f select copy ;edit -f select end
  452. return
  453. #----------------------------------------------------------------------
  454. proc tmUp
  455. edit -f cursor up
  456. return
  457. #----------------------------------------------------------------------
  458. proc tmDown
  459. edit -f cursor down
  460. return
  461. #----------------------------------------------------------------------
  462. proc tmLeft
  463. edit -f cursor left
  464. return
  465. #----------------------------------------------------------------------
  466. proc tmRight
  467. edit -f cursor right
  468. return
  469. #----------------------------------------------------------------------
  470. proc tmWordLeft
  471. edit -f cursor left word
  472. return
  473. #----------------------------------------------------------------------
  474. proc tmWordRight
  475. edit -f cursor right word
  476. return
  477. #----------------------------------------------------------------------
  478. proc tmBack
  479. edit -f backspace
  480. return
  481. #----------------------------------------------------------------------
  482. proc tmDelete
  483. edit -f delete
  484. return
  485. #----------------------------------------------------------------------
  486. proc tmUndo
  487. edit -f undo
  488. return
  489. #----------------------------------------------------------------------
  490. proc tmPageUp
  491. edit -f cursor up page
  492. return
  493. #----------------------------------------------------------------------
  494. proc tmPageDown
  495. edit -f cursor down page
  496. return
  497. #----------------------------------------------------------------------
  498. proc tmStroke
  499. strokekey start
  500. return
  501. #----------------------------------------------------------------------
  502. proc tmHome
  503. edit -f cursor home
  504. return
  505. #----------------------------------------------------------------------
  506. proc tmEnd
  507. edit -f cursor end
  508. return
  509. #----------------------------------------------------------------------
  510. proc tmTop
  511. edit -f cursor set 1 1
  512. return
  513. #----------------------------------------------------------------------
  514. proc tmBottom
  515. edit -f cursor set 1 0
  516. return
  517. #----------------------------------------------------------------------
  518.