mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@2791 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
26c1b40eb5
commit
53638209ec
1 changed files with 59 additions and 53 deletions
|
|
@ -1,53 +1,59 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
using namespace Upp;
|
||||
#define IMAGECLASS Imgs
|
||||
#define IMAGEFILE <CtrlLib/Ctrl.iml>
|
||||
#include <Draw/iml.h>
|
||||
|
||||
struct Dlg : TopWindow{
|
||||
Button b;
|
||||
|
||||
typedef Dlg CLASSNAME;
|
||||
|
||||
Dlg() {
|
||||
Title("Dialog").Sizeable();
|
||||
SetRect(0,0,300,200);
|
||||
Add(b.TopPos(10,20).LeftPos(10,100));
|
||||
b.SetLabel("OK");
|
||||
b<<=THISBACK(DoStuffAndExit);
|
||||
}
|
||||
|
||||
void DoStuffAndExit(){
|
||||
Hide();
|
||||
Progress p;
|
||||
p.SetText("Pretending work...");
|
||||
for(int i=0;i<100;i++){
|
||||
Sleep(25);
|
||||
p.Step();
|
||||
}
|
||||
Close();
|
||||
}
|
||||
};
|
||||
|
||||
struct App : TopWindow {
|
||||
ToolBar tool;
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
Title("My application with bars").Sizeable();
|
||||
AddFrame(tool);
|
||||
tool.Set(THISBACK(TBar));
|
||||
}
|
||||
|
||||
void MenuFn() {
|
||||
Dlg().Execute();
|
||||
}
|
||||
void TBar(Bar& bar) {
|
||||
bar.Add("Function", Imgs::open(), THISBACK(MenuFn));
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN {
|
||||
App().Run();
|
||||
}
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
using namespace Upp;
|
||||
#define IMAGECLASS Imgs
|
||||
#define IMAGEFILE <CtrlLib/Ctrl.iml>
|
||||
#include <Draw/iml.h>
|
||||
|
||||
struct Dlg : TopWindow{
|
||||
Button b;
|
||||
|
||||
typedef Dlg CLASSNAME;
|
||||
|
||||
Dlg() {
|
||||
Title("Dialog").Sizeable();
|
||||
SetRect(0,0,300,200);
|
||||
Add(b.TopPos(10,20).LeftPos(10,100));
|
||||
b.SetLabel("OK");
|
||||
b<<=THISBACK(DoStuffAndExit);
|
||||
}
|
||||
|
||||
void DoStuffAndExit(){
|
||||
Hide();
|
||||
Progress p;
|
||||
p.SetText("Pretending work...");
|
||||
for(int i=0;i<100;i++){
|
||||
Sleep(25);
|
||||
p.Step();
|
||||
}
|
||||
Close();
|
||||
}
|
||||
};
|
||||
|
||||
struct App : TopWindow {
|
||||
ToolBar tool;
|
||||
DropList test;
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
Title("My application with bars").Sizeable();
|
||||
AddFrame(tool);
|
||||
tool.Set(THISBACK(TBar));
|
||||
Add(test.LeftPos(0, 200).TopPos(50, 20));
|
||||
for(int i = 0; i < 100; i++)
|
||||
test.Add(i);
|
||||
}
|
||||
|
||||
void MenuFn() {
|
||||
Dlg().Execute();
|
||||
}
|
||||
void TBar(Bar& bar) {
|
||||
bar.Add("Function", Imgs::open(), THISBACK(MenuFn));
|
||||
bar.Add("Function", Imgs::open(), THISBACK(MenuFn));
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN {
|
||||
GUI_PopUpEffect_Write(GUIEFFECT_NONE);
|
||||
App().Run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue