=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/engine2000/ox_plot.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.7 diff -u -p -r1.1.1.1 -r1.7 --- OpenXM_contrib2/windows/engine2000/ox_plot.cpp 2000/11/22 06:20:13 1.1.1.1 +++ OpenXM_contrib2/windows/engine2000/ox_plot.cpp 2015/08/20 17:47:53 1.7 @@ -12,10 +12,16 @@ static char THIS_FILE[] = __FILE__; #endif -extern "C" { -#include "ca.h" -#include "ifplot.h" +#if defined(MAX) +#undef MAX +#endif +#define MAX(a,b) ((a) > (b) ? (a) : (b) ) +extern "C" { +#include "if_canvas.h" +extern struct canvas *canvas[]; + extern HANDLE hCanvasCreated; + extern HANDLE hMainThreadReady; extern HANDLE hStreamNotify; extern HANDLE hStreamNotify_Ack; extern DWORD MainThread; @@ -85,6 +91,7 @@ BOOL COx_plotApp::InitInstance() WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); MainThread = m_nThreadID; + SetEvent(hMainThreadReady); // メイン ウィンドウが初期化されたので、表示と更新を行います。 // pFrame->ShowWindow(SW_SHOW); @@ -165,35 +172,36 @@ BOOL COx_plotApp::PreTranslateMessage(MSG* pMsg) struct canvas *can; can = canvas[pMsg->wParam]; - if ( !can->window ) { + if ( !canvas_window(can) ) { + char *s = canvas_wname(can); + pFrame = new CMainFrame; /* XXX */ - pFrame->m_pWindowName = (char *)malloc(MAX(strlen(can->wname),strlen("ox_plot"))+10); - sprintf(pFrame->m_pWindowName,"%s : %d", - strlen(can->wname)?can->wname:"ox_plot",can->index); + pFrame->m_pWindowName = (char *)malloc(MAX(strlen(s),strlen("ox_plot"))+10); + sprintf(pFrame->m_pWindowName,"%s : %d",strlen(s)?s:"ox_plot",canvas_index(can)); - pFrame->m_cansize.cx = can->width; - pFrame->m_cansize.cy = can->height; + pFrame->m_cansize.cx = canvas_width(can); + pFrame->m_cansize.cy = canvas_height(can); pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); - can->window = (void *)pFrame; + canvas_set_window(can,(void *)pFrame); pFrame->m_wndView.can = can; pFrame->ShowWindow(SW_SHOW); pFrame->UpdateWindow(); pFrame->BringWindowToTop(); - can->hwnd = pFrame->m_wndView.m_hWnd; + canvas_set_handle(can,pFrame->m_wndView.m_hWnd); } else - pFrame = (CMainFrame *)can->window; + pFrame = (CMainFrame *)canvas_window(can); pFrame->RedrawWindow(); - } + SetEvent(hCanvasCreated); + } return CWinApp::PreTranslateMessage(pMsg); } void COx_plotApp::OnAppExit() { // TODO: この位置にコマンド ハンドラ用のコードを追加してください - } BOOL COx_plotApp::OnIdle(LONG lCount)