//******************************************* // Test Message Edit Control Interface // Main window will contain all the message edit controls // this should be packaged separate from the main window eventually // Purpose is to demonstrate simple controls // there are NO menus yet - everything is done through buttons and // some CEdit objects. // These objects are remarkable in themselves and show the power of reuse. // AUTHOR: Chris Wild // DATE: September 15, 1997 // #ifndef MAIN_H #define MAIN_H #include #include "Message.h" const int IDC_TOPIC=100; // Topic edit object const int IDC_TEXT=101; // Text edit object const int IDC_MSGID=102; // MsgID edit Object const int IDC_SAVE=103; // Save button const int IDC_CLEAR=104; // Clear button const int IDC_LOAD=105; // Load button const int SIZE_FILENAME=20; // Define Rectangular Hot Spots Under the normal buttons CRect saveHotSpot(CPoint(0,650),CSize(100,50)); CRect loadHotSpot(CPoint(200,650),CSize(100,50)); CRect clearHotSpot(CPoint(400,650),CSize(100,50)); // Define an application object class CMsgApp : public CWinApp { public: virtual BOOL InitInstance(); // everybody overrides this one CMessage msg; // keep the message object with the application }; // Define the window object class CMainWindow : public CFrameWnd { public: CMainWindow(); ~CMainWindow(); // Creates all the Message Edit Controls void MakeDlg(); afx_msg void HandleSave(); // handles saving of message afx_msg void HandleClear(); // handles clearing of message afx_msg void HandleLoad(); // handles loading of message afx_msg void OnLButtonUp(UINT, CPoint); // handle hot spot clicks afx_msg void OnPaint(); // paints hot spots DECLARE_MESSAGE_MAP() // set up message map handling private: // Here are all the edit objects CEdit m_topic; // for editing the topic CEdit m_text; // and the text of a message CEdit m_msgID; // temporary way to get message file names in (in absence of MsgFolder) CStatic m_msgIDTitle; // Put titles on each edit area CStatic m_topicTitle; CStatic m_textTitle; CButton m_save; // control buttons (instead of using menu for this purpose CButton m_load; CButton m_clear; }; #endif