bool CDlgMessages::SaveState() { wxLogTrace(wxT("Function Start/End"), wxT("CDlgMessages::SaveState - Function Begin")); wxString strBaseConfigLocation = wxString(wxT("/Simple/Messages")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); wxASSERT(pConfig); // An odd case happens every once and awhile where wxWidgets looses // the pointer to the config object, or it is cleaned up before // the window has finished it's cleanup duty. If we detect a NULL // pointer, return false. if (!pConfig) return false; // // Save Frame State // pConfig->SetPath(strBaseConfigLocation); // Reterieve and store the latest window dimensions. SaveWindowDimensions(); // Save the list ctrl state m_pBackgroundPanel->OnSaveState(pConfig); wxLogTrace(wxT("Function Start/End"), wxT("CDlgMessages::SaveState - Function End")); return true; }
void CDlgMessages::OnShow(wxShowEvent& event) { wxLogTrace(wxT("Function Start/End"), wxT("CDlgMessages::OnShow - Function Begin")); static bool bAlreadyRunning = false; if ((event.GetEventObject() == this) && !bAlreadyRunning) { bAlreadyRunning = true; wxLogTrace(wxT("Function Status"), wxT("CDlgMessages::OnShow - Show/Hide Event for CAdvancedFrame detected")); if (event.GetShow()) { RestoreWindowDimensions(); } else { SaveWindowDimensions(); } bAlreadyRunning = false; } else { event.Skip(); } wxLogTrace(wxT("Function Start/End"), wxT("CDlgMessages::OnShow - Function End")); }
void CDlgMessages::OnMove(wxMoveEvent& event) { if (IsShown()) { SaveWindowDimensions(); } event.Skip(); }