CtrlLib, Doc: Removed virtual keyword from tutorials in favor of override.

This commit is contained in:
Zbigniew Rębacz 2023-10-01 09:41:47 +02:00
parent 63b86ae8f5
commit e0bf5a0a35
7 changed files with 36 additions and 45 deletions

View file

@ -3,7 +3,7 @@
using namespace Upp;
struct MyAppWindow : TopWindow {
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SWhite());
w.DrawText(20, 20, "Hello world!", Arial(30), Magenta);
}

View file

@ -6,17 +6,17 @@ struct MyAppWindow : TopWindow {
Point p;
String text;
virtual void LeftDown(Point pos, dword flags) override {
void LeftDown(Point pos, dword flags) override {
p = pos;
Refresh();
}
virtual void MouseMove(Point pos, dword flags) override {
void MouseMove(Point pos, dword flags) override {
text = Format("[%d:%d]", pos.x, pos.y);
Refresh();
}
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SWhite);
w.DrawText(p.x, p.y, text, Arial(20), Magenta);
}

View file

@ -8,7 +8,7 @@ struct MyAppWindow : TopWindow {
Break();
}
virtual void RightDown(Point, dword) override {
void RightDown(Point, dword) override {
MenuBar::Execute(
[=](Bar& bar) {
bar.Add("Exit", [=] { Exit(); });

View file

@ -8,7 +8,7 @@ struct MyAppWindow : TopWindow {
Break();
}
virtual void RightDown(Point, dword) override {
void RightDown(Point, dword) override {
int result = Null;
MenuBar menu;
for(int i = 0; i < 10; i++)

View file

@ -5,12 +5,12 @@ using namespace Upp;
struct MyCtrl : public Ctrl {
int count = 0;
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
w.DrawText(2, 2, AsString(count));
}
virtual void LeftDown(Point, dword) override {
void LeftDown(Point, dword) override {
count++;
Refresh();
}

View file

@ -11,7 +11,7 @@ struct MyAppWindow : TopWindow {
Zoomable().Sizeable().SetRect(0, 0, 550, 100);
}
virtual void Paint(Draw& w) override {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), SLtYellow);
w.DrawText(20, 20, t_("Hello translation engine!"), Arial(30), Blue);
}