static void text_OnClose( HWND hwnd) { int result; result = text_QueryClose(hwnd); if (result == IDCANCEL) { return; } if (result == IDYES) { text_Save(hwnd); } FORWARD_WM_CLOSE(hwnd,DefMDIChildProc); }
//************************************************************************ void CGBScene::OnCommand(HWND hWnd, int id, HWND hControl, UINT codeNotify) //************************************************************************ { if (m_idTimer) { KillTimer(hWnd, m_idTimer); m_idTimer = 0; } switch (id) { case IDC_TOON: { PTOON pToon = GetToon(); if (codeNotify == CToon::ClickedOnHotSpot) StopEverything(hWnd); else if (codeNotify == CToon::AutoDone) // Auto-Play Toon Done { if (GetApp()->m_fReading) { if (!pToon || !pToon->PlayConclusion()) { SetTimer( hWnd, NEXT_PAGE, NEXT_PAGE_DELAY, NULL ); } } } if (codeNotify == CToon::ConclusionDone) // Conclusion Toon done GetApp()->GotoNextScene(m_hWnd); break; } case IDC_BACK: { ITEMID id; if (GetApp()->m_bNewBookmark) id = GetApp()->GetSceneID(IDC_BOOKMARK); else id = GetApp()->GetFirstSceneNo(); GetApp()->GotoScene(hWnd, id); break; } case IDC_READ: GetApp()->m_fReading = (id == IDC_READ); case IDC_NEXT: { GetApp()->m_fPlaying = TRUE; StopEverything(hWnd, TRUE); PTOON pToon = GetToon(); if (!pToon || !pToon->PlayConclusion()) GetApp()->GotoNextScene(m_hWnd); break; } case IDC_SKIPNEXT: { GetApp()->m_fPlaying = TRUE; StopEverything(hWnd, TRUE); PTOON pToon = GetToon(); if (!pToon || !pToon->PlayConclusion()) GetApp()->GotoNextSkipScene(m_hWnd); break; } case IDC_PREVIOUS: { StopEverything(hWnd, TRUE); GetApp()->GotoPrevScene(m_hWnd); break; } case IDC_GOTOSCENE: { StopEverything(hWnd, TRUE); GetApp()->GotoScene(hWnd, codeNotify); break; } case IDC_QUIT: { StopEverything(hWnd, TRUE); FORWARD_WM_CLOSE(GetApp()->GetMainWnd(), SendMessage); break; } case IDC_ACTIVITIES: case IDC_OPTIONS: case IDC_OPTIONS2: case IDC_SOUNDBOX: { StopEverything(hWnd, TRUE); GetApp()->GotoSceneID(hWnd, id, m_nSceneNo); break; } case IDC_MAINMENU: case IDC_EXITSTORY: { StopEverything(hWnd, TRUE); GetApp()->GotoSceneID(hWnd, id); break; } case IDC_ACTIVITY1: case IDC_ACTIVITY2: case IDC_ACTIVITY3: case IDC_ACTIVITY4: case IDC_ACTIVITY5: case IDC_ACTIVITY6: case IDC_ACTIVITY7: case IDC_ACTIVITY8: case IDC_ACTIVITY9: case IDC_ACTIVITY10: case IDC_MUSIC: case IDC_SINGALONG: case IDC_SOUNDS: case IDC_THEATRE1: case IDC_THEATRE2: case IDC_THEATRE3: { GetApp()->m_fPlaying = FALSE; StopEverything(hWnd, TRUE); GetApp()->GotoSceneID(hWnd, id, m_nNextSceneNo); break; } default: { CScene::OnCommand(hWnd, id, hControl, codeNotify); break; } } }