mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
PainterExamples added Ctrl+P: printing
git-svn-id: svn://ultimatepp.org/upp/trunk@787 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
58d0fe7678
commit
c11466bafe
3 changed files with 18 additions and 4 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue