mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
bazaar: PopUpC and alueAccessorEditot
git-svn-id: svn://ultimatepp.org/upp/trunk@14148 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
cdb7552fe4
commit
eae1b88db4
3 changed files with 16 additions and 13 deletions
|
|
@ -10,7 +10,7 @@ class WithPolyClone : public B
|
|||
{
|
||||
public:
|
||||
// friend T *DeepCopyNew(const T& t) { return t.Copy(); }
|
||||
friend T do_clone(const T& src) { return src.Copy(); }
|
||||
friend T clone(const T& src) { return src.Copy(); }
|
||||
};
|
||||
|
||||
//copyable interface, implementing the Copy function, used i.e. by WithPolyClone
|
||||
|
|
|
|||
|
|
@ -35,20 +35,20 @@ public:
|
|||
void Backup()
|
||||
{
|
||||
StringStream s;
|
||||
this->Serialize(s);
|
||||
Serialize(s);
|
||||
backup = s;
|
||||
}
|
||||
|
||||
void Restore()
|
||||
{
|
||||
StringStream s(backup);
|
||||
this->Serialize(s);
|
||||
Serialize(s);
|
||||
}
|
||||
|
||||
Callback WhenBreak;
|
||||
Callback WhenAccept;
|
||||
Callback WhenReject;
|
||||
Callback WhenDeactivate;
|
||||
Event<> WhenBreak;
|
||||
Event<> WhenAccept;
|
||||
Event<> WhenReject;
|
||||
Event<> WhenDeactivate;
|
||||
|
||||
protected:
|
||||
String backup;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
void PopUpTest::OkCB()
|
||||
{
|
||||
int exitcode = pu.GetExitCode();
|
||||
String a = AsString(pu.ei.GetData());
|
||||
drop.SetLabel(String().Cat() << "dropped OK, " << a);
|
||||
drop.SetLabel(String().Cat() << "dropped OK, " << a << "(" << (exitcode) << ")");
|
||||
}
|
||||
|
||||
void PopUpTest::CancelCB()
|
||||
|
|
@ -14,7 +15,6 @@ void PopUpTest::CancelCB()
|
|||
void PopUpTest::DoDrop()
|
||||
{
|
||||
drop.SetLabel("dropping");
|
||||
pu.ei.SetData(123);
|
||||
pu.PopUp(this);
|
||||
}
|
||||
|
||||
|
|
@ -23,12 +23,15 @@ PopUpTest::PopUpTest()
|
|||
CtrlLayout(*this, "Window title");
|
||||
|
||||
CtrlLayout(pu);
|
||||
pu.ok <<= callback(&pu, &PopUpC::Acceptor);
|
||||
pu.cancel <<= callback(&pu, &PopUpC::Rejector);
|
||||
pu.WhenSelect = THISBACK(OkCB);
|
||||
pu.WhenCancel = THISBACK(CancelCB);
|
||||
pu.Acceptor(pu.ok, CKOK).Rejector(pu.cancel, CKCANCEL);
|
||||
|
||||
pu.WhenAccept = THISBACK(OkCB);
|
||||
pu.WhenReject = THISBACK(CancelCB);
|
||||
|
||||
drop <<= THISBACK(DoDrop);
|
||||
|
||||
//init
|
||||
pu.ei.SetData(123);
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue