diff options
author | Stef Walter <stef@thewalter.net> | 2003-09-20 07:12:49 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2003-09-20 07:12:49 +0000 |
commit | b49d8ebefe9b10c53a6a09ad564e22111b7b25c6 (patch) | |
tree | 1d5dd4abc38170a7bc106dabbc59b915017222f0 /win32/makedrop/dropsheet.h | |
parent | 1cda9ebbd62916c7c2136722597a86c583e1ecf6 (diff) |
Initial Import
Diffstat (limited to 'win32/makedrop/dropsheet.h')
-rw-r--r-- | win32/makedrop/dropsheet.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/win32/makedrop/dropsheet.h b/win32/makedrop/dropsheet.h new file mode 100644 index 0000000..48ec758 --- /dev/null +++ b/win32/makedrop/dropsheet.h @@ -0,0 +1,72 @@ +/* + * 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: <nielsen@memberwebs.com> + */ + +#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_) |