PainterExamples added Ctrl+P: printing

git-svn-id: svn://ultimatepp.org/upp/trunk@787 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-01-19 22:39:52 +00:00
parent 58d0fe7678
commit c11466bafe
3 changed files with 18 additions and 4 deletions

View file

@ -26,6 +26,20 @@ struct App : TopWindow {
SplitterFrame split;
ArrayCtrl list;
virtual bool Key(dword key, int count)
{
if(key == K_CTRL_P) {
PaintingPainter sw(1000, 1000);
sw.Clear(White());
if(list.IsCursor())
Examples()[list.GetCursor()].example(sw);
PrinterJob pb;
if(pb.Execute())
pb.GetDraw().DrawPainting(0, 0, 4000, 4000, sw);
}
return TopWindow::Key(key, count);
}
virtual void Paint(Draw& w)
{
ImageBuffer ib(GetSize());