diff --git a/bazaar/Gen/Gen.h b/bazaar/Gen/Gen.h index 47d3cc860..fa19dd0b1 100644 --- a/bazaar/Gen/Gen.h +++ b/bazaar/Gen/Gen.h @@ -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 diff --git a/bazaar/PopUpC/PopUpC.h b/bazaar/PopUpC/PopUpC.h index f1bb96aee..1de07c9d1 100644 --- a/bazaar/PopUpC/PopUpC.h +++ b/bazaar/PopUpC/PopUpC.h @@ -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; diff --git a/bazaar/PopUpTest/main.cpp b/bazaar/PopUpTest/main.cpp index a822b3fb8..35571b8f5 100644 --- a/bazaar/PopUpTest/main.cpp +++ b/bazaar/PopUpTest/main.cpp @@ -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