From b49d8ebefe9b10c53a6a09ad564e22111b7b25c6 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 20 Sep 2003 07:12:49 +0000 Subject: Initial Import --- win32/makedrop/dropsheet.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 win32/makedrop/dropsheet.h (limited to 'win32/makedrop/dropsheet.h') 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: + */ + +#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_) -- cgit v1.2.3