// Start =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// General information section.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// $Author:yongkiang$ User who last changed the file
// $Date:1/2/2013 12:16:07 PM$ Date and time of last check in
// $Revision:1.0$ Visual SourceSafe version number
// $Workfile::   AlarmPage.h                                           $ Filename
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// {{AFX_INCLUDES()
#include "MyPropertyPage.h"
// }}AFX_INCLUDES
#if !defined(AFX_ALARMPAGE_H__C37204D7_7F49_11D6_A802_005004C029CA__INCLUDED_)
#define AFX_ALARMPAGE_H__C37204D7_7F49_11D6_A802_005004C029CA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifdef  BUILD_GUIDLL
#define     DLLCLASS    __declspec(dllexport)
#else
#define     DLLCLASS    __declspec(dllimport)
#endif

#include "AVICtrl.h"
#include "ShadeButtonST.h"
#include "ShadeCheckButtonST.h"
#include "PictureEx.h"
// AlarmPage.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CAlarmPage dialog

class DLLCLASS CAlarmPage : public CMyPropertyPage // public CPropertyPage
{
DECLARE_DYNCREATE(CAlarmPage)

// Construction
public:
    CAlarmPage();
    ~CAlarmPage();

// Dialog Data
// {{AFX_DATA(CAlarmPage)
    enum {
        IDD = IDD_ALARM_PAGE
    };
    CComboBox           m_comboboxEditLanguage;
    CComboBox           m_comboboxDisplayLanguage;
    CShadeCheckButtonST m_cbRemedyBtn;
    CShadeCheckButtonST m_cbOfflineBtn;
    CShadeButtonST      m_cbSaveBtn;
// CStatic   m_stDiagram;
    CPictureEx m_stDiagram;
// CStatic   m_stFaultIndicator;
    CPictureEx m_stFaultIndicator;
    CListCtrl  m_alarmMsgList;
// }}AFX_DATA

// Overrides
// ClassWizard generate virtual function overrides
// {{AFX_VIRTUAL(CAlarmPage)
public:
    virtual BOOL OnSetActive();
    virtual BOOL OnKillActive();
protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
    virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
// }}AFX_VIRTUAL

// Implementation
protected:
// Generated message map functions
// {{AFX_MSG(CAlarmPage)
    virtual BOOL OnInitDialog();
    afx_msg void OnTimer(UINT nIDEvent);
    afx_msg void OnAlarmRemedyButton();
    afx_msg void OnSaveButton();
    afx_msg void OnChangeAlarmRemedyMessage();
    afx_msg void OnChangeAlarmMsg();
    afx_msg void OnDestroy();
    afx_msg void OnAlarmOfflineButton();
    afx_msg void OnAlarmCategoryButton();
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnPaint();
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    afx_msg void OnSelchangeComboDisplayLanguageInEditMode();
    afx_msg void OnSelchangeComboEditLanguageInEditMode();
// }}AFX_MSG
    DECLARE_MESSAGE_MAP()

private:
    bool CheckLanguageDataValidity();
    void SetToDefaultLanguage();
    void GetAllLanguageAvailable();
    void ChangeEditLanguage();
    void ChangeDisplayLanguage();
    void UpdateListCtrl();
    void UpdateButtonsStatus();
    void DisplayFaultDiagram(void);
    void ClearFaultDiagram(void);
    void SetCategory(int nCategory);
    void ClearList(void);
    void CheckSecurityLevel();
    void DisplayIn2ndLang();
    void OfflineMsgEdit();
    void UpdateRemedy();
    void RefreshAlarmMsg();
    void InitListCtrlBox();
    void InitIconButtons();
    void InitMsgTxtFileName();
    void LoadBitmaps();

    CImageList m_imageListSmall;
    CString    m_filename;
    bool       m_bModified;
    CBitmap    m_bitmapCat1;
    CBitmap    m_bitmapCat2;
    CBitmap    m_bitmapCat3;

    CPtrList m_plJamMsg;
    CPtrList m_plWarningMsg;
    CPtrList m_plOffLineMsg;
    CPtrList m_plOffLine2ndLanguageMsg;

    CRect m_rectStaticClient;
    BOOL  m_bErase;
    int   m_nOffsetx, m_nOffsety;
    int   m_nFaultOffsetx, m_nFaultOffsety;
    BOOL  m_bZoomBefore;
    BOOL  m_bDiagramLoaded;

// for the jam image display
// for main diagram
    CDC m_dcMem;               // Compatible Memory DC for dialog

    BITMAP  m_bmInfo;          // Bitmap Information structure
    CPoint  m_pt;              // Position for upper left corner of bitmap
    CSize   m_size;
    CString m_csMainFilename;  // Bitmap diagram filename and location
    CString m_csFaultFilename; // Bitmap diagram filename and location in Zoom mode

// for fault indicator
    CDC m_dcMemFault;          // Compatible Memory DC for dialog

    BITMAP m_bmInfoFault;      // Bitmap Information structure
    CPoint m_ptFault;          // Position for upper left corner of bitmap
    CPoint m_ptFaultOffset;
    CSize  m_sizeFault;

    CAVICtrl m_Indicator;

    int m_nCurrentSelectedItem;

    int m_nLanguage;
    int m_nNoOfLanguageAvailable;

    CString m_cs2ndLanguageJamMsg;
    CString m_cs2ndLanguageModuleName;
    CString m_cs2ndLanguageRemedy1;
    CString m_cs2ndLanguageRemedy2;
    CString m_cs2ndLanguageRemedy3;
};

// {{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ALARMPAGE_H__C37204D7_7F49_11D6_A802_005004C029CA__INCLUDED_)
