| 603 | } |
| 604 | |
| 605 | void CMainFrame::OnScriptRun() |
| 606 | { |
| 607 | // save current script if modified |
| 608 | if (!AfxGetApp()->SaveAllModified()) |
| 609 | return; |
| 610 | // run the script |
| 611 | CQpadDoc* pDoc = (CQpadDoc*)GetActiveDocument(); |
| 612 | LPCTSTR name = pDoc->GetPathName(); |
| 613 | ASSERT(name != NULL); |
| 614 | if (!GetEvalView()->Run(name, *name?name:pDoc->GetTitle())) { |
| 615 | CString msg; |
| 616 | msg.LoadString(IDS_RUN_FAILED); |
| 617 | AfxMessageBox(msg); |
| 618 | return; |
| 619 | } |
| 620 | // update status info |
| 621 | if (!*name || name != m_strRunPathName) SetStatusInfo(); |
| 622 | UpdateTitle(); |
| 623 | // change to eval pane |
| 624 | ActivateEvalView(); |
| 625 | ResetEvalView(); |
| 626 | } |
| 627 | |
| 628 | void CMainFrame::OnScriptDebug() |
| 629 | { |