ultimatepp/upptst/MtDraw/main.cpp
cxl 178220c490 plugin/Eigen moved to uppsrc
git-svn-id: svn://ultimatepp.org/upp/trunk@5632 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2012-12-08 19:08:21 +00:00

59 lines
949 B
C++

#include <CtrlLib/CtrlLib.h>
#include <PdfDraw/PdfDraw.h>
using namespace Upp;
struct MyApp : TopWindow {
RichTextCtrl ctrl;
TopWindow win;
void Do(int i);
void Perform();
typedef MyApp CLASSNAME;
MyApp();
};
void MyApp::Do(int i)
{
String qtf;
qtf << "Here goes Image "
// << "@@iml:" << Random(100) * 10 + 100 << "*" << Random(150) * 10 + 100 << "`CtrlImg:exclamation` !!!"
<< "&This was pass: " << i;
if(i & 1) {
RLOG("About to lock, main: " << Thread::IsMain());
GuiLock __;
ctrl <<= qtf;
}
else {
PdfDraw w;
ParseQTF(qtf).Paint(w, 0, 0, 3000);
SaveFile(GetHomeDirFile(AsString(i % 100)), w.Finish());
}
}
void MyApp::Perform()
{
Open();
int i = 0;
CoWork co;
while(IsOpen()) {
co & THISBACK1(Do, i++);
Ctrl::ProcessEvents();
}
RLOG("EXITING!!!!!!!!!!!!!!");
while(!co.IsFinished())
Ctrl::ProcessEvents();
}
MyApp::MyApp()
{
Add(ctrl.SizePos());
}
GUI_APP_MAIN
{
MyApp().Perform();
}