/*
* HelloWorld.cpp
* Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL9
// 2009/10/08
#include <sol\ApplicationView.h>
#include <sol\PaintDC.h>
namespace SOL {
class HelloWorld :public ApplicationView {
public:
/**
* Constructor
*/
HelloWorld(Application& applet, const TCHAR* label, Args& args)
:ApplicationView(applet, label, args)
{
addEventHandler(WM_PAINT, this,
(Handler)&HelloWorld::paint, _T("Hello world"));
}
private:
long paint(Event& event)
{
PaintDC pdc(this);
TCHAR* text = (TCHAR*)event.getData();
if (text) {
pdc.setBkColor(RGB(0, 0, 255));
pdc.setTextColor(RGB(255, 255, 255));
pdc.textOut(100, 100, text, strlen(text));
}
return 0L;
}
};
}
void Main(int argc, TCHAR** argv)
{
const TCHAR* name = _T("HelloWorld");
try {
Application applet(name, argc, argv);
Args args;
HelloWorld hellov(applet, name, args);
hellov.realize();
applet.run();
} catch (...) {
}
}
|