/* * AUTHOR * N. Nielsen * * LICENSE * This software is in the public domain. * * The software is provided "as is", without warranty of any kind, * express or implied, including but not limited to the warranties * of merchantability, fitness for a particular purpose, and * noninfringement. In no event shall the author(s) be liable for any * claim, damages, or other liability, whether in an action of * contract, tort, or otherwise, arising from, out of, or in connection * with the software or the use or other dealings in the software. * * SUPPORT * Send bug reports to: */ #ifndef __DROPSHEET_H__ #define __DROPSHEET_H__ #include "resource.h" #include "common/droplet.h" // DropSheet: ------------------------------------------------------ // The main window property sheet class DropSheet : public CPropertySheet { public: DropSheet(); virtual ~DropSheet(); BEGIN_MSG_MAP(DropSheet) MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog) COMMAND_ID_HANDLER(ID_FILE_OPEN, onOpen) COMMAND_ID_HANDLER(ID_FILE_SAVE, onSave) COMMAND_ID_HANDLER(ID_FILE_EXIT, onExit) MESSAGE_HANDLER(PSM_CHANGED, onChanged) MESSAGE_HANDLER(WM_CLOSE, onClose) CHAIN_MSG_MAP(CPropertySheet) END_MSG_MAP() // Get the current internal droplet Droplet& getDroplet() { return m_droplet; } // Message Handlers protected: LRESULT onInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT onClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT onChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT onOpen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT onSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT onExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); // Helper Functions protected: // Save the droplet, prompt user if not force bool saveDroplet(bool force); // Open the a droplet void openDroplet(); protected: Droplet m_droplet; // The internal loaded droplet bool m_dirty; // Have changes been made? string m_fileName; // The filename to save to }; #endif // !defined(AFX_DROPSHEET_H__E3237E90_1FD0_4233_98EE_5991F4FB39F8__INCLUDED_)