home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / vrac / dlgcbr.zip / MDLSMAIN.H < prev    next >
C/C++ Source or Header  |  1994-06-30  |  4KB  |  109 lines

  1. /*****************************************************************************
  2.   MDLSMAIN.H
  3.  
  4.   Purpose:  
  5.       Interface for CModelessMain, a reusable class for creating modeless
  6.       dialogs which act as main application windows.  The dialog contains
  7.       a status bar and a tool bar.  It provides support for ID_VIEW_STATUS_BAR
  8.       and ID_VIEW_TOOLBAR commands, as well as CAPS, NUM, and SCRL key 
  9.       indicators.
  10.  
  11.   Functions: 
  12.       CModelessMain::CModelessMain()            -- constructor
  13.       CModelessMain::~CModelessMain()            -- destructor
  14.       CModelessMain::Create()                    -- Create dialog window   
  15.       CModelessMain::GetStatusBar()            -- access status bar 
  16.       CModelessMain::GetToolBar()                -- access toolbar
  17.       CModelessMain::OnClose()                -- handle WM_CLOSE   
  18.       CModelessMain::OnEnterIdle()            -- handle WM_ENTERIDLE
  19.       CModelessMain::OnEraseBkgnd()            -- handle WM_ERASEBKGND  
  20.       CModelessMain::OnInitDialog()            -- initialize dialog  
  21.       CModelessMain::OnInitMenuPopup()        -- handle WM_INITMENUPOPUP
  22.       CModelessMain::OnMenuSelect()            -- handle WM_MENUSELECT
  23.       CModelessMain::OnPaint()                -- handle WM_PAINT
  24.       CModelessMain::OnQueryDragIcon()        -- handle WM_QUERYDRAGICON
  25.       CModelessMain::OnSetMessageString()     -- handle WM_SETMESSAGESTRING
  26.       CModelessMain::OnStatusBarCheck()       -- ID_VIEW_STATUS_BAR handler
  27.       CModelessMain::OnToolBarCheck()            -- ID_VIEW_TOOLBAR handler     
  28.       CModelessMain::OnUpdateKeyIndicator()    -- update key indicator items
  29.       CModelessMain::OnUpdateStatusBarMenu()    -- update ID_VIEW_STATUS_BAR items
  30.       CModelessMain::OnUpdateToolBarMenu()    -- update ID_VIEW_TOOLBAR items
  31.  
  32.   Development Team:
  33.       Mary Kirtland
  34.  
  35.   Written by Microsoft Product Support Services, Premier ISV Support
  36.   Copyright (c) 1994 Microsoft Corporation. All rights reserved.
  37. \****************************************************************************/
  38.  
  39. #ifndef __MDLSMAIN_H__
  40.     #define __MDLSMAIN_H__ 
  41.     
  42.     #include "modeless.h" 
  43.     #include "dlgbars.h"
  44.     
  45. class CModelessMain : public CModelessDialog
  46. {
  47.     DECLARE_DYNAMIC(CModelessMain)
  48.  
  49. // Construction
  50. public:
  51.     CModelessMain();  
  52.     BOOL Create(LPCSTR lpszTemplateName, 
  53.                 const UINT FAR* lpaIDStatus, int cIDStatus,
  54.                 const UINT FAR* lpaIDToolbar, int cIDToolbar,
  55.                 UINT nIDBitmap);
  56.     BOOL Create(UINT nIDTemplate,
  57.                 const UINT FAR* lpaIDStatus, int cIDStatus,
  58.                 const UINT FAR* lpaIDToolbar, int cIDToolbar,
  59.                 UINT nIDBitmap);  
  60.                 
  61. // Attributes
  62. public:
  63.     CStatusBar* GetStatusBar() { return &m_statusBar; }                
  64.     CToolBar*   GetToolBar()   { return &m_toolBar; }
  65.     
  66. // Implementation  
  67. public:
  68.     virtual ~CModelessMain();
  69.     
  70.     // Overrides
  71.     virtual BOOL OnInitDialog();
  72.             
  73. protected:                      
  74.     HICON            m_hIcon;    
  75.     
  76.     UINT            m_nIDTracking;
  77.     UINT            m_nIDLastMessage;
  78.     
  79.     const UINT FAR*    m_lpaIDStatusBar;
  80.     int                m_cIDStatusBar;
  81.     CDlgStatusBar      m_statusBar;  
  82.     
  83.     const UINT FAR* m_lpaIDToolBar;
  84.     int             m_cIDToolBar;
  85.     UINT            m_nIDBitmap;
  86.     CDlgToolBar        m_toolBar;
  87.  
  88.     // Generated message map functions
  89.     //{{AFX_MSG(CModelessMain)
  90.     afx_msg void OnClose();
  91.     afx_msg void OnPaint();
  92.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  93.     afx_msg HCURSOR OnQueryDragIcon();
  94.     afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho);
  95.     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
  96.     afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); 
  97.     afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam = 0L);
  98.     afx_msg void OnStatusBarCheck();   
  99.     afx_msg void OnToolBarCheck();
  100.     afx_msg void OnUpdateStatusBarMenu(CCmdUI* pCmdUI);   
  101.     afx_msg void OnUpdateToolBarMenu(CCmdUI* pCmdUI);  
  102.     afx_msg void OnUpdateKeyIndicator(CCmdUI* pCmdUI);
  103.     //}}AFX_MSG
  104.     DECLARE_MESSAGE_MAP()
  105. }; 
  106.  
  107. #endif //__MDLSMAIN_H__
  108.  
  109.