mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Doc, Draw: Improve draw tutorial and add missing code to tutorial source code
This commit is contained in:
parent
a8fa1ec628
commit
8911eacec2
6 changed files with 108 additions and 66 deletions
|
|
@ -51,5 +51,8 @@ struct MyApp : TopWindow {
|
|||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Run();
|
||||
MyApp app;
|
||||
app.Title("Basic Drawing Operations").Zoomable().Sizeable();
|
||||
app.SetRect(0, 0, 500, 420);
|
||||
app.Run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ struct MyApp : TopWindow {
|
|||
w.DrawText(0, 0, "Hello world", Roman(30).Bold());
|
||||
}
|
||||
|
||||
virtual void Paint(Draw& w) override {
|
||||
void Paint(Draw& w) override {
|
||||
w.DrawRect(GetSize(), White());
|
||||
DoPainting(w);
|
||||
w.Offset(30, 50);
|
||||
|
|
@ -27,5 +27,8 @@ struct MyApp : TopWindow {
|
|||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Run();
|
||||
MyApp app;
|
||||
app.Title("Offsets and Cliping").Zoomable().Sizeable();
|
||||
app.SetRect(0, 0, 420, 240);
|
||||
app.Run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,5 +42,8 @@ struct MyApp : TopWindow {
|
|||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Run();
|
||||
MyApp app;
|
||||
app.Title("Fonts and Font Metrics").Zoomable().Sizeable();
|
||||
app.SetRect(0, 0, 700, 300);
|
||||
app.Run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,8 @@ struct MyApp : TopWindow {
|
|||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Run();
|
||||
MyApp app;
|
||||
app.Title("DrawingDraw").Zoomable().Sizeable();
|
||||
app.SetRect(0, 0, 380, 360);
|
||||
app.Run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,16 +11,19 @@ struct MyApp : TopWindow {
|
|||
}
|
||||
|
||||
MyApp() {
|
||||
ImageDraw iw(100, 40);
|
||||
iw.Alpha().DrawRect(0, 0, 100, 40, GrayColor(0));
|
||||
iw.Alpha().DrawEllipse(0, 0, 100, 40, GrayColor(255));
|
||||
iw.DrawEllipse(0, 0, 100, 40, Yellow());
|
||||
iw.DrawText(26, 10, "Image", Arial(16).Bold());
|
||||
ImageDraw iw(200, 80);
|
||||
iw.Alpha().DrawRect(0, 0, 200, 80, GrayColor(0));
|
||||
iw.Alpha().DrawEllipse(0, 0, 200, 80, GrayColor(255));
|
||||
iw.DrawEllipse(0, 0, 200, 80, Yellow());
|
||||
iw.DrawText(50, 15, "Image", Arial(32).Bold());
|
||||
image = iw;
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Run();
|
||||
MyApp app;
|
||||
app.Title("ImageDraw").Zoomable().Sizeable();
|
||||
app.SetRect(0, 0, 220, 100);
|
||||
app.Run();
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue