#include "WinTmpl.h"
#include "WinTmpl.cpp"
/* Ex3.cpp: いろいろな描画関数のテスト */

// コンパイルするときは、user32と gdi32をリンクしておく 
// BCC32の場合:      bcc32 -W Ex3.cpp
//	または:	     bcc32 Ex3.cpp -luser32 -lgdi32 		
// Cygnus GCCの場合: g++ Ex3.cpp -mwindows -mno-cygwin
//	     または: g++ Ex3.cpp -luser32 -lgdi32

/* 大域変数の宣言はこの辺り */

TForm::TForm() {
    /* Formのサイズ・色はここで変更する */
    Width =  256;
    Height = 256;

//    Color=clRed;
    Color=clWhite;
}

void TForm::FormCreate(TObject* sender) {
    /* 描画用のウインドウがが最初に作られるときに呼ばれる */ 

    /* Timerは、ここでセットしておく */
    // Timer->SetInterval(200);
    // Timer->SetEnabled(true);
}

void TForm::FormMouseDown(TObject* sender, TMouseButton which,
			  TShiftState shift, int x, int y) {
    /* マウスボタンが押されたとき */
}

void TForm::FormKeyDown(TObject* sender, WORD key, TShiftState shift) {
    /* キーボードが押されたとき */
}

void TForm::TimerTimer(TObject* sender) {
    /* Timerで一定時間ごとに呼ばれる */
}

void TForm::FormPaint(TObject* sender) {
    /* 描画を行なう */
       Canvas->Pen->Color = clRed;
       Canvas->MoveTo(10,10);
       Canvas->LineTo(200,200);
   
       Canvas->Pen->Color = clBlue;
       Canvas->Brush->Color = clBlue;
       Canvas->Brush->Style = bsCross;
       Canvas->Rectangle(0,100,90,190);
   
       Canvas->Brush->Style = bsClear;
       Canvas->Pen->Color = clGreen;
       Canvas->Ellipse(100,10,210,70);
   
       Canvas->Font->Color = clYellow;
       Canvas->Font->Size = 36;
       Canvas->Brush->Style = bsClear;
       Canvas->TextOut(40,40,"こんにちは");
}

