mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlLib, Doc: Removed virtual keyword from tutorials in favor of override.
This commit is contained in:
parent
63b86ae8f5
commit
e0bf5a0a35
7 changed files with 36 additions and 45 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(); });
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue