/*
** Generated Code 
*/
#ifndef _main_xd_h
#define _main_xd_h

#define XD_WINDOWS_MFC


#define IDC_shell_drawing 113

class drawing_c: public CWnd {
public:
	virtual void create (CWnd * parent, char *widget_name = NULL, unsigned int id = 0, CRect *in_rect = NULL);
protected:
	void SetCell ( unsigned int x, unsigned int y );
	void draw_line ( unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, unsigned int draw_first);
	void horizontal_line ( unsigned int x0, unsigned int y0, unsigned int x1, unsigned int draw_first );
	void draw_rectangle ( unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1 );
	void fill_rectangle ( unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1 );
	void DrawCells ();
	void DrawGrid ();
	void DrawCell ( unsigned int x, unsigned int y );
	void XGridLine ( unsigned int x );
	void YGridLine ( unsigned int y );
	int initialised;
	colour_type cells[32][32];
	unsigned int start_x, start_y;
#ifdef XD_MOTIF_MFC
	Pixel *colours[8];
	GC gc;
#else
	CBrush *colours[8];
	CDC *dc;
#endif
 
protected:
	//{{AFX_MSG(drawing_c)
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
	afx_msg void OnLButtonUp( UINT nFlags, CPoint point );
		BOOL OnEraseBkgnd ( CDC *pDC );
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP ()
};

typedef drawing_c *drawing_p;

#define IDC_shell_tool_box 115
#define IDC_tool_box_widget16 116
#define IDC_tool_box_widget17 117
#define IDC_tool_box_widget18 118
#define IDC_tool_box_widget19 119

class tool_box_c: public CButton {
public:
	tool_type tool;
	virtual void create (CWnd * parent, char *widget_name = NULL, unsigned int id = 0, CRect *in_rect = NULL);
	tool_box_c();
	virtual ~tool_box_c();
private:
	CButton * widget16;
	CButton * widget17;
	CButton * widget18;
	CButton * widget19;
public:
	virtual void Fill();
	virtual void Rectangle();
	virtual void Line();
	virtual void Pencil();
protected:
	//{{AFX_MSG(tool_box_c)
		afx_msg void OnValueChanged_widget16();
		afx_msg void OnValueChanged_widget17();
		afx_msg void OnValueChanged_widget18();
		afx_msg void OnValueChanged_widget19();
		BOOL OnEraseBkgnd ( CDC *pDC );
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP ()
};

typedef tool_box_c *tool_box_p;

#define IDC_shell_colour_box 121
#define IDC_colour_box_widget22 122
#define IDC_colour_box_widget23 123
#define IDC_colour_box_widget24 124
#define IDC_colour_box_widget25 125
#define IDC_colour_box_widget26 126
#define IDC_colour_box_widget27 127
#define IDC_colour_box_widget28 128
#define IDC_colour_box_widget29 129

class colour_box_c: public CWnd {
public:
	colour_type colour;

	virtual void create (CWnd * parent, char *widget_name = NULL, unsigned int id = 0, CRect *in_rect = NULL);
	colour_box_c();
	virtual ~colour_box_c();
private:
	CButton * widget22;
	CButton * widget23;
	CButton * widget24;
	CButton * widget25;
	CButton * widget26;
	CButton * widget27;
	CButton * widget28;
	CButton * widget29;
protected:
	virtual void Magenta();
	virtual void Cyan();
	virtual void Yellow();
	virtual void Blue();
	virtual void Green();
	virtual void Red();
	virtual void White();
	virtual void Black();
protected:
	//{{AFX_MSG(colour_box_c)
		afx_msg void OnValueChanged_widget22();
		afx_msg void OnValueChanged_widget23();
		afx_msg void OnValueChanged_widget24();
		afx_msg void OnValueChanged_widget25();
		afx_msg void OnValueChanged_widget26();
		afx_msg void OnValueChanged_widget27();
		afx_msg void OnValueChanged_widget28();
		afx_msg void OnValueChanged_widget29();
		BOOL OnEraseBkgnd ( CDC *pDC );
		HBRUSH OnCtlColor ( CDC *pDC, CWnd *pWnd, UINT nCtlColor );
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP ()
};

typedef colour_box_c *colour_box_p;

#define IDD_shell 100
#define IDC_shell_widget2 102
#define IDC_shell_widget3 103
#define ID_shell_widget5 32773
#define ID_shell_widget6 32774
#define ID_shell_widget7 32775
#define IDC_shell_widget8 108
#define ID_shell_widget10 32778
#define ID_shell_widget11 32779
#define ID_shell_widget12 32780
#define IDC_shell_widget20 120

class shell_c: public CFrameWnd {
public:
	virtual void create (CWinApp *win_app, CRect *in_rect = NULL);
	shell_c();
	virtual ~shell_c();
	tool_box_p tool_box;
	colour_box_p colour_box;
protected:
	drawing_p drawing;
private:
	CMenu * widget2;
	CMenu * widget3;
	CMenu * widget8;
public:
	virtual void DoExit();
protected:
	//{{AFX_MSG(shell_c)
		afx_msg void OnActivate_widget7();
		void OnSize ( UINT nType, int cx, int cy );
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP ()
};

typedef shell_c *shell_p;


extern shell_p shell;


class CXApplicationApp : public CWinApp {
public :
	CXApplicationApp ( const char *pszAppName = NULL );
	BOOL InitInstance ();
	int ExitInstance ();
};
#endif
