mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-21 14:15:25 -06:00
CtrlLib, Doc: GUI tutorail no longer posses reference to CLASSNAME.
git-svn-id: svn://ultimatepp.org/upp/trunk@15433 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c39c30b6bd
commit
3640f582cf
1 changed files with 23 additions and 24 deletions
|
|
@ -256,17 +256,17 @@ issue the repainting of view area, use the [* Refresh] method.&]
|
|||
[s7; -|Point p;&]
|
||||
[s7; -|String text;&]
|
||||
[s7; -|&]
|
||||
[s7; [* -|virtual void LeftDown(Point pos, dword flags) `{]&]
|
||||
[s7; [* -|virtual void LeftDown(Point pos, dword flags) override `{]&]
|
||||
[s7; [* -|-|p `= pos;]&]
|
||||
[s7; [* -|-|Refresh();]&]
|
||||
[s7; [* -|`}]&]
|
||||
[s7;* &]
|
||||
[s7; [* -|virtual void MouseMove(Point pos, dword flags) `{]&]
|
||||
[s7; [* -|virtual void MouseMove(Point pos, dword flags) override `{]&]
|
||||
[s7; [* -|-|text `= Format(`"`[%d:%d`]`", pos.x, pos.y);]&]
|
||||
[s7; [* -|-|Refresh();]&]
|
||||
[s7; [* -|`}]&]
|
||||
[s7; &]
|
||||
[s7; -|virtual void Paint(Draw`& w) `{&]
|
||||
[s7; -|virtual void Paint(Draw`& w) override `{&]
|
||||
[s7; -|-|w.DrawRect(GetSize(), SWhite);&]
|
||||
[s7; -|-|w.DrawText(p.x, p.y, text, Arial(20), Magenta);&]
|
||||
[s7; -|`}&]
|
||||
|
|
@ -302,15 +302,15 @@ window.&]
|
|||
[s7; using namespace Upp;&]
|
||||
[s7; &]
|
||||
[s7; struct MyAppWindow : TopWindow `{&]
|
||||
[s7; -|virtual void Close() `{&]
|
||||
[s7; -|virtual void Close() override `{&]
|
||||
[s7; -|-|delete this;&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|virtual void LeftDown(Point pos, dword flags) `{&]
|
||||
[s7; -|virtual void LeftDown(Point pos, dword flags) override `{&]
|
||||
[s7; [* -|-|(new MyAppWindow)`->OpenMain();]&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|virtual void Paint(Draw`& w) `{&]
|
||||
[s7; -|virtual void Paint(Draw`& w) override `{&]
|
||||
[s7; -|-|w.DrawRect(GetSize(), SWhite);&]
|
||||
[s7; -|-|w.DrawText(0, 0, `"Click the view area to open next window!`",
|
||||
Arial(20));&]
|
||||
|
|
@ -363,8 +363,6 @@ view area.&]
|
|||
[s7; -|-|bar.[* Sub](`"Menu`", `[`=`](Bar`& bar) `{ [* SubMenu](bar); `});&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|typedef MyAppWindow CLASSNAME;&]
|
||||
[s7; &]
|
||||
[s7; -|MyAppWindow() `{&]
|
||||
[s7; -|-|Title(`"My application with menu`").Sizeable();&]
|
||||
[s7; -|-|[* AddFrame](menu);&]
|
||||
|
|
@ -433,7 +431,7 @@ MenuBar to your application, you [/ execute] the menu event:&]
|
|||
[s7; -|-|-|Break();&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void RightDown(Point, dword) `{&]
|
||||
[s7; -|virtual void RightDown(Point, dword) override `{&]
|
||||
[s7; -|-|MenuBar`::Execute(&]
|
||||
[s7; -|-|-|`[`=`](Bar`& bar) `{&]
|
||||
[s7; -|-|-|-|bar.Add(`"Exit`", `[`=`] `{ Exit(); `});&]
|
||||
|
|
@ -473,7 +471,7 @@ the menu item to same value, by using lambda capture by reference:&]
|
|||
[s7; -|-|-|Break();&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void RightDown(Point, dword) `{&]
|
||||
[s7; -|virtual void RightDown(Point, dword) override `{&]
|
||||
[s7; -|-|int [* result ]`= Null;&]
|
||||
[s7; -|-|[* MenuBar menu];&]
|
||||
[s7; -|-|for(int i `= 0; i < 10; i`+`+)&]
|
||||
|
|
@ -619,23 +617,23 @@ text are added to toolbars only.&]
|
|||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void SubBar(Bar`& bar) `{&]
|
||||
[s7; -|-|bar.AddMenu(`"Function`", TutorialImg`::Fn(), THISBACK(MenuFn));&]
|
||||
[s7; [* -|-|bar.Add(TutorialImg`::Fn2(), THISBACK(BarFn));]&]
|
||||
[s7; [* -|-|bar.Add(`"Exit`", TutorialImg`::Exit(), THISBACK(Exit));]&]
|
||||
[s0;l321; [C@5;1 -|-|bar.AddMenu(`"Function`", TutorialImg`::Fn(), `[`=`]
|
||||
`{ MenuFn(); `});]&]
|
||||
[s7; -|-|[* bar.Add(TutorialImg`::Fn2(), `[`=`] `{ BarFn(); `});]&]
|
||||
[s7; [* -|-|bar.Add(`"Exit`", TutorialImg`::Exit(), `[`=`] `{ Exit();
|
||||
`});]&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void MainMenu(Bar`& bar) `{&]
|
||||
[s7; -|-|bar.Add(`"Menu`", THISBACK(SubBar));&]
|
||||
[s7; -|-|bar.Sub(`"Menu`", `[`=`] (Bar`& bar) `{ SubBar(bar); `});&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|typedef MyAppWindow CLASSNAME;&]
|
||||
[s7; &]
|
||||
[s7; -|MyAppWindow() `{&]
|
||||
[s7; -|-|Title(`"My application with bars`").Sizeable();&]
|
||||
[s7; -|-|AddFrame(menu);&]
|
||||
[s7; [* -|-|AddFrame(tool);]&]
|
||||
[s7; -|-|menu.Set(THISBACK(MainMenu));&]
|
||||
[s7; [* -|-|tool.Set(THISBACK(SubBar));]&]
|
||||
[s0;l321; -|-|[C@5;1 menu.Set(`[`=`](Bar`& bar) `{ MainMenu(bar); `});]&]
|
||||
[s7; -|-|[* tool.Set(`[`=`](Bar`& bar) `{ SubBar(bar); `});]&]
|
||||
[s7; -|`}&]
|
||||
[s7; `};&]
|
||||
[s7; &]
|
||||
|
|
@ -689,15 +687,16 @@ widgets concurrently.&]
|
|||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void SubBar(Bar`& bar) `{&]
|
||||
[s7; -|-|bar.AddMenu(`"Function`", TutorialImg`::Fn(), THISBACK(MenuFn))&]
|
||||
[s7; -|-|bar.AddMenu(`"Function`", TutorialImg`::Fn(), `[`=`] `{ MenuFn();
|
||||
`})&]
|
||||
[s7; [* -|-| .Help(`"This invokes MenuFn method of tutorial example`");]&]
|
||||
[s7; -|-|bar.Add(TutorialImg`::Fn2(), THISBACK(BarFn))&]
|
||||
[s7; -|-|bar.Add(TutorialImg`::Fn2(), `[`=`] `{ BarFn(); `})&]
|
||||
[s7; [* -|-| .Help(`"This invokes BarFn method of tutorial example`");]&]
|
||||
[s7; -|-|bar.Add(`"Exit`", TutorialImg`::Exit(), THISBACK(Exit));&]
|
||||
[s7; -|-|bar.Add(`"Exit`", TutorialImg`::Exit(), `[`=`] `{ Exit(); `});&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|void MainMenu(Bar`& bar) `{&]
|
||||
[s7; -|-|bar.Add(`"Menu`", THISBACK(SubBar));&]
|
||||
[s7; -|-|bar.Sub(`"Menu`", `[`=`](Bar`& bar) `{ SubBar(bar); `});&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|typedef MyAppWindow CLASSNAME;&]
|
||||
|
|
@ -709,9 +708,9 @@ widgets concurrently.&]
|
|||
[s7; -|-|AddFrame(tool);&]
|
||||
[s7; [* -|-|AddFrame(status);]&]
|
||||
[s7; [* -|-|AddFrame(InsetFrame());]&]
|
||||
[s7; -|-|menu.Set(THISBACK(MainMenu));&]
|
||||
[s7; -|-|menu.Set(`[`=`](Bar`& bar) `{ MainMenu(bar); `});&]
|
||||
[s7; [* -|-|menu.WhenHelp `= status;]&]
|
||||
[s7; -|-|tool.Set(THISBACK(SubBar));&]
|
||||
[s7; -|-|tool.Set(`[`=`](Bar`& bar) `{ SubBar(bar); `});&]
|
||||
[s7; [* -|-|tool.WhenHelp `= status;]&]
|
||||
[s7; -|`}&]
|
||||
[s7; `};&]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue