/*
* LabelGadget.cpp
* Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL++2000
// 2000.03.20
#include <sol\ApplicationView.h>
#include <sol\LabelGadget.h>
#include <sol\PaintDC.h>
namespace SOL {
class AppView :public ApplicationView {
private:
LabelGadget labelg;
private:
long paint(Event& event) {
PaintDC dc(this);
for (int i = 0; i<10; i++) {
labelg.draw(&dc, 10, 10+40*i);
}
return 0L;
}
public:
/**
* Constructor
*/
AppView(Application& applet, const TCHAR* name, Args& args)
:ApplicationView(applet, name, args)
{
Args ar;
ar.set(XmNmargin, 2);
labelg.create(this, _T(" Hello world! "), ar);
labelg.setBackColor(RGB(0,0,255));
labelg.setTextColor(RGB(255,255,255));
addEventHandler(WM_PAINT, this,
(Handler)&AppView::paint, NULL);
}
};
}
//
void Main(int argc, TCHAR** argv)
{
const TCHAR* appClass = _T("LabelGadget");
try {
Application applet(appClass, argc, argv);
Args args;
AppView appview(applet, appClass, args);
appview.realize();
applet.run();
} catch (...) {
}
}
|