void ExploreFrame::OnWindowClose( wxCloseEvent& event )
{
	if (m_archive && m_archive->IsModified())
	{
		wxMessageDialog msgDlg(this, _("Do you wan't to save unsaved changes?"), _("Warning"), wxICON_WARNING | wxYES_NO | wxCANCEL);
		msgDlg.SetYesNoLabels(_("Save"), _("Don't Save"));

		switch (msgDlg.ShowModal())
		{
			case wxID_YES:
			{
				wxCommandEvent evt(wxID_SAVE);
				OnSaveClicked(evt);
				event.Skip();
				break;
			}
			case wxID_NO:
				event.Skip();
				break;
			default:
				event.Veto();
				break;
		}
	} else
		event.Skip();
}
Exemple #2
0
//
//	window message dispatcher
//
BOOL CALLBACK ImageProc(
	HWND	hDlg,
	UINT	msg,
	WPARAM	wParam,
	LPARAM	lParam)
{
	switch (msg) {
	case WM_INITDIALOG:
		OnInitDialog(hDlg, lParam);
		break;

	case WM_COMMAND:
		switch (wParam) {
		case IDC_CHANGE:
			OnChangeClicked(hDlg);
			break;

		case IDC_OPEN:
			OnOpenClicked(hDlg, (HWND)lParam);
			break;

		case IDC_SAVE:
			OnSaveClicked(hDlg);
			break;

		case IDC_CLOSE:
			OnCloseClicked(hDlg, (HWND)lParam);
			break;
		}
		break;

	case WM_SHOWWINDOW:
		if (!wParam) {
			//	the window is being hidden
			break;
		}
		//	the window is being shown - refresh

	case VFD_REFRESH_MSG:
		OnRefreshDialog(hDlg);
		break;
	}

	return 0;
}