Tutorial: MyAppWindow name standardization accross GUI tutorials.

git-svn-id: svn://ultimatepp.org/upp/trunk@15482 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2020-11-21 23:42:10 +00:00
parent d624083869
commit 92ba0bf056
4 changed files with 12 additions and 15 deletions

View file

@ -2,14 +2,14 @@
using namespace Upp;
struct MyApp : TopWindow {
struct MyAppWindow : TopWindow {
Button exit;
void Exit() {
Break(999);
}
MyApp() {
MyAppWindow() {
SetRect(0, 0, 100, 100);
Add(exit.SetLabel("exit").LeftPosZ(10, 64).TopPosZ(10, 24));
exit << [=] { Exit(); };
@ -18,5 +18,5 @@ struct MyApp : TopWindow {
GUI_APP_MAIN
{
MyApp().Run();
MyAppWindow().Run();
}

View file

@ -2,10 +2,10 @@
using namespace Upp;
struct MyApp : TopWindow {
struct MyAppWindow : TopWindow {
Button exit;
MyApp() {
MyAppWindow() {
SetRect(0, 0, 100, 100);
Add(exit.SetLabel("exit").LeftPosZ(10, 64).TopPosZ(10, 24));
exit <<= Breaker(999);
@ -14,5 +14,5 @@ struct MyApp : TopWindow {
GUI_APP_MAIN
{
MyApp().Run();
MyAppWindow().Run();
}

View file

@ -2,11 +2,11 @@
using namespace Upp;
struct MyApp : TopWindow {
struct MyAppWindow : TopWindow {
Button ok, cancel;
EditDate date;
MyApp() {
MyAppWindow() {
SetRect(0, 0, 200, 90);
Add(date.LeftPosZ(10, 80).TopPosZ(10, 20));
Add(ok.SetLabel("OK").LeftPosZ(10, 64).TopPosZ(40, 24));
@ -19,7 +19,7 @@ struct MyApp : TopWindow {
GUI_APP_MAIN
{
MyApp app;
MyAppWindow app;
switch(app.Run()) {
case IDOK:
PromptOK(String().Cat() << "OK: " << ~app.date);

View file

@ -3,26 +3,23 @@
using namespace Upp;
struct MyCtrl : public Ctrl {
int count;
int count = 0;
virtual void Paint(Draw& w) {
virtual void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
w.DrawText(2, 2, AsString(count));
}
virtual void LeftDown(Point, dword) {
virtual void LeftDown(Point, dword) override {
count++;
Refresh();
}
MyCtrl() { count = 0; }
};
#define LAYOUTFILE <Gui21/Gui21.lay>
#include <CtrlCore/lay.h>
struct Gui21 : public WithGui21Layout<TopWindow> {
typedef Gui21 CLASSNAME;
Gui21();
};