=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp,v retrieving revision 1.26 retrieving revision 1.31 diff -u -p -r1.26 -r1.31 --- OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2013/08/03 18:29:11 1.26 +++ OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2014/05/10 08:23:33 1.31 @@ -34,6 +34,7 @@ void put_line(char *); void send_intr(void); void insert_to_theView(char *); BOOL get_rootdir(char *,int,char *); +const char *get_helpdir(); extern int bigfloat, prtime, prresult; extern char *asir_libdir; extern int asirgui_kind; @@ -377,6 +378,7 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください char *exp_result; char tmp[BUFSIZ]; + int i; if ( asirgui_kind == ASIRGUI_MESSAGE ) { Beep(); return; @@ -440,6 +442,10 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, tmp[0] = 0; put_line(tmp); return; + case CTRL('Y'): + Paste(); return; + case CTRL('I'): + return; default : if ( nChar >= 0x20 && nChar < 0x7f ) PutChar(nChar); @@ -496,14 +502,14 @@ void CAsir32guiView::OnFileOpen() } } } + void CAsir32guiView::viewHtmlHelp(char *help) { char *helpfile; - char fmt[] = "%s\\help\\%shelp.chm"; - char root[BUFSIZ],errmsg[BUFSIZ]; - get_rootdir(root,sizeof(root),errmsg); - helpfile = (char *)malloc(sizeof(fmt) + strlen(root) + strlen(help)); - sprintf(helpfile,fmt,root,help); + char fmt[] = "%s\\%shelp.chm"; + const char *dir = get_helpdir(); + helpfile = (char *)malloc(sizeof(fmt) + strlen(dir) + strlen(help)); + sprintf(helpfile,fmt,dir,help); #if _MSC_VER < 1300 /* Visual C++ 6.0 */ ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0); @@ -728,25 +734,16 @@ BOOL CAsir32guiView::Create(LPCTSTR lpszClassName, LPC BOOL ret = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); FILE *fp = NULL; char *temp; - char rootdir[BUFSIZ], errmsg[BUFSIZ], hndname[_MAX_PATH]; + char hndname[_MAX_PATH]; - if (get_rootdir(rootdir, BUFSIZ, errmsg)) { - sprintf(hndname, "%s\\bin\\asirgui.hnd", rootdir); - fp = fopen(hndname,"w"); - } - if ( fp ) { - fprintf(fp,"%d",(unsigned int)theView->m_hWnd); - fclose(fp); + if ( asirgui_kind == ASIRGUI_MAIN ) { if ( temp = getenv("TEMP") ) { - size_t len; - char *name; - - len = strlen(temp); - name = (char *)malloc(len+BUFSIZ); - sprintf(name,"%s\\asirgui.hnd",temp); - fopen(name,"w"); - fprintf(fp,"%d",(unsigned int)theView->m_hWnd); - fclose(fp); + sprintf(hndname,"%s\\asirgui.hnd", temp); + fp = fopen(hndname,"w"); + if ( fp ) { + fprintf(fp,"%d",(unsigned int)theView->m_hWnd); + fclose(fp); + } } } return ret;