/*========================================================================= * * DLGWarning.cpp - implementation file for warning dialog box class * * Version 1.0 * Revision date * *=======================================================================*/ #include "stdafx.h" #include "DlgWarning.h" #include "print.h" /* ======================================================================================= CDlgWarning dialog ======================================================================================= */ /**************************************************************************** * Description: constructor * * Parameters: pParent : parent window *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ CDlgWarning::CDlgWarning(CWnd* pParent /*=NULL*/) : CDialog(CDlgWarning::IDD, pParent) { //{{AFX_DATA_INIT(CDlgWarning) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } /**************************************************************************** * Description: message map * * Parameters: *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ BEGIN_MESSAGE_MAP(CDlgWarning, CDialog) //{{AFX_MSG_MAP(CDlgWarning) ON_BN_CLICKED(IDC_WARNING_CHECKAPPLYALL, OnApplyAll) //}}AFX_MSG_MAP END_MESSAGE_MAP() /* ======================================================================================= CDlgWarning message handlers ======================================================================================= */ /**************************************************************************** * Description: WM_INITDIALOG * * Parameters: *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ BOOL CDlgWarning::OnInitDialog() { CDialog::OnInitDialog(); if (!g_bApplyAll) ((CButton *)GetDlgItem(IDC_WARNING_CHECKAPPLYALL))->SetCheck(0); else ((CButton *)GetDlgItem(IDC_WARNING_CHECKAPPLYALL))->SetCheck(1); m_oStatic=(CStatic *)GetDlgItem(IDC_WARNING_STATICMESSAGE); m_oStatic->SetWindowText(m_sMes); GetDlgItem(IDOK)->SetWindowText(m_sOK); GetDlgItem(IDCANCEL)->SetWindowText(m_sCancel); return TRUE; } /**************************************************************************** * Description: WM_DESTROY * * Parameters: *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ void CDlgWarning::OnDestroy() { CDialog::OnDestroy(); } /**************************************************************************** * Description: Handle function for message BN_CLICKED on ApplyAll button * * Parameters: *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ void CDlgWarning::OnApplyAll() { g_bApplyAll = ((CButton *)GetDlgItem(IDC_WARNING_CHECKAPPLYALL))->GetCheck(); } /**************************************************************************** * Description: Build the text of the warning message * * Parameters: *--------------------------------------------------------------------------- * Revision date: Author: *****************************************************************************/ void CDlgWarning::m_fn_vBuildTextMessage (tdeWarningMode eMode, char *sName) { switch (eMode) { case E_ForceCommon : strcpy(m_sMes, "Some specific files already exist for the family "); strcat(m_sMes, sName); strcat(m_sMes, ".\nAre you sure you want to convert it as a common one? \n"); strcat(m_sMes, "There is a risk of incoherence."); strcpy(m_sOK, "Force Common"); strcpy(m_sCancel, "Cancel Conversion"); break; case E_ForceSpecific : strcpy(m_sMes, "The family "); strcat(m_sMes, sName); strcat(m_sMes, " was a common one. \n\n Do you want it to become a specific one?"); strcpy(m_sOK, "Force Specific"); strcpy(m_sCancel, "Keep Common"); break; } }