home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 January / VPR0201B.ISO / APUPDATE / VC / TXC0601S / TXC0601S.LZH / _IDMCUR.C < prev    next >
Text File  |  2000-03-06  |  15KB  |  595 lines

  1. /*
  2.     カーソル移動関係のIDMコマンド処理群
  3.         Start 99年11月19日
  4. */
  5.  
  6. #if __TXC__
  7.     #include <_wz.h>
  8.     #include <windows.h>
  9.     #include <windowsx.h>
  10.     #include <_idm.h>
  11. #else
  12.     #include "_sys.h"
  13. #endif
  14. //#include "_idmlib.h"
  15.  
  16. //##文字単位の移動
  17.  
  18. BOOL _txkeySelectWin(TX* text,int idm)
  19. {
  20.     if (sh->fMacroPlay) return FALSE;
  21.     if (text->modeEditor == ME_WIN) {
  22.         if (
  23.             (text->fKeyVkShift == 0 && GetKeyState(VK_SHIFT) < 0) ||
  24.             text->fKeyVkShift == 2
  25.         ) {
  26.             if (text->fClip && text->fClipMouse) {
  27.                 // 既に選択中
  28.             } else {
  29.                 if (sh->fMacroRec) keymacroAddIdm(IDM_KM_SELECT);
  30.                 if (text->modeKeyClip == MC_WZ) {
  31.                     txSelectEx(text,CLIP_WZ);
  32.                 } else if (text->modeKeyClip == MC_VZ) {
  33.                     txSelectEx(text,CLIP_VZ);
  34.                 } else {
  35.                     txSelectEx(text,CLIP_CHAR);
  36.                 }
  37.                 text->fClipMouse = TRUE;
  38.             }
  39.             return TRUE;
  40.         }
  41.     }
  42.     if (text->fClip && text->fClipMouse) {
  43.         BOOL ret = 0;
  44.         if (sh->fMacroRec) keymacroAddIdm(IDM_SELECTQUIT);
  45.         {
  46.             IFILE adrTop = txGetAddressSelectTop(text);
  47.             IFILE adrEnd = txGetAddressSelectEnd(text);
  48.             BOOL fPrev = txSelectGetPrev(text);
  49.             int lyClip = text->lyClip;
  50.             txSetUndisp(text);
  51.                 txSelectQuit(text);
  52.                 if (!sh->fNoUpDownAtClipMouse) {    //WZ3.90I 981103 
  53.                     if (idm == IDM_LEFT || idm == IDM_UP) {
  54.                         ret = 2;    // idm != 0で、範囲の先頭・末尾に移動した場合は2を返す。
  55.                         txJumpAddress(text,adrTop);
  56.                         if (!fPrev) txSetLy(text,lyClip);
  57.                     } else if (idm == IDM_RIGHT || idm == IDM_DOWN) {
  58.                         ret = 2;    // idm != 0で、範囲の先頭・末尾に移動した場合は2を返す。
  59.                         txJumpAddress(text,adrEnd);
  60.                         if (fPrev) txSetLy(text,lyClip);
  61.                     }
  62.                 }
  63.             txSetDisp(text);
  64.         }
  65.         return ret;
  66.     }
  67.     return FALSE;
  68. }
  69.  
  70. BOOL txkeySelectWin(TX* text)
  71. {
  72.     return _txkeySelectWin(text,0);
  73. }
  74.  
  75. static void txIdmRight(TX* text)
  76. {
  77.     if (text->cur0 - text->cury == text->curysize) {
  78.         //WZ4.00Bl 990909 IDM_JUMPLINETAIL後にIDM_RIGHTしたときは、次の行の先頭へ移動するようにした。ユーザ要望。
  79.         txRightBytes(text,0);
  80.     } else {
  81.         txRight(text);
  82.     }
  83. }
  84.  
  85. static BOOL _txIDM_RIGHT(TX* text,int idm)
  86. {
  87.     text->fTxfDirect += text->fTxf;    // これしないと選択表示が乱れることがある
  88.     if (text->fCursorNoLf && text->cur0 - text->cury + txGetCharSize(text,text->cur) >= text->curysize) {
  89.         //WZ3.90J 981109 
  90.     } else if (text->fClip == CLIP_BOX) {    //WZ4.00Bl 990907 箱形選択時は一時的にフリーカーソルにした。ユーザ要望。
  91.         txRightFree(text);
  92.     } else if (txGetFreeCursor(text) && !text->fClip && (idm != IDM_RIGHTBINEDIT)) {
  93.         // 選択中はフリーカーソルOFF
  94.         if (_txkeySelectWin(text,idm) != 2) txRightFree(text);
  95.     } else if (text->fBinedit && txIsCurDigitH(text)) {
  96.         txSetCurDigitL(text);
  97. #if !WZFUNC_TABBEAM && WZFUNC_EDITOR    //WZ3.90O 981203 
  98.     } else if (txGetApfu(text) && txGetChar(text) == CHAR_TAB) {
  99.         //WCE1.01 980127 
  100.         text->fUndispCursor++;
  101.         while(1) {
  102.             if (!txRight(text)) break;
  103.             if (txGetChar(text) != CHAR_TAB) break;
  104.         }
  105.         text->fUndispCursor--;
  106.         txDispCursor(text);
  107.         txDispLocate(text);
  108. #endif
  109.     } else {
  110.         #if WZFUNC_EDITOR
  111.         int iClm;
  112.         if (
  113.             txGetMultiClm(text) && 
  114.             !text->fNoClmMove &&    //WCE1.01 980312 
  115.             ((iClm = txClmFromLy(text,text->ly)) + 1 < text->nClm) &&
  116.             (
  117.                 (text->cur0 - text->cury + txGetCharSize(text,text->cur) == text->curysize) ||
  118.                 txIsCurFree(text)
  119.             )
  120.         ) {
  121.             int lyClmTop = txClmGetLy(text,iClm);
  122.             int lcywindow = txClmGetLy(text,iClm + 1) - lyClmTop;
  123.             if (IsAtPrint(text)) {
  124.             }
  125.             if (txGetDownAble(text,lcywindow)) {
  126.                 text->fUndispCursor++;
  127.                 if (iClm + 1 < text->nClm) {
  128.                     txDownN(text,lcywindow);
  129.                 } else {
  130.                     txNextRollN(text,lcywindow);
  131.                 }
  132.                 txJumpLineTop(text);
  133.                 text->fUndispCursor--;
  134.                 txDispCursor(text);
  135.                 txDispLocate(text);
  136.             } else {
  137.                 if (_txkeySelectWin(text,idm) != 2) txIdmRight(text);    //WZ4.00A 981229 2段組編集で右段に行がないとき左段で→を使って次の行に移動できるようにした。
  138.             }
  139.         } else {
  140.             if (_txkeySelectWin(text,idm) != 2) txIdmRight(text);
  141.         }
  142.         #else
  143.         if (_txkeySelectWin(text,idm) != 2) txIdmRight(text);
  144.         #endif
  145.     }
  146.     text->fTxfDirect -= text->fTxf;
  147.     txfRightChartopTxf(text);
  148.     return TRUE;
  149. }
  150.  
  151. BOOL txIDM_RIGHTBINEDIT(TX* text)
  152. {
  153.     return _txIDM_RIGHT(text,IDM_RIGHTBINEDIT);
  154. }
  155.  
  156. BOOL txIDM_RIGHT(TX* text)
  157. {
  158.     return _txIDM_RIGHT(text,IDM_RIGHT);
  159. }
  160.  
  161. BOOL txIDM_LEFT(TX* text)
  162. {
  163.     text->fTxfDirect += text->fTxf;    // これしないと選択表示が乱れることがある
  164.     if (text->fCursorNoLf && text->cury == text->cur0) {
  165.         //WZ3.90J 981109 
  166.     } else if (text->fClip == CLIP_BOX) {    //WZ4.00Bl 990907 箱形選択時は一時的にフリーカーソルにした。ユーザ要望。
  167.         txLeftFree(text);
  168.     } else if (txGetFreeCursor(text)) {
  169.         if (_txkeySelectWin(text,IDM_LEFT) != 2) txLeftFree(text);
  170.     } else if (text->fBinedit && txIsCurDigitL(text)) {
  171.         txSetCurDigitH(text);
  172. #if !WZFUNC_TABBEAM && WZFUNC_EDITOR    //WZ3.90O 981203 
  173.     } else if (txGetApfu(text) && txGetPrevChar(text) == CHAR_TAB) {
  174.         //WCE1.01 980127 
  175.         text->fUndispCursor++;
  176.         while(1) {
  177.             if (!txLeft(text)) break;
  178.             if (txGetPrevChar(text) != CHAR_TAB) break;
  179.         }
  180.         text->fUndispCursor--;
  181.         txDispCursor(text);
  182.         txDispLocate(text);
  183. #endif
  184.     } else {
  185.         #if WZFUNC_EDITOR
  186.         int iClm;
  187.         if (
  188.             txGetMultiClm(text) &&
  189.             !text->fNoClmMove &&    //WCE1.01 980312 
  190.             ((iClm = txClmFromLy(text,text->ly)) > 0) &&
  191.             text->cury == text->cur0
  192.         ) {
  193.             int lcywindow = text->lcywindow / text->nClm;
  194.             if (txGetUpAble(text,lcywindow)) {
  195.                 text->fUndispCursor++;
  196.                 if (iClm == 0) {
  197.                     txPrevRollN(text,lcywindow);
  198.                 } else {
  199.                     txUpN(text,lcywindow);
  200.                 }
  201.                 txJumpLineEnd(text);
  202.                 text->fUndispCursor--;
  203.                 txDispCursor(text);
  204.                 txDispLocate(text);
  205.             }
  206.         } else {
  207.             if (_txkeySelectWin(text,IDM_LEFT) != 2) txLeft(text);
  208.         }
  209.         #else
  210.         if (_txkeySelectWin(text,IDM_LEFT) != 2) txLeft(text);
  211.         #endif
  212.     }
  213.     text->fTxfDirect -= text->fTxf;
  214.     txfLeftChartopTxf(text);
  215.     return TRUE;
  216. }
  217.  
  218. //##単語単位の移動
  219.  
  220. BOOL txIDM_LEFTWORD(TX* text)
  221. {
  222.     txkeySelectWin(text);
  223.     txLeftWord(text);
  224.     txfLeftChartopTxf(text);
  225.     return TRUE;
  226. }
  227.  
  228. BOOL txIDM_LEFTWORDMI(TX* text)
  229. {
  230.     txkeySelectWin(text);
  231.     txLeftWordMi(text);
  232.     txfLeftChartopTxf(text);
  233.     return TRUE;
  234. }
  235.  
  236. BOOL txIDM_RIGHTWORD(TX* text)
  237. {
  238.     txkeySelectWin(text);
  239.     txRightWord(text);
  240.     txfRightChartopTxf(text);
  241.     return TRUE;
  242. }
  243.  
  244. BOOL txIDM_RIGHTWORDMI(TX* text)
  245. {
  246.     txkeySelectWin(text);
  247.     txRightWordMi(text);
  248.     txfRightChartopTxf(text);
  249.     return TRUE;
  250. }
  251.  
  252. BOOL txIDM_JUMPWORDTOPMI(TX* text)
  253. {
  254.     txkeySelectWin(text);
  255.     txJumpWordTopMi(text);
  256.     txfLeftChartopTxf(text);
  257.     return TRUE;
  258. }
  259.  
  260. BOOL txIDM_JUMPWORDENDMI(TX* text)
  261. {
  262.     txkeySelectWin(text);
  263.     txJumpWordEndMi(text);
  264.     txfRightChartopTxf(text);
  265.     return TRUE;
  266. }
  267.  
  268. //##行内の移動
  269.  
  270. BOOL txIDM_JUMPLINETOP(TX* text)
  271. {
  272.     txkeySelectWin(text);
  273.     txJumpLineTop(text);
  274.     return TRUE;
  275. }
  276.  
  277. BOOL txIDM_JUMPLINETAIL(TX* text)
  278. {
  279.     txkeySelectWin(text);
  280.     txJumpLineTail(text);
  281.     return TRUE;
  282. }
  283.  
  284. BOOL txIDM_JUMPPARATOP(TX* text)
  285. {
  286.     txJumpParaTop(text);
  287.     return TRUE;
  288. }
  289.  
  290. BOOL txIDM_JUMPPARAEND(TX* text)
  291. {
  292.     txJumpParaEnd(text);
  293.     return TRUE;
  294. }
  295.  
  296. //##行単位の移動
  297.  
  298. BOOL txIDM_DOWNHIGH(TX* text)
  299. {
  300.     txNextRollN(text,4);
  301.     return TRUE;
  302. }
  303.  
  304. BOOL txIDM_UPHIGH(TX* text)
  305. {
  306.     txPrevRollN(text,4);
  307.     return TRUE;
  308. }
  309.  
  310. BOOL txIDM_NEXTROLL(TX* text)
  311. {
  312.     int nRepeat = text->nRepeatKey;
  313.     if (text->idmPrev == IDM_NEXTROLL && text->wtmIdmPrevD < 100) {
  314.         nRepeat = text->nKeyScrollAcc;
  315.         if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  316.         if (nRepeat <= 0) nRepeat = 1;
  317.     }
  318.     txNextRollN(text,nRepeat);
  319.     return TRUE;
  320. }
  321.  
  322. BOOL txIDM_PREVROLL(TX* text)
  323. {
  324.     int nRepeat = text->nRepeatKey;
  325.     if (text->idmPrev == IDM_PREVROLL && text->wtmIdmPrevD < 100) {
  326.         nRepeat = text->nKeyScrollAcc;
  327.         if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  328.         if (nRepeat <= 0) nRepeat = 1;
  329.     }
  330.     txPrevRollN(text,nRepeat);
  331.     return TRUE;
  332. }
  333.  
  334. BOOL txIDM_DOWN(TX* text)
  335. {
  336.     int nRepeat = text->nRepeatKey;
  337.     if (
  338.         (text->idmPrev == IDM_DOWN) &&
  339.         (text->ly + 1 >= text->lcywindow - txGetLcySmlower(text)) &&
  340.         !keymacroGetBusy()    //WZ4.00Ac 990207 
  341.     ) {
  342.         text->nrepeat = text->nrepeat + nRepeat;    // for __TXC__
  343.         if (text->nrepeat > text->nKeyScrollAccStart) {
  344.             text->nrepeat = text->nKeyScrollAccStart + 1;
  345.             nRepeat = text->nKeyScrollAcc;
  346. //                        if (text->nSameIdm > 4) nRepeat *= 2;// 更に加速
  347.             if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  348.             if (nRepeat <= 0) nRepeat = 1;
  349.             if (text->nSameIdm < 200) text->nSameIdm = text->nSameIdm + 1;    // for __TXC__
  350.         } else if (text->wtmIdmPrevD > 100) {
  351.             text->nrepeat = 0;
  352.             text->nSameIdm = 0;
  353.         }
  354. #if 0//WZ3.90I 981103 fReadModeでスクロールするのは使いにくいので廃止
  355.     } else if (text->fReadMode && text->idmPrev == IDM_DOWN && text->wtmIdmPrevD < 100) {
  356.         nRepeat = text->nKeyScrollAcc;
  357.         if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  358.         if (nRepeat <= 0) nRepeat = 1;
  359.         if (text->nSameIdm < 200) text->nSameIdm++;
  360. #endif
  361.     } else {
  362.         text->nrepeat = 0;
  363.         text->nSameIdm = 0;
  364.     }
  365.     if (_txkeySelectWin(text,IDM_DOWN) != 2) {
  366. #if 1//WZ3.90I 981103 fReadModeでスクロールするのは使いにくいので廃止
  367.         txDownN(text,nRepeat);
  368. #else
  369.         if (text->fReadMode && !txIsCurscreenDispEof(text)) {    //PWZ2BETA0.3 980522 txIsCurscreenDispEof
  370.             txNextRollN(text,nRepeat);
  371.         } else {
  372.             txDownN(text,nRepeat);
  373.         }
  374. #endif
  375.     }
  376.     txfRightChartopTxf(text);
  377.     return TRUE;
  378. }
  379.  
  380. BOOL txIDM_UP(TX* text)
  381. {
  382.     int nRepeat = text->nRepeatKey;
  383.     if (
  384.         (text->idmPrev == IDM_UP) &&
  385.         text->ly <= text->lcySmupper &&
  386.         !keymacroGetBusy()    //WZ4.00Ac 990207 キーボードマクロ記録再生中はUp/Downによるスクロール加速をしないようにした。スクロール加速がされると、カーソルを期待した行数Up/Downするキーボードマクロがつくれない。
  387.     ) {
  388.         text->nrepeat = text->nrepeat + nRepeat;    // for __TXC__
  389.         if (text->nrepeat > text->nKeyScrollAccStart) {
  390.             text->nrepeat = text->nKeyScrollAccStart + 1;
  391.             nRepeat = text->nKeyScrollAcc;
  392. //                        if (text->nSameIdm > 4) nRepeat *= 2;// 更に加速
  393.             if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  394.             if (nRepeat <= 0) nRepeat = 1;
  395.             if (text->nSameIdm < 200) text->nSameIdm = text->nSameIdm + 1;    // for __TXC__
  396.         } else if (text->wtmIdmPrevD > 100) {
  397.             text->nrepeat = 0;
  398.             text->nSameIdm = 0;
  399.         }
  400. #if 0//WZ3.90I 981103 fReadModeでスクロールするのは使いにくいので廃止
  401.     } else if (text->fReadMode && text->idmPrev == IDM_UP && text->wtmIdmPrevD < 100) {
  402.         nRepeat = text->nKeyScrollAcc;
  403.         if (nRepeat > text->lcywindow) nRepeat = text->lcywindow;
  404.         if (nRepeat <= 0) nRepeat = 1;
  405.         if (text->nSameIdm < 200) text->nSameIdm++;
  406. #endif
  407.     } else {
  408.         text->nrepeat = 0;
  409.         text->nSameIdm = 0;
  410.     }
  411.     if (_txkeySelectWin(text,IDM_UP) != 2) {
  412. #if 1//WZ3.90I 981103 fReadModeでスクロールするのは使いにくいので廃止
  413.         txUpN(text,nRepeat);
  414. #else
  415.         if (text->fReadMode && !txIsCurscreenDispEof(text)) {//PWZ2BETA0.3 980522 txIsCurscreenDispEof
  416.             txPrevRollN(text,nRepeat);
  417.         } else {
  418.             txUpN(text,nRepeat);
  419.         }
  420. #endif
  421.     }
  422.     txfRightChartopTxf(text);
  423.     return TRUE;
  424. }
  425.  
  426. //##ページ単位の移動
  427.  
  428. static BOOL _txIDM_PAGEUP(TX* text,int idm)
  429. {
  430.     BOOL fNoPagingMode = (text->fFilelist || (idm == IDM_PAGEUPPRIM));    //WZ4.00Ba 990303 VZ準拠キー定義でFILERでPageUp/Downが効かないことがあった。
  431.     if (!fNoPagingMode && sh->pagingmode == 'S') {
  432.         txSearchContinuePrev(text);
  433.     } else if (!fNoPagingMode && sh->pagingmode == 'C') {
  434.         txHeadlineSearchPrev(text);
  435.     } else {
  436.         txkeySelectWin(text);
  437.         if (text->fHalfPage) {
  438.             txPrevHalfPage(text);
  439.         } else {
  440.             txPrevPage(text);
  441.         }
  442.     }
  443.     return TRUE;
  444. }
  445.  
  446. BOOL txIDM_PAGEUPPRIM(TX* text)
  447. {
  448.     return _txIDM_PAGEUP(text,IDM_PAGEUPPRIM);
  449. }
  450.  
  451. BOOL txIDM_PAGEUP(TX* text)
  452. {
  453.     return _txIDM_PAGEUP(text,IDM_PAGEUP);
  454. }
  455.  
  456. static BOOL _txIDM_PAGEDOWN(TX* text,int idm)
  457. {
  458.     BOOL fNoPagingMode = (text->fFilelist || (idm == IDM_PAGEDOWNPRIM));    //WZ4.00Ba 990303 VZ準拠キー定義でFILERでPageUp/Downが効かないことがあった。
  459.     if (!fNoPagingMode && sh->pagingmode == 'S') {
  460.         txSearchContinue(text);
  461.     } else if (!fNoPagingMode && sh->pagingmode == 'C') {
  462.         txHeadlineSearchNext(text);
  463.     } else {
  464.         txkeySelectWin(text);
  465.         if (text->fHalfPage) {
  466.             txNextHalfPage(text);
  467.         } else {
  468.             txNextPage(text);
  469.         }
  470.     }
  471.     return TRUE;
  472. }
  473.  
  474. BOOL txIDM_PAGEDOWNPRIM(TX* text)
  475. {
  476.     return _txIDM_PAGEDOWN(text,IDM_PAGEDOWNPRIM);
  477. }
  478.  
  479. BOOL txIDM_PAGEDOWN(TX* text)
  480. {
  481.     return _txIDM_PAGEDOWN(text,IDM_PAGEDOWN);
  482. }
  483.  
  484. BOOL txIDM_JUMPSCREENTOP(TX* text)
  485. {
  486.     txkeySelectWin(text);
  487.     if (text->flpPreview) {
  488.         //WZ3.90H 980918 プレビューの場合は段の下まで移動。この方が使いやすい
  489.         int iClm = txClmFromLy(text,text->ly);
  490.         int ly = txClmGetLy(text,iClm);
  491.         txJumpLy(text,ly);
  492.         txJumpX(text,text->x0);//WZ4.00Ba 990228 
  493.     } else {
  494.         txJumpLy(text,text->lcySmupper);
  495.         txJumpX(text,text->x0);//WZ4.00Ba 990228 IDM_JUMPSCREENTOPでカーソル桁位置を保存するようにした
  496.         #if !WINDOWSCE && !__TXC__
  497.         if (text->idmLast == IDM_JUMPSCREENTOP && text->fVzEs) {
  498.             txAsStart(text,TRUE);
  499.         }
  500.         #endif
  501.     }
  502.     return TRUE;
  503. }
  504.  
  505. BOOL txIDM_JUMPSCREENEND(TX* text)
  506. {
  507.     txkeySelectWin(text);
  508.     if (text->flpPreview) {
  509.         //WZ3.90H 980918 プレビューの場合は段の下まで移動。この方が使いやすい
  510.         int iClm = txClmFromLy(text,text->ly);
  511.         int lcy = txClmGetLy(text,iClm+1);
  512.         txJumpLy(text,lcy - 1);
  513.         txJumpX(text,text->x0);//WZ4.00Ba 990228 
  514.     } else {
  515.         txJumpLy(text,text->lcywindow - txGetLcySmlower(text) - 1);
  516.         txJumpX(text,text->x0);//WZ4.00Ba 990228 IDM_JUMPSCREENENDでカーソル桁位置を保存するようにした
  517.         #if !WINDOWSCE && !__TXC__
  518.         if (text->idmLast == IDM_JUMPSCREENEND && text->fVzEs) {
  519.             txAsStart(text,FALSE);
  520.         }
  521.         #endif
  522.     }
  523.     return TRUE;
  524. }
  525.  
  526. //##大域移動
  527.  
  528. BOOL txIDM_JUMPFILETOPLINE(TX* text)
  529. {
  530.     if (txkeySelectWin(text)) {
  531.         txJumpFileTop(text);
  532.     } else {
  533.         txJumpFileTopLine(text);
  534.     }
  535.     return TRUE;
  536. }
  537.  
  538. BOOL txIDM_JUMPFILEENDLINE(TX* text)
  539. {
  540.     if (txkeySelectWin(text)) {
  541.         txJumpFileEnd(text);
  542.     } else {
  543.         txJumpFileEndLine(text);
  544.     }
  545.     return TRUE;
  546. }
  547.  
  548. BOOL txIDM_JUMPFILETOP(TX* text)
  549. {
  550.     txkeySelectWin(text);
  551.     txJumpFileTop(text);
  552.     return TRUE;
  553. }
  554.  
  555. BOOL txIDM_JUMPFILEEND(TX* text)
  556. {
  557.     txkeySelectWin(text);
  558.     txJumpFileEnd(text);
  559.     return TRUE;
  560. }
  561.  
  562. //##プラグイン
  563.  
  564. #if __TXC__
  565. void __pluginGetProperty(mchar* prop,txstr res)
  566. {
  567. //information("%s",prop);
  568.     if (!stricmp(prop,"name")) res = "カーソル移動IDM処理";
  569.     if (!stricmp(prop,"author")) res = sysGetName();
  570.     if (!stricmp(prop,"version")) res = sysGetVersionPrim();
  571. }
  572.  
  573. static HOOKRESULT CALLBACK wndprocTextHook(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
  574. {
  575.     if (message == WM_TXEVENT && wParam == TXEVENT_IDMEXEC) {
  576.         TX* text = hwndtextGetText(hwnd);
  577.         int idm = lParam;
  578.         switch(idm) {
  579.             case IDM_LEFT: {    // サンプル
  580. statprintf("IDM_LEFT by macro");
  581.                 txIDM_LEFT(text);
  582.                 return HOOK_CAPTURE;
  583.             }
  584.         }
  585.     }
  586.     return HOOK_CONTINUE;
  587. }
  588.  
  589. void __on_txFrameNew(TX* text)
  590. {
  591.     txSetHookWndproctextTxpcode(text,wndprocTextHook);
  592. }
  593.  
  594. #endif
  595.