[BACK]Return to asir32guiview.cpp CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / windows / asir32gui

Annotation of OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp, Revision 1.12

1.1       noro        1: // asir32guiView.cpp : CAsir32guiView クラスの動作の定義を行います。
                      2: //
                      3:
                      4: #include "stdafx.h"
                      5:
                      6: #include "asir32gui.h"
                      7: #include "asir32guiDoc.h"
                      8: #include "asir32guiView.h"
                      9: #include "FatalDialog.h"
1.3       noro       10: #include <direct.h>
1.6       noro       11: #include <io.h>
1.1       noro       12:
                     13: #ifdef _DEBUG
                     14: #define new DEBUG_NEW
                     15: #undef THIS_FILE
                     16: static char THIS_FILE[] = __FILE__;
                     17: #endif
                     18:
1.5       noro       19: // const TextBufferSize     = 32768;
                     20: const TextBufferSize     = 16384;
1.1       noro       21:
                     22: CAsir32guiView *theView;
                     23:
                     24: extern "C"
                     25: {
                     26: char *prev_hist(void), *next_hist(void), *search_hist(char *p);
                     27: void read_input_history(),write_input_history();
                     28: void init_input_history();
                     29: void add_hist(char *p), reset_traverse(void);
                     30: void asir_terminate(void);
                     31: void Main(int,char*[]);
                     32: void loadfile(char *);
                     33: void put_line(char *);
                     34: void send_intr(void);
                     35: void insert_to_theView(char *);
                     36: void get_rootdir(char *,int,char *);
                     37: extern int bigfloat, prtime, prresult;
                     38: extern char *asir_libdir;
1.2       noro       39: extern int asirgui_kind;
1.1       noro       40:
                     41: void insert_to_theView(char *str)
                     42: {
                     43:        (void)theView->Insert(str);
                     44: }
                     45: void flush_log()
                     46: {
                     47:        if ( theView->Logging )
                     48:                theView->OnFileLog();
                     49: }
                     50: }
                     51:
                     52: /////////////////////////////////////////////////////////////////////////////
                     53: // CAsir32guiView
                     54:
                     55: IMPLEMENT_DYNCREATE(CAsir32guiView, CEditView)
                     56:
                     57: BEGIN_MESSAGE_MAP(CAsir32guiView, CEditView)
                     58:        //{{AFX_MSG_MAP(CAsir32guiView)
                     59:        ON_WM_KEYDOWN()
                     60:        ON_WM_CHAR()
                     61:        ON_WM_LBUTTONUP()
                     62:        ON_WM_RBUTTONDOWN()
                     63:        ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
                     64:        ON_COMMAND(ID_FILE_LOG, OnFileLog)
                     65:        ON_COMMAND(ID_ASIRHELP, OnAsirhelp)
                     66:        ON_UPDATE_COMMAND_UI(ID_FILE_LOG, OnUpdateFileLog)
                     67:        ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
1.3       noro       68:        ON_COMMAND(IDR_FONT, OnFont)
                     69:        ON_WM_CREATE()
1.6       noro       70:        ON_COMMAND(ID_CONTRIBHELP, OnContribhelp)
1.9       noro       71:        ON_WM_SIZE()
1.11      noro       72:        ON_COMMAND(ID_DSOLV, OnDsolv)
                     73:        ON_COMMAND(ID_GNUPLOT, OnGnuplot)
                     74:        ON_COMMAND(ID_OKDIFF, OnOkdiff)
                     75:        ON_COMMAND(ID_OKDMODULE, OnOkdmodule)
                     76:        ON_COMMAND(ID_OM, OnOm)
                     77:        ON_COMMAND(ID_PFPCOH, OnPfpcoh)
                     78:        ON_COMMAND(ID_PLUCKER, OnPlucker)
                     79:        ON_COMMAND(ID_SM1, OnSm1)
                     80:        ON_COMMAND(ID_TIGERS, OnTigers)
                     81:        ON_COMMAND(ID_TODOPARAMETRIZE, OnTodoparametrize)
1.1       noro       82:        //}}AFX_MSG_MAP
                     83:        // 標準印刷コマンド
                     84: //     ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
                     85: //     ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
                     86: //     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
                     87: END_MESSAGE_MAP()
                     88:
                     89: /////////////////////////////////////////////////////////////////////////////
                     90: // CAsir32guiView クラスの構築/消滅
                     91:
                     92: CAsir32guiView::CAsir32guiView()
                     93: {
                     94:        // TODO: この場所に構築用のコードを追加してください。
                     95:        static int tmpView_created = 0;
                     96:        char errmsg[BUFSIZ];
                     97:
                     98:        init_input_history();
                     99:        read_input_history();
                    100:        DebugMode = 0;
                    101:        DebugInMain = 0;
1.9       noro      102: //     MaxLineLength = 80;
1.1       noro      103:        LogStart = 0;
                    104:        Logging = 0;
                    105:        Logfp = NULL;
                    106:        ResetIndex();
                    107:        theView = this;
                    108: }
                    109:
                    110: CAsir32guiView::~CAsir32guiView()
                    111: {
                    112:        write_input_history();
                    113: }
                    114:
                    115: BOOL CAsir32guiView::PreCreateWindow(CREATESTRUCT& cs)
                    116: {
                    117:        // TODO: この位置で CREATESTRUCT cs を修正して Window クラスまたはスタイルを
                    118:        //       修正してください。
                    119:
                    120:        m_dwDefaultStyle = dwStyleDefault & ~ES_AUTOHSCROLL ;
                    121:        m_dwDefaultStyle &= ~WS_HSCROLL;
                    122:        return CCtrlView::PreCreateWindow(cs);
                    123: }
                    124:
                    125: /////////////////////////////////////////////////////////////////////////////
                    126: // CAsir32guiView クラスの描画
                    127:
                    128: void CAsir32guiView::OnDraw(CDC* pDC)
                    129: {
                    130:        CAsir32guiDoc* pDoc = GetDocument();
                    131:        ASSERT_VALID(pDoc);
                    132:
                    133:        // TODO: この場所にネイティブ データ用の描画コードを追加します。
                    134: }
                    135:
                    136: /////////////////////////////////////////////////////////////////////////////
                    137: // CAsir32guiView クラスの印刷
                    138:
                    139: BOOL CAsir32guiView::OnPreparePrinting(CPrintInfo* pInfo)
                    140: {
                    141:        // デフォルトの印刷準備
                    142:        return DoPreparePrinting(pInfo);
                    143: }
                    144:
                    145: void CAsir32guiView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
                    146: {
                    147:        // TODO: 印刷前の特別な初期化処理を追加してください。
                    148: }
                    149:
                    150: void CAsir32guiView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
                    151: {
                    152:        // TODO: 印刷後の後処理を追加してください。
                    153: }
                    154:
                    155: /////////////////////////////////////////////////////////////////////////////
                    156: // CAsir32guiView クラスの診断
                    157:
                    158: #ifdef _DEBUG
                    159: void CAsir32guiView::AssertValid() const
                    160: {
                    161:        CEditView::AssertValid();
                    162: }
                    163:
                    164: void CAsir32guiView::Dump(CDumpContext& dc) const
                    165: {
                    166:        CEditView::Dump(dc);
                    167: }
                    168:
                    169: CAsir32guiDoc* CAsir32guiView::GetDocument() // 非デバッグ バージョンはインラインです。
                    170: {
                    171:        ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAsir32guiDoc)));
                    172:        return (CAsir32guiDoc*)m_pDocument;
                    173: }
                    174: #endif //_DEBUG
                    175:
                    176: /////////////////////////////////////////////////////////////////////////////
                    177: // CAsir32guiView クラスのメッセージ ハンドラ
                    178:
                    179: void CAsir32guiView::PutChar(int c)
                    180: {
1.8       noro      181:   int i,len;
1.1       noro      182:   char buf[2];
                    183:
1.8       noro      184:   if ( EndPos >= sizeof(Buffer)-1 ) {
                    185:       Beep(); return;
                    186:   }
1.1       noro      187:   for ( i = EndPos-1; i >= CurrentPos; i-- )
1.8       noro      188:       Buffer[i+1] = Buffer[i];
1.1       noro      189:   Buffer[CurrentPos] = (char)c;
1.8       noro      190: //  buf[0] = (char)c; buf[1] = 0;
                    191: //  Insert(buf,FALSE);
                    192:   len = GetWindowTextLength();
                    193:   if ( len+1 >= TextBufferSize )
                    194:       DeleteTop();
                    195:   CEditView::OnChar(c, 1, 0);
1.1       noro      196:   CurrentPos++;
                    197:   EndPos++;
                    198: }
                    199:
                    200: void CAsir32guiView::DeleteChar(int count) {
                    201:   int i,s,e;
                    202:   char null = 0;
                    203:
                    204:   if ( count > (EndPos-CurrentPos) )
                    205:     count = EndPos - CurrentPos;
                    206:   if ( count == 0 )
                    207:     Beep();
                    208:   else {
                    209:     EndPos -= count;
                    210:     for ( i = CurrentPos; i < EndPos; i++ )
                    211:       Buffer[i] = Buffer[i+count];
                    212:     GetEditCtrl().GetSel(s,e);
                    213:     GetEditCtrl().SetSel(s,s+count);
                    214:     GetEditCtrl().ReplaceSel(&null);
                    215:   }
                    216: }
                    217:
                    218: void CAsir32guiView::Insert(char *buf,BOOL wrap)
                    219: {
                    220:        char t[BUFSIZ*4];
                    221:        char *p,*q,c;
                    222:        int len;
                    223:        int i;
                    224:
                    225:        if ( wrap ) {
                    226:                i = GetEditCtrl().LineLength(-1);
                    227:                for ( p = t, q = buf; (c = *p++ = *q++) != 0; )
                    228:                        if ( c == '\r' ) {
                    229:                                *p++ = *q++; i = 0;
                    230:                        } else if ( (*q != '\r') && (++i == MaxLineLength) ) {
                    231:                                *p++ = '\r'; *p++ = '\r'; *p++ = '\n'; i = 0;
                    232:                        }
                    233:                p = t;
                    234:        } else
                    235:                p = buf;
                    236:        len = GetWindowTextLength();
                    237:        if ( strlen(p) + len >= TextBufferSize )
                    238:                DeleteTop();
                    239:        GetEditCtrl().ReplaceSel(p);
                    240: }
                    241:
                    242: void CAsir32guiView::DeleteTop()
                    243: {
                    244:   const char *p,*q;
                    245:   const char *buf;
                    246:   char null = 0;
                    247:   int len,len0,len1;
                    248:
                    249:   buf = LockBuffer();
                    250:   len0 = len = strlen(buf);
                    251:   for ( p = buf; len >= TextBufferSize/2; ) {
                    252:     q = strchr(p,'\n');
                    253:     if ( !q ) {
                    254:        len = 0; break;
                    255:     } else {
                    256:       q++; len -= (q-p); p = q;
                    257:     }
                    258:   }
                    259:   if ( Logging ) {
1.4       noro      260:     if ( len < LogStart )
                    261:        LogStart -= len;
                    262:     else {
                    263:        fwrite(buf+LogStart,1,len-LogStart,Logfp);
                    264:        LogStart = 0;
                    265:     }
1.1       noro      266:   }
                    267:   UnlockBuffer();
                    268:   if ( q ) {
                    269:        GetEditCtrl().SetSel(0,len);
                    270:        GetEditCtrl().ReplaceSel(&null);
                    271:   }
                    272:   UpdateCursor(EndPos);
                    273: }
                    274:
                    275: void CAsir32guiView::UpdateCursor(int pos)
                    276: {
                    277:   int s;
                    278:   int len;
                    279:
                    280:   if ( pos < 0 || pos > EndPos )
                    281:     Beep();
                    282:   else {
                    283:     len = GetWindowTextLength();
                    284:     CurrentPos = pos;
                    285:     s = len-EndPos+CurrentPos;
                    286:     GetEditCtrl().SetSel(s,s);
                    287:   }
                    288: }
                    289:
                    290: void CAsir32guiView::ReplaceString(char *str)
                    291: {
                    292:   UpdateCursor(0); DeleteChar(EndPos);
                    293:   Insert(str,FALSE);
                    294:   strcpy(Buffer,str);
                    295:   EndPos = CurrentPos = strlen(str);
                    296: }
                    297:
                    298: void CAsir32guiView::Beep(void) {
                    299:   ::MessageBeep(0xffffffff);
                    300: }
                    301:
                    302: void CAsir32guiView::Paste(void) {
1.8       noro      303:     char buf[2*BUFSIZ];
                    304:     const char *src;
                    305:     char c;
                    306:     int i,j,l;
                    307:     HGLOBAL hClip;
                    308:
                    309:     if ( asirgui_kind == ASIRGUI_MESSAGE ) {
                    310:         Beep(); return;
                    311:     }
1.2       noro      312:
1.8       noro      313:     if ( OpenClipboard() == FALSE ) {
                    314:         Beep(); return;
1.1       noro      315:     }
                    316:     hClip = GetClipboardData(CF_TEXT);
                    317:     src = (const char *)::GlobalLock(hClip);
1.10      noro      318:     if ( !src || (l=strlen(src)) >= sizeof(Buffer)-EndPos ) {
1.1       noro      319:        ::CloseClipboard();
                    320:        Beep(); return;
                    321:     }
1.8       noro      322:     for ( i = j = 0; i < l; i++ )
                    323:         if ( (c = src[i]) != '\n' && c != '\r' )
                    324:              buf[j++] = c;
                    325:     buf[j] = 0;
1.1       noro      326:     ::GlobalUnlock(hClip);
                    327:     ::CloseClipboard();
                    328:     GetEditCtrl().ReplaceSel(buf);
1.10      noro      329:     l = strlen(buf);
                    330:     for ( i = EndPos-1; i >= CurrentPos; i-- )
                    331:        Buffer[i+l] = Buffer[i];
                    332:     for ( j = 0, i = CurrentPos; j < l; j++, i++ )
                    333:        Buffer[i] = buf[j];
                    334:     EndPos += l; CurrentPos += l;
1.1       noro      335: }
                    336:
                    337: #define CTRL(c) (c)&0x1f
                    338:
                    339: void CAsir32guiView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
                    340: {
                    341:        // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください
                    342:        char *exp_result;
                    343:
                    344:        switch ( nChar ) {
                    345:                case VK_LEFT:
                    346:                        UpdateCursor(CurrentPos-1); return;
                    347:                case VK_RIGHT:
                    348:                        UpdateCursor(CurrentPos+1); return;
                    349:                case VK_DELETE:
                    350:                        DeleteChar(1); return;
                    351:                case VK_UP:
                    352:                        if ( (exp_result = prev_hist()) != 0 )
                    353:                                ReplaceString(exp_result);
                    354:                        else
                    355:                                Beep();
                    356:                        return;
                    357:                case VK_DOWN:
                    358:                        if ( (exp_result = next_hist()) != 0 )
                    359:                                ReplaceString(exp_result);
                    360:                        else
                    361:                                Beep();
                    362:                        return;
                    363:                default:
                    364:                        break;
                    365:        }
                    366:        CEditView::OnKeyDown(nChar, nRepCnt, nFlags);
                    367: }
                    368:
                    369: void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
                    370: {
                    371:        // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください
                    372:        char *exp_result;
                    373:
1.2       noro      374:        if ( asirgui_kind == ASIRGUI_MESSAGE ) {
                    375:                Beep(); return;
                    376:        }
                    377:
1.1       noro      378:        switch ( nChar ) {
                    379:        case CTRL('M'): case CTRL('J'):
                    380:                UpdateCursor(EndPos);
                    381:                Buffer[EndPos] = 0;
                    382:                reset_traverse();
                    383:                if ( Buffer[0] == '!' ) {
                    384:                exp_result = search_hist(Buffer+1);
                    385:                if ( exp_result )
                    386:                        ReplaceString(exp_result);
                    387:                else {
                    388:                        UpdateCursor(0); DeleteChar(EndPos); Beep();
                    389:                }
                    390:                return;
                    391:                } else {
                    392:                        add_hist(Buffer);
                    393:                        put_line(Buffer);
                    394:                        ResetIndex();
                    395:                        nChar = CTRL('M');
                    396:                }
                    397:                break;
                    398:        case CTRL('N'):
                    399:                if ( (exp_result = next_hist()) != 0 )
                    400:                ReplaceString(exp_result);
                    401:                else
                    402:                Beep();
                    403:                return;
                    404:        case CTRL('P'):
                    405:                if ( (exp_result = prev_hist()) != 0 )
                    406:                ReplaceString(exp_result);
                    407:                else
                    408:                Beep();
                    409:                return;
                    410:        case CTRL('A'):
                    411:                UpdateCursor(0); return;
                    412:        case CTRL('E'):
                    413:                UpdateCursor(EndPos); return;
                    414:        case CTRL('F'):
                    415:                UpdateCursor(CurrentPos+1); return;
                    416:        case CTRL('B'):
                    417:                UpdateCursor(CurrentPos-1); return;
                    418:        case CTRL('K'):
                    419:                DeleteChar(EndPos-CurrentPos); return;
                    420:        case CTRL('U'):
                    421:                UpdateCursor(0); DeleteChar(EndPos); return;
                    422:        case CTRL('D'):
                    423:                DeleteChar(1); return;
                    424:        case CTRL('H'):
                    425:                if ( CurrentPos > 0 ) {
                    426:                UpdateCursor(CurrentPos-1); DeleteChar(1);
                    427:                } else
                    428:                Beep();
                    429:                return;
                    430:        case CTRL('C'):
                    431:                send_intr();
                    432:                /* wake up the engine */
                    433:                put_line("");
                    434:                return;
                    435:        default :
                    436:                if ( nChar >= 0x20 && nChar < 0x7f )
                    437:                        PutChar(nChar);
                    438:                else
                    439:                        Beep();
                    440:                return;
                    441:        }
                    442:        CEditView::OnChar(nChar, nRepCnt, nFlags);
                    443: }
                    444:
                    445: void CAsir32guiView::OnLButtonUp(UINT nFlags, CPoint point)
                    446: {
                    447:        // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください
                    448:     GetEditCtrl().Copy(); UpdateCursor(EndPos);
                    449:        CEditView::OnLButtonUp(nFlags, point);
                    450: }
                    451:
                    452: void CAsir32guiView::OnRButtonDown(UINT nFlags, CPoint point)
                    453: {
                    454:        // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください
                    455:     Paste();
                    456:
                    457: //     CEditView::OnRButtonDown(nFlags, point);
                    458: }
                    459:
                    460: void CAsir32guiView::OnFileOpen()
                    461: {
                    462:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    463:        char cmd[BUFSIZ*2]; // XXX
                    464:        char *p;
1.3       noro      465:        static char errmsg[BUFSIZ];
                    466:        static char prevdir[BUFSIZ];
1.1       noro      467:
1.3       noro      468:        if ( !prevdir[0] ) {
                    469:                get_rootdir(prevdir,sizeof(prevdir),errmsg);
                    470:                strcat(prevdir,"\\lib");
                    471:        }
                    472:
                    473:        _chdir(prevdir);
1.1       noro      474:        CFileDialog     fileDialog(TRUE);
                    475:        if ( fileDialog.DoModal() == IDOK ) {
                    476:                CString pathName = fileDialog.GetPathName();
                    477:                sprintf(cmd,"load(\"%s\");",pathName);
                    478:                for ( p = cmd; *p; p++ )
                    479:                        if ( *p == '\\' )
                    480:                                *p = '/';
                    481:                put_line(cmd);
1.3       noro      482:                p = strrchr(pathName,'\\');
                    483:                if ( p ) {
                    484:                        *p = 0;
                    485:                        strcpy(prevdir,pathName);
                    486:                }
1.1       noro      487:        }
                    488: }
                    489:
                    490: void CAsir32guiView::OnAsirhelp()
                    491: {
                    492:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    493:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    494:
                    495:        get_rootdir(root,sizeof(root),errmsg);
1.11      noro      496:        sprintf(helpfile,"%s\\help\\asirhelp.chm",root);
1.12    ! noro      497:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.1       noro      498: }
                    499:
                    500: void CAsir32guiView::OnFileLog()
                    501: {
                    502:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    503:        if ( !Logging ) {
                    504:                CFileDialog     fileDialog(TRUE);
                    505:                if ( fileDialog.DoModal() == IDOK ) {
                    506:                        CString logfile = fileDialog.GetPathName();
                    507:                        Logfp = fopen(logfile,"ab");
                    508:                        if ( Logfp ) {
                    509:                                LogStart = GetWindowTextLength();
                    510:                                Logging = 1;
                    511:                        }
                    512:                }
                    513:        } else {
                    514:                const char *buf;
                    515:                buf = LockBuffer();
                    516:                fwrite(buf+LogStart,1,strlen(buf)-LogStart,Logfp);
                    517:                UnlockBuffer();
                    518:                fclose(Logfp);
                    519:                Logging = 0;
                    520:        }
                    521: }
                    522:
                    523: void CAsir32guiView::OnUpdateFileLog(CCmdUI* pCmdUI)
                    524: {
                    525:        // TODO: この位置に command update UI ハンドラ用のコードを追加してください
                    526:        if ( Logging )
                    527:                pCmdUI->SetCheck(1);
                    528:        else
                    529:                pCmdUI->SetCheck(0);
                    530: }
                    531:
                    532: void CAsir32guiView::OnEditPaste()
                    533: {
                    534:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    535:     Paste();
1.3       noro      536: }
                    537:
1.9       noro      538: void CAsir32guiView::UpdateMetrics()
                    539: {
                    540:    TEXTMETRIC tm;
                    541:    RECT r;
                    542:
                    543:    GetEditCtrl().GetRect(&r);
                    544:    CDC *pDC = GetDC();
                    545:    pDC->SelectObject(GetFont());
                    546:    pDC->GetTextMetrics(&tm);
                    547:    MaxLineLength = (r.right-r.left)/tm.tmAveCharWidth-1;
                    548: }
                    549:
1.3       noro      550: void CAsir32guiView::OnFont()
                    551: {
                    552:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    553:        int ret;
1.9       noro      554:        LOGFONT lf;
                    555:
                    556:        GetFont()->GetLogFont(&lf);
                    557:        CFontDialog fd(&lf,CF_EFFECTS | CF_SCREENFONTS | CF_FIXEDPITCHONLY);
1.3       noro      558:        static CFont *f = 0;
                    559:
                    560:        ret = fd.DoModal();
                    561:        if ( ret == IDOK ) {
                    562:                fd.GetCurrentFont(&lf);
                    563:                if ( f )
                    564:                        delete f;
                    565:                f = new CFont;
                    566:                f->CreateFontIndirect(&lf);
                    567:                SetFont(f);
1.9       noro      568:                UpdateMetrics();
1.3       noro      569:        }
                    570: }
                    571:
                    572: int CAsir32guiView::OnCreate(LPCREATESTRUCT lpCreateStruct)
                    573: {
                    574:        if (CEditView::OnCreate(lpCreateStruct) == -1)
                    575:                return -1;
                    576:
                    577:        // TODO: この位置に固有の作成用コードを追加してください
1.9       noro      578:
1.3       noro      579:        LOGFONT logFont; memset(&logFont, 0, sizeof(LOGFONT));
                    580:        logFont.lfHeight = 20;
                    581:        logFont.lfCharSet = DEFAULT_CHARSET;
                    582:        strcpy(logFont.lfFaceName, "Terminal");
                    583:        CFont *f = new CFont;
                    584:        f->CreateFontIndirect(&logFont);
                    585:        SetFont(f);
1.9       noro      586:        UpdateMetrics();
1.3       noro      587:        GetEditCtrl().LimitText(nMaxSize);
1.9       noro      588:        GetEditCtrl().SetTabStops(m_nTabStops);
1.3       noro      589:
                    590:        return 0;
1.6       noro      591: }
                    592:
                    593: void CAsir32guiView::OnContribhelp()
                    594: {
                    595:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    596:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    597:
                    598:        get_rootdir(root,sizeof(root),errmsg);
1.11      noro      599:        sprintf(helpfile,"%s\\help\\cmanhelp.chm",root);
1.12    ! noro      600:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.6       noro      601: }
                    602:
