//-----------------------------------------------------------------
// Game File
// C++ Source - Herhaling.cpp - version 2008 v2_06
// Copyright Kevin Hoefman - kevin.hoefman@howest.be
// http://www.digitalartsandentertainment.be/
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include "Herhaling.h"
//-----------------------------------------------------------------
// Defines
//-----------------------------------------------------------------
#define GAME_ENGINE (GameEngine::GetSingleton())
//-----------------------------------------------------------------
// Herhaling methods
//-----------------------------------------------------------------
Herhaling::Herhaling() : m_btnActiePtr(0),m_txtTellerPtr(0),m_txtNoemerPtr(0)
{
// nothing to create
}
Herhaling::~Herhaling()
{
// nothing to destroy
}
void Herhaling::GameInitialize(HINSTANCE hInstance)
{
AbstractGame::GameInitialize(hInstance);
GAME_ENGINE->SetTitle("Herhaling");
//GAME_ENGINE->RunGameLoop(true);
// Stel de optionele waarden in
GAME_ENGINE->SetWidth(640);
GAME_ENGINE->SetHeight(480);
GAME_ENGINE->SetFrameRate(50);
}
void Herhaling::GameStart()
{
m_BreukPtr = new Breuk(0,0);
m_btnActiePtr = new Button("Actie");
m_btnActiePtr->SetBounds(10,10,125,25);
m_btnActiePtr->AddActionListener(this);
m_btnActiePtr->Show();
m_txtTellerPtr = new TextBox("");
m_txtTellerPtr->SetBounds(150,10,125,25);
m_txtTellerPtr->AddActionListener(this);
m_txtTellerPtr->Show();
m_txtNoemerPtr = new TextBox("");
m_txtNoemerPtr->SetBounds(150,40,125,25);
m_txtNoemerPtr->AddActionListener(this);
m_txtNoemerPtr->Show();
}
void Herhaling::GameEnd()
{
delete m_BreukPtr;
delete m_btnActiePtr;
delete m_txtTellerPtr;
delete m_txtNoemerPtr;
}
void Herhaling::MouseButtonAction(bool isLeft, bool isDown, int x, int y, WPARAM wParam)
{
}
void Herhaling::MouseMove(int x, int y, WPARAM wParam)
{
}
void Herhaling::CheckKeyboard()
{
}
void Herhaling::KeyPressed(TCHAR cKey)
{
}
void Herhaling::GamePaint(RECT rect)
{
}
void Herhaling::GameCycle(RECT rect)
{
}
void Herhaling::CallAction(Caller *CallerPtr)
{
if(CallerPtr == m_btnActiePtr)
{
GAME_ENGINE->MessageBox(String("De teller is ") + m_BreukPtr->GetTeller + " en de noemer is " + m_BreukPtr->GetNoemer);
}
GAME_ENGINE->Repaint();
}