// could use Window event table for this stuff BOOL Window::WndProc(TMSG &Msg) { // handle internal actions switch (Msg.Msg) { case WM_QUERYENDSESSION: case WM_CLOSE: if (!CanClose()) return TRUE; //returns 0 break; case WM_DESTROY: // quit if main window if (this==App::MainWindow) App::Quit(); if (Flags & W_SAVEPOS) SaveWindowState(); Flags|=W_DESTROYED; Destroy(); // MainWindow is deleted on program exit if (this==App::MainWindow) App::Quit(); else delete this; return TRUE; case WM_PAINT: PAINTSTRUCT ps; BeginPaint(hWnd, (LPPAINTSTRUCT) &ps); SetWindowOrgEx(ps.hdc,xPos,yPos,NULL); Paint(ps.hdc,ps.fErase,ps.rcPaint); if (StatBar) // draw statbar after window { SetWindowOrgEx(ps.hdc,0,0,NULL); // dont scroll statbar StatBar->Paint(ps.hdc); } EndPaint(hWnd, (LPPAINTSTRUCT) &ps); break; case WM_HSCROLL: HScroll(Msg); break; case WM_VSCROLL: VScroll(Msg); break; case WM_SIZE: WMSize(Msg); break; case WM_GETMINMAXINFO: WMGetMinMaxInfo(Msg); break; case WM_COMMAND: { int id=LOWORD(Msg.wParam); if (id>MRU_ID && id<=MRU_ID+MRU_MAX) { OpenFile(MruList[id-MRU_ID-1]); return TRUE; } else if (id>MRU2_ID && id<=MRU2_ID+MRU_MAX) { OpenFile2(MruList2[id-MRU2_ID-1]); return TRUE; } break; } case WM_INITMENU: InitMenu((HMENU) Msg.wParam); // handle of menu to initialize break; } if (StatBar) StatBar->EV_FIND(Msg); //allow user to grab any message return EV_FIND(Msg); }
void TFilePanel::SaveState(bool) { BNode defaultingNode; if (DefaultStateSourceNode(kDefaultFilePanelTemplate, &defaultingNode, true, false)) { AttributeStreamFileNode streamNodeDestination(&defaultingNode); SaveWindowState(&streamNodeDestination); PoseView()->SaveState(&streamNodeDestination); } }
void OpenWithContainerWindow::SaveState(bool) { BNode defaultingNode; if (DefaultStateSourceNode(kDefaultOpenWithTemplate, &defaultingNode, true, false)) { AttributeStreamFileNode streamNodeDestination(&defaultingNode); SaveWindowState(&streamNodeDestination); fPoseView->SaveState(&streamNodeDestination); } }
ManagerFrame::~ManagerFrame() { SaveWindowState(this); wxConfigBase *cfg = wxConfig::Get(); int sel = m_listPrj->GetSelection(); if (sel != -1) { cfg->Write(_T("manager_last_selected"), (long)m_listPrj->GetClientData(sel)); } ms_instance = NULL; }
FindFrame::~FindFrame() { SaveWindowState(this, WinState_Pos); wxConfig::Get()->Write("find_in_orig", XRCCTRL(*this, "in_orig", wxCheckBox)->GetValue()); wxConfig::Get()->Write("find_in_trans", XRCCTRL(*this, "in_trans", wxCheckBox)->GetValue()); wxConfig::Get()->Write("find_in_comments", XRCCTRL(*this, "in_comments", wxCheckBox)->GetValue()); wxConfig::Get()->Write("find_in_auto_comments", XRCCTRL(*this, "in_auto_comments", wxCheckBox)->GetValue()); wxConfig::Get()->Write("find_case_sensitive", XRCCTRL(*this, "case_sensitive", wxCheckBox)->GetValue()); wxConfig::Get()->Write("find_from_first", XRCCTRL(*this, "from_first", wxCheckBox)->GetValue()); wxConfig::Get()->Write("whole_words", XRCCTRL(*this, "whole_words", wxCheckBox)->GetValue()); }
MergeSummaryDialog::~MergeSummaryDialog() { SaveWindowState(this, WinState_Size); }
void QCustomDialog::reject() { SaveWindowState(); // Save Window size and position DoGlobalUndo(); // Undo change DoRejet(); // call overloaded function done(1); // Close dialog }
void QCustomDialog::accept() { SaveWindowState(); // Save Window size and position if (DoAccept()) // call overloaded function done(0); // Close dialog }
FileViewer::~FileViewer() { SaveWindowState(this); }
/* ============ WMAIN_WndProc ============ */ LONG WINAPI WMAIN_WndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LONG lRet = 1; RECT rect; HDC maindc; GetClientRect(hWnd, &rect); switch (uMsg) { case WM_TIMER: QE_CountBrushesAndUpdateStatusBar(); QE_CheckAutoSave(); return 0; case WM_DESTROY: SaveMruInReg(g_qeglobals.d_lpMruMenu,"Software\\id\\QuakeEd4\\MRU"); DeleteMruMenu(g_qeglobals.d_lpMruMenu); PostQuitMessage(0); KillTimer( hWnd, QE_TIMER0 ); return 0; case WM_CREATE: maindc = GetDC(hWnd); // QEW_SetupPixelFormat(maindc, false); g_qeglobals.d_lpMruMenu = CreateMruMenuDefault(); LoadMruInReg(g_qeglobals.d_lpMruMenu,"Software\\id\\QuakeEd4\\MRU"); // Refresh the File menu. PlaceMenuMRUItem(g_qeglobals.d_lpMruMenu,GetSubMenu(GetMenu(hWnd),0), ID_FILE_EXIT); return 0; case WM_SIZE: // resize the status window MoveWindow( g_qeglobals.d_hwndStatus, -100, 100, 10, 10, true); return 0; case WM_KEYDOWN: return QE_KeyDown (wParam); case WM_CLOSE: /* call destroy window to cleanup and go away */ SaveWindowState(g_qeglobals.d_hwndXY, "xywindow"); SaveWindowState(g_qeglobals.d_hwndCamera, "camerawindow"); SaveWindowState(g_qeglobals.d_hwndZ, "zwindow"); SaveWindowState(g_qeglobals.d_hwndEntity, "EntityWindow"); SaveWindowState(g_qeglobals.d_hwndMain, "mainwindow"); // FIXME: is this right? SaveRegistryInfo("SavedInfo", &g_qeglobals.d_savedinfo, sizeof(g_qeglobals.d_savedinfo)); DestroyWindow (hWnd); return 0; case WM_COMMAND: return CommandHandler (hWnd, wParam, lParam); return 0; } return DefWindowProc (hWnd, uMsg, wParam, lParam); }