Exemple #1
0
BOOL QuerySaveChart (HWND hWndParent, PGRAPHSTRUCT pGraph)
/*
   Effect:        If the graph pGraph is modified, put up a message
                  box allowing the user to save the current graph.
                  
                  Return whether the caller should proceed to load in
                  a new or otherwise trash the current graph.
*/
   {  // QuerySaveChart
#ifdef KEEP_QUERY
   int            iReturn ;

   if (!pGraph->bModified)
      return (TRUE) ;

   iReturn = MessageBoxResource (hWndParent, 
                                 IDS_SAVECHART, IDS_MODIFIEDCHART,
                                 MB_YESNOCANCEL | MB_ICONASTERISK) ;

   if (iReturn == IDCANCEL)
      return (FALSE) ;

   if (iReturn == IDYES)
      SaveChart (hWndGraphs, 0, 0) ;
   return (TRUE) ;
#endif
   return (TRUE) ;  // we don't want to query nor save change

   }  // QuerySaveChart
bool CChartDlg::OnResponseDialog(gint response_id)
{
	switch (response_id)
	{
	case GTK_RESPONSE_NONE:
		SaveChart();
		return false;

	case GTK_RESPONSE_HELP:
		g_MainWnd->ShowHelp(GTK_WINDOW(m_pDlg), IDH_CHART);
		return false;
	}
	return true;
}