summaryrefslogtreecommitdiff
path: root/win32/makedrop/processpage.h
blob: 74ad6de70310f66b25008ab8a1c0e252bb53ce89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * 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 __PROCESSPAGE_H__
#define __PROCESSPAGE_H__

#include "resource.h"       // main symbols
#include <atlhost.h>
#include "common/droplet.h"


// ProcessPage: -------------------------------------------------------
//  Property page for script and buffer size

class ProcessPage :
	public CPropertyPage
{
public:
	ProcessPage(Droplet& droplet);

	BEGIN_MSG_MAP(ProcessPage)
		MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
		MESSAGE_HANDLER(PSM_QUERYSIBLINGS, onQuerySiblings)
		COMMAND_ID_HANDLER(IDC_BROWSE, onBrowse)
		COMMAND_CODE_HANDLER(BN_CLICKED, onChange)
		COMMAND_CODE_HANDLER(EN_CHANGE, onChange)
		NOTIFY_CODE_HANDLER(PSN_APPLY, onApply)
	END_MSG_MAP()

// Message Handlers
protected:
	LRESULT onInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT onQuerySiblings(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT onApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
	LRESULT onChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT onBrowse(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

// Helper Functions
protected:
	// Updates all status etc...
	void updateControls();

	// Load data from droplet to page
	void loadData();

	// Load an already compiled rep script
	HRESULT compileAlready(FILE* f);

	// Load and possibly compile a rep script
	HRESULT compileScript(const string& script);

protected:
	Droplet& m_droplet;		// Pointer to sheet's main droplet
	string m_script;		// The script file name last time it was saved
							// Will not reload if the same
	bool m_inited;			// Have we finished being initialized (used by onChange)
};

#endif //__PROCESSPAGE_H__