bazaar: PopUpC and alueAccessorEditot

git-svn-id: svn://ultimatepp.org/upp/trunk@14148 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
kohait 2020-03-10 18:36:52 +00:00
parent cdb7552fe4
commit eae1b88db4
3 changed files with 16 additions and 13 deletions

View file

@ -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

View file

@ -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;

View file

@ -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