//
//	Script player main window
//
//		Copyright (c) 2000-2001	Chihiro.SAKAMOTO (HyperWorks)
//
#ifndef	__MainWin_h__
#define	__MainWin_h__

#include "Window.h"
#include <file.h>
#include "dc.h"
#include "Image.h"
#include "DrawImage.h"
#include "Sprite.h"
#include "direct.h"
#include "Think.h"

class CMainWin:	public CWindow {
  public:
	LRESULT	WindowProc(UINT	uMsg, WPARAM wParam, LPARAM	lParam);

	void OnCommand(UINT	notifyCode,	UINT id, HWND ctrl);

	int MessageBox(const char *str, const char *title=0, unsigned sty=MB_OK|MB_ICONERROR);

  protected:
	virtual	                 BOOL PreCreateWindow(CREATESTRUCT &cs);

	BOOL                     OnCreate(CREATESTRUCT *cs);
	void                     OnPaint();
	void                     ShowMyCaret();
	void                     ShowLeftBoard();
	void                     ShowRightBoard();
	void                     ShowGreyWord();
	void                     ShowCountQuestion();
	void                     ShowLed();
	void                     ShowCover();
	void                     ShowEditBox();
	void                     ShowPare();
	void                     ShowKillerPare();
	void                     ShowDottedLine();
	void                     ShowSum();
	void                     ShowGlideParebox();
	void                     ShowGlideKilparebox();
	void                     ShowSawedge();
	void                     ShowExtraShading();
	void                     ShowWhiteShading();
	void                     OnTimer(WPARAM wParam);
	void                     OnLButtonDown(UINT nFlags, CPoint point);
	void                     OnMButtonUp(UINT nFlags, CPoint point);
	void                     OnRButtonUp(UINT nFlags, CPoint point);
	void                     OnMouseMove(UINT nFlags, CPoint point);
	void                     OnMouseWheel(int zDelta);
	void                     OnMenuOpenL();
	void                     OnMenuOpenR();
	void                     OnMenuSave();
	void                     OnClose();
	void                     OnMenuAnswer();
	void                     OnMenuQuestion();
	void                     OnMenuUp();
	void                     OnMenuDown();
	void                     OnMenuLeft();
	void                     OnMenuRight();
	void                     OnKeyDown(WPARAM wParam);
	void                     OnKeyUp(WPARAM wParam);
	void                     OnMenuCopy();
	void                     OnMenuPaste();
	void                     OnMenuClean();
	void                     OnMenuEmpty();
	void                     OnMenuAnswers();
	void                     OnMenuQuestions();
	void                     OnMenuUnifies();
	void                     OnMenuUnify();
	void                     OnMenuSodoku();
	void                     OnMenuSosum();
	void                     OnMenuSopare();
	void                     OnMenuSomix();
	void                     OnMenuJigsaw();
	void                     OnMenuSoextra();
	void                     OnMenuCheck(bool flag);
	void                     InitMyCaret();
	void                     TerminateAll();

  protected:
	CDrawImage	             ViewImage;
	CImage		             Back;
	CImage                   SpriteImageNumbers;
	CImage                   SpriteImageLittleNumber;
	CImage                   SpriteImageLeds;
	CImage                   SpriteImageGrayWord;
	CImage                   SpriteImageCover;
	CImage                   SpriteImageCompare;
	CImage                   SpriteImageSawedge;
	CImage                   SpriteImageExtra;
	CSprite		             SpriteNumber;

  private:
	int                      XCaret, YCaret; // the x of the caret, the y of the caret(0 to 8)
} ;

inline int CMainWin::MessageBox(const char *text, const char *title, unsigned style)
{
	return ::MessageBox(hWnd, text, title, style);
}

#endif
