mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
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:
parent
d624083869
commit
92ba0bf056
4 changed files with 12 additions and 15 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue