home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 November / VPR9711A.ISO / VPR_DATA / Special / Tmedt180 / tmedt180.exe / TM_VZ.CWS < prev    next >
Text File  |  1997-08-25  |  17KB  |  544 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:0x000000 -ctl:0xFFFF00
  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% "&File"
  72.  menubar append %hPopMenu% 0x0000 "tmOpen"   "&Open Files"
  73.  menubar append %hPopMenu% 0x0000 "tmSaveAs" "&Save as"
  74.  menubar append %hPopMenu% 0x0000 "tmNew"    "&New Files"
  75.  menubar append %hPopMenu% 0x0000 "tmRead"   "&Read Files"
  76.  menubar append %hPopMenu% 0x0000 "tmLoad"   "&Load a File"
  77.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&Append to"
  78.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&Path Rename"
  79.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&Duplecate"
  80.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&Undo Edit"
  81.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&Insert File"
  82.  menubar append %hPopMenu% 0x0001 "tmDummy"  "&X:close all"
  83.  menubar append %hPopMenu% 0x0000 "tmExec"   "&Exec Dos"
  84.  menubar append %hPopMenu% 0x0000 "tmQuit"   "&Quit"
  85.  
  86. menubar createpopup -&eax
  87. let hPopMenu=%eax%
  88.  
  89.  menubar append %hMenu%    0x0010 %hPopMenu%   "&Mode"
  90.  menubar append %hPopMenu% 0x0000 "tmCtlColor" "&CR Display"
  91.  menubar append %hPopMenu% 0x0000 "tmCtlColor" "&TAB Display"
  92.  menubar append %hPopMenu% 0x0000 "tmCtlColor" "&EOF Display"
  93.  menubar append %hPopMenu% 0x0000 "tmLine"     "&Line Numbers"
  94.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Number Mode"
  95.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&System Info."
  96.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Underline Csr"
  97.  menubar append %hPopMenu% 0x0000 "tmIndent"   "&Auto Indent"
  98.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Ignore Case"
  99.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Wrod Search"
  100.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Half Paging"
  101.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Backup File"
  102.  menubar append %hPopMenu% 0x0000 "tmDisp"     "&Right Margin"
  103.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Page Length"
  104.  
  105. menubar createpopup -&eax
  106. let hPopMenu=%eax%
  107.  
  108.  menubar append %hMenu%    0x0010 %hPopMenu%   "&Sub"
  109.  menubar append %hPopMenu% 0x0000 "tmJump"     "&Jump to Line"
  110.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Clear Stack"
  111.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Block Top/End"
  112.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Restore Line"
  113.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Screen Lines"
  114.  menubar append %hPopMenu% 0x0000 "tmView"     "&Read Only"
  115.  menubar append %hPopMenu% 0x0001 "tmDummy"    "&Indent L/R"
  116.  menubar append %hPopMenu% 0x0000 "tmDisp"     "change &Tab"
  117.  menubar append %hPopMenu% 0x0000 "tmExec"     "&Peek Console"
  118.  
  119. menubar createpopup -&eax
  120. let hPopMenu=%eax%
  121.  
  122.  menubar append %hMenu%    0x0010 %hPopMenu%  "&Macro"
  123.  menubar append %hPopMenu% 0x0000 "tmKeyMacS" "&Start"
  124.  menubar append %hPopMenu% 0x0000 "tmKeyMacE" "&End"
  125.  menubar append %hPopMenu% 0x0000 "tmKeyMacP" "&Play"
  126.  menubar append %hPopMenu% 0x0000 "tmKeyMacC" "&Clear"
  127.  
  128. menubar createpopup -&eax
  129. let hPopMenu=%eax%
  130.  
  131.  menubar append %hMenu%    0x0010 %hPopMenu%   "&Help"
  132.  menubar append %hPopMenu% 0x0000 "tmContent"  "&Content"
  133.  menubar append %hPopMenu% 0x0800 -1           0
  134.  menubar append %hPopMenu% 0x0000 "tmAbout"    "&About..."
  135.  menubar append %hPopMenu% 0x0000 "tmRegist"   "&Regist..."
  136.  
  137. menubar set %hwndMain% %hMenu%
  138. menubar draw %hwndMain%
  139.  
  140. #--------------------------#
  141. # ファンクションキーの登録 #
  142. #--------------------------#
  143.  
  144. functionkey create -&eax
  145. let hFKey=%eax%
  146.  
  147.  functionkey append %hFKey% 0x00 0x70 "tmFile"  "File"
  148.  functionkey append %hFKey% 0x00 0x71 "tmWndw"  "Wndw"
  149.  functionkey append %hFKey% 0x00 0x72 "tmPick"  "Pick"
  150.  functionkey append %hFKey% 0x00 0x73 "tmSplit" "Split"
  151.  functionkey append %hFKey% 0x00 0x74 "tmGetSt" "GetSt"
  152.  functionkey append %hFKey% 0x00 0x75 "tmFind"  "Find"
  153.  functionkey append %hFKey% 0x00 0x76 "tmChng"  "Chng"
  154.  functionkey append %hFKey% 0x00 0x77 "tmDel"   "Del"
  155.  functionkey append %hFKey% 0x00 0x78 "tmPaste" "Ins"
  156.  functionkey append %hFKey% 0x00 0x79 "tmHelp"  "Help"
  157. #functionkey append %hFKey% 0x00 0x7A "tmDummy" "Pg"
  158.  functionkey append %hFKey% 0x00 0x7B "tmBlock" "Block"
  159.  functionkey append %hFKey% 0x04 0x70 "tmMode"  "mode"
  160.  functionkey append %hFKey% 0x04 0x71 "tmSub"   "sub"
  161. #functionkey append %hFKey% 0x04 0x72 "tmDummy" "comp"
  162.  functionkey append %hFKey% 0x04 0x73 "tmBordr" "bordr"
  163.  functionkey append %hFKey% 0x04 0x74 "tmPaste" "putst"
  164.  functionkey append %hFKey% 0x04 0x75 "tmMulti" "multi"
  165.  functionkey append %hFKey% 0x04 0x76 "tmPaste" "puts2"
  166.  functionkey append %hFKey% 0x04 0x77 "tmCopy"  "copy"
  167.  functionkey append %hFKey% 0x04 0x78 "tmPaste" "paste"
  168. #functionkey append %hFKey% 0x04 0x79 "tmDummy" "tag"
  169. #functionkey append %hFKey% 0x04 0x7A "tmDummy" "ext"
  170.  functionkey append %hFKey% 0x04 0x7B "tmMacro" "macro"
  171.  
  172. #----------------------------#
  173. # アクセラレーターキーの登録 #
  174. #----------------------------#
  175. accelkey create -&eax
  176. let hAccel=%eax%
  177.  
  178. let @ flags = 0x09 ; let @ key = Q:0
  179. accelkey append %hAccel% %flags% "tmStroke" %key%
  180.  
  181. let @ flags = 0x09 ; let @ key = P:0
  182. accelkey append %hAccel% %flags% "tmKeyMacP" %key%
  183.  
  184. let @ flags = 0x09 ; let @ key = E:0
  185. accelkey append %hAccel% %flags% "tmUp" %key%
  186.  
  187. let @ flags = 0x09 ; let @ key = X:0
  188. accelkey append %hAccel% %flags% "tmDown" %key%
  189.  
  190. let @ flags = 0x09 ; let @ key = S:0
  191. accelkey append %hAccel% %flags% "tmLeft" %key%
  192.  
  193. let @ flags = 0x09 ; let @ key = D:0
  194. accelkey append %hAccel% %flags% "tmRight" %key%
  195.  
  196. let @ flags = 0x09 ; let @ key = A:0
  197. accelkey append %hAccel% %flags% "tmWordLeft" %key%
  198.  
  199. let @ flags = 0x09 ; let @ key = F:0
  200. accelkey append %hAccel% %flags% "tmWordRight" %key%
  201.  
  202. let @ flags = 0x09 ; let @ key = H:0
  203. accelkey append %hAccel% %flags% "tmBack" %key%
  204.  
  205. let @ flags = 0x09 ; let @ key = G:0
  206. accelkey append %hAccel% %flags% "tmDelete" %key%
  207.  
  208. let @ flags = 0x09 ; let @ key = U:0
  209. accelkey append %hAccel% %flags% "tmUndo" %key%
  210.  
  211. let @ flags = 0x09 ; let @ key = R:0
  212. accelkey append %hAccel% %flags% "tmPageUp" %key%
  213.  
  214. let @ flags = 0x09 ; let @ key = C:0
  215. accelkey append %hAccel% %flags% "tmPageDown" %key%
  216.  
  217. let @ flags = 0x09 ; let @ key = B:0
  218. accelkey append %hAccel% %flags% "tmBlock" %key%
  219.  
  220. let @ flags = 0x09 ; let @ key = Y:0
  221. accelkey append %hAccel% %flags% "tmCut" %key%
  222.  
  223. let @ flags = 0x09 ; let @ key = J:0
  224. accelkey append %hAccel% %flags% "tmPaste" %key%
  225.  
  226. let @ flags = 0x09 ; let @ key = L:0
  227. accelkey append %hAccel% %flags% "tmGetSt" %key%
  228.  
  229. accelkey set %hwndMain% %hAccel%
  230.  
  231. #------------------------#
  232. # 2ストロークキーの登録 #
  233. #------------------------#
  234. strokekey create -&eax
  235. let hStroke=%eax%
  236.  
  237. let @ flags = 0x01 ; let @ key = S:0
  238. strokekey append %hStroke% %flags% "tmHome" %key%
  239.  
  240. let @ flags = 0x01 ; let @ key = D:0
  241. strokekey append %hStroke% %flags% "tmEnd" %key%
  242.  
  243. let @ flags = 0x01 ; let @ key = I:0
  244. strokekey append %hStroke% %flags% "tmPaste" %key%
  245.  
  246. let @ flags = 0x01 ; let @ key = R:0
  247. strokekey append %hStroke% %flags% "tmTop" %key%
  248.  
  249. let @ flags = 0x01 ; let @ key = C:0
  250. strokekey append %hStroke% %flags% "tmBottom" %key%
  251.  
  252. let @ flags = 0x01 ; let @ key = J:0
  253. strokekey append %hStroke% %flags% "tmJump" %key%
  254.  
  255. let @ flags = 0x01 ; let @ key = F:0
  256. strokekey append %hStroke% %flags% "tmFind" %key%
  257.  
  258. let @ flags = 0x01 ; let @ key = A:0
  259. strokekey append %hStroke% %flags% "tmChng" %key%
  260.  
  261. strokekey set %hwndMain% %hStroke%
  262.  
  263. #------------#
  264. # メッセージ #
  265. #------------#
  266. echo ^#**************************************************************^#
  267. echo ^# ToolMan Editor Ver 1.80 Copyright (c) 1995-97 M.Maedera(JPN) ^#
  268. echo ^# (VZ like mode)                                               ^#
  269. echo ^# If you have any question, please input "help[enter]."        ^#
  270. echo ^#**************************************************************^#
  271. return
  272. return
  273. #======================================================================
  274. #--------------#
  275. # プロシジャー #
  276. #--------------#
  277. #----------------------------------------------------------------------
  278. proc tmDummy
  279. echo not implement
  280. return
  281. #----------------------------------------------------------------------
  282. proc tmFile
  283. menubar trackpopup 0
  284. return
  285. #----------------------------------------------------------------------
  286. proc tmMode
  287. menubar trackpopup 1
  288. return
  289. #----------------------------------------------------------------------
  290. proc tmSub
  291. menubar trackpopup 2
  292. return
  293. #----------------------------------------------------------------------
  294. proc tmMacro
  295. menubar trackpopup 3
  296. return
  297. #----------------------------------------------------------------------
  298. proc tmHelp
  299. menubar trackpopup 4
  300. return
  301. #----------------------------------------------------------------------
  302. proc tmOpen
  303. edit open
  304. return
  305. #----------------------------------------------------------------------
  306. proc tmSaveAs
  307. edit save
  308. return
  309. #----------------------------------------------------------------------
  310. proc tmNew
  311. edit new
  312. return
  313. #----------------------------------------------------------------------
  314. proc tmRead
  315. edit open ;edit mode view
  316. return
  317. #----------------------------------------------------------------------
  318. proc tmLoad
  319. edit open ;exit
  320. return
  321. #----------------------------------------------------------------------
  322. proc tmExec
  323. console size 128
  324. window get console -&eax
  325. window set focus %eax%
  326. return
  327. #----------------------------------------------------------------------
  328. proc tmQuit
  329. exit
  330. return
  331. #----------------------------------------------------------------------
  332. proc tmCtlColor
  333. mode edit color -ctl
  334. return
  335. #----------------------------------------------------------------------
  336. proc tmLine
  337. if "%tm.edt.line%" == "1" then
  338.   set tm.edt.line=0
  339.   edit mode noline
  340. else
  341.   set tm.edt.line=1
  342.   edit mode line
  343. endif
  344. return
  345. #----------------------------------------------------------------------
  346. proc tmIndent
  347. if "%tm.edt.indent%" == "1" then
  348.   set tm.edt.indent=0
  349.   edit mode noindent
  350. else
  351.   set tm.edt.indent=1
  352.   edit mode indent
  353. endif
  354. return
  355. #----------------------------------------------------------------------
  356. proc tmDisp
  357. mode edit disp
  358. return
  359. #----------------------------------------------------------------------
  360. proc tmJump
  361. edit -f jump
  362. return
  363. #----------------------------------------------------------------------
  364. proc tmView
  365. if "%tm.edt.view%" == "1" then
  366.   set tm.edt.view=0
  367.   edit mode edit
  368. else
  369.   set tm.edt.view=1
  370.   edit mode view
  371. endif
  372. return
  373. #----------------------------------------------------------------------
  374. proc tmKeyMacS
  375. edit record start
  376. return
  377. #----------------------------------------------------------------------
  378. proc tmKeyMacE
  379. edit record end
  380. return
  381. #----------------------------------------------------------------------
  382. proc tmKeyMacP
  383. edit record play
  384. return
  385. #----------------------------------------------------------------------
  386. proc tmKeyMacC
  387. edit record clear
  388. return
  389. #----------------------------------------------------------------------
  390. proc tmContent
  391. window help
  392. return
  393. #----------------------------------------------------------------------
  394. proc tmRegist
  395. window regist
  396. return
  397. #----------------------------------------------------------------------
  398. proc tmAbout
  399. window about
  400. return
  401. #----------------------------------------------------------------------
  402. proc tmWndw
  403. window get focus   -&eax
  404. window get console -&ebx
  405. window get edit    -&ecx
  406.  
  407. if %eax% == %ebx% then
  408.     window set focus %ecx%
  409. else
  410.     window set focus %ebx%
  411. endif
  412. return
  413. #----------------------------------------------------------------------
  414. proc tmPick
  415. console size +16
  416. return
  417. #----------------------------------------------------------------------
  418. proc tmSplit
  419. console size -16
  420. return
  421. #----------------------------------------------------------------------
  422. proc tmGetSt
  423. edit -f select start
  424. edit -f cursor down
  425. edit -f select end
  426. edit -f select copy
  427. return
  428. #----------------------------------------------------------------------
  429. proc tmFind
  430. edit -f find
  431. return
  432. #----------------------------------------------------------------------
  433. proc tmChng
  434. edit -f replace
  435. return
  436. #----------------------------------------------------------------------
  437. proc tmDel
  438. edit -f select cut ;edit -f select end
  439. return
  440. #----------------------------------------------------------------------
  441. proc tmPaste
  442. edit -f select paste
  443. return
  444. #----------------------------------------------------------------------
  445. proc tmBlock
  446. window get edit  -&eax
  447. window get focus -&ebx
  448.  
  449. if (%eax% == %ebx%) then
  450.   if "%tm.edt.sel%" == "1" then
  451.     set tm.edt.sel=0
  452.     edit select end
  453.   else
  454.     set tm.edt.sel=1
  455.     edit select start
  456.   endif
  457. else
  458.   if "%tm.con.sel%" == "1" then
  459.     set tm.con.sel=0
  460.     console select end
  461.   else
  462.     set tm.con.sel=1
  463.     console select start
  464.   endif
  465. endif
  466. return
  467. #----------------------------------------------------------------------
  468. proc tmBordr
  469. console size 0
  470. return
  471. #----------------------------------------------------------------------
  472. proc tmMulti
  473. edit -f find right
  474. return
  475. #----------------------------------------------------------------------
  476. proc tmCopy
  477. edit -f select copy ;edit -f select end
  478. return
  479. #----------------------------------------------------------------------
  480. proc tmUp
  481. edit -f cursor up
  482. return
  483. #----------------------------------------------------------------------
  484. proc tmDown
  485. edit -f cursor down
  486. return
  487. #----------------------------------------------------------------------
  488. proc tmLeft
  489. edit -f cursor left
  490. return
  491. #----------------------------------------------------------------------
  492. proc tmRight
  493. edit -f cursor right
  494. return
  495. #----------------------------------------------------------------------
  496. proc tmWordLeft
  497. edit -f cursor left word
  498. return
  499. #----------------------------------------------------------------------
  500. proc tmWordRight
  501. edit -f cursor right word
  502. return
  503. #----------------------------------------------------------------------
  504. proc tmBack
  505. edit -f backspace
  506. return
  507. #----------------------------------------------------------------------
  508. proc tmDelete
  509. edit -f delete
  510. return
  511. #----------------------------------------------------------------------
  512. proc tmUndo
  513. edit -f undo
  514. return
  515. #----------------------------------------------------------------------
  516. proc tmPageUp
  517. edit -f cursor up page
  518. return
  519. #----------------------------------------------------------------------
  520. proc tmPageDown
  521. edit -f cursor down page
  522. return
  523. #----------------------------------------------------------------------
  524. proc tmStroke
  525. strokekey start
  526. return
  527. #----------------------------------------------------------------------
  528. proc tmHome
  529. edit -f cursor home
  530. return
  531. #----------------------------------------------------------------------
  532. proc tmEnd
  533. edit -f cursor end
  534. return
  535. #----------------------------------------------------------------------
  536. proc tmTop
  537. edit -f cursor set 1 1
  538. return
  539. #----------------------------------------------------------------------
  540. proc tmBottom
  541. edit -f cursor set 1 0
  542. return
  543. #----------------------------------------------------------------------
  544.