1.11      noro      603: void CAsir32guiView::OnSize(UINT nType, int cx, int cy)
                    604: {
                    605:        CEditView::OnSize(nType, cx, cy);
                    606:
                    607:        // TODO: この位置にメッセージ ハンドラ用のコードを追加してください
                    608:        UpdateMetrics();
                    609: }
                    610:
                    611: void CAsir32guiView::OnDsolv()
                    612: {
                    613:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    614:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    615:
                    616:        get_rootdir(root,sizeof(root),errmsg);
                    617:        sprintf(helpfile,"%s\\help\\dsolvhelp.chm",root);
1.12    ! noro      618:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      619: }
                    620:
                    621: void CAsir32guiView::OnGnuplot()
                    622: {
                    623:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    624:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    625:
                    626:        get_rootdir(root,sizeof(root),errmsg);
                    627:        sprintf(helpfile,"%s\\help\\gnuplothelp.chm",root);
1.12    ! noro      628:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      629:
                    630: }
                    631:
                    632: void CAsir32guiView::OnOkdiff()
                    633: {
                    634:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    635:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    636:
                    637:        get_rootdir(root,sizeof(root),errmsg);
                    638:        sprintf(helpfile,"%s\\help\\ok_diffhelp.chm",root);
1.12    ! noro      639:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      640:
                    641: }
                    642:
                    643: void CAsir32guiView::OnOkdmodule()
                    644: {
                    645:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    646:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    647:
                    648:        get_rootdir(root,sizeof(root),errmsg);
                    649:        sprintf(helpfile,"%s\\help\\ok_dmodulehelp.chm",root);
1.12    ! noro      650:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      651:
                    652: }
                    653:
                    654: void CAsir32guiView::OnOm()
                    655: {
                    656:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    657:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    658:
                    659:        get_rootdir(root,sizeof(root),errmsg);
                    660:        sprintf(helpfile,"%s\\help\\omhelp.chm",root);
1.12    ! noro      661:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      662:
                    663: }
                    664:
                    665: void CAsir32guiView::OnPfpcoh()
                    666: {
                    667:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    668:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    669:
                    670:        get_rootdir(root,sizeof(root),errmsg);
                    671:        sprintf(helpfile,"%s\\help\\pfpcohhelp.chm",root);
1.12    ! noro      672:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      673:
                    674: }
                    675:
                    676: void CAsir32guiView::OnPlucker()
                    677: {
                    678:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    679:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    680:
                    681:        get_rootdir(root,sizeof(root),errmsg);
                    682:        sprintf(helpfile,"%s\\help\\pluckerhelp.chm",root);
1.12    ! noro      683:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      684:
                    685: }
                    686:
                    687: void CAsir32guiView::OnSm1()
                    688: {
                    689:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    690:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    691:
                    692:        get_rootdir(root,sizeof(root),errmsg);
                    693:        sprintf(helpfile,"%s\\help\\sm1help.chm",root);
1.12    ! noro      694:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      695:
                    696: }
                    697:
                    698: void CAsir32guiView::OnTigers()
1.6       noro      699: {
1.11      noro      700:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
1.6       noro      701:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    702:
1.11      noro      703:        get_rootdir(root,sizeof(root),errmsg);
                    704:        sprintf(helpfile,"%s\\help\\tigershelp.chm",root);
1.12    ! noro      705:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.11      noro      706:
1.9       noro      707: }
                    708:
1.11      noro      709: void CAsir32guiView::OnTodoparametrize()
1.9       noro      710: {
1.11      noro      711:        // TODO: この位置にコマンド ハンドラ用のコードを追加してください
                    712:        char root[BUFSIZ],errmsg[BUFSIZ],helpfile[BUFSIZ];
                    713:
                    714:        get_rootdir(root,sizeof(root),errmsg);
                    715:        sprintf(helpfile,"%s\\help\\todo_parametrizehelp.chm",root);
1.12    ! noro      716:        ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0);
1.9       noro      717:
1.1       noro      718: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>