|
@@ -92,33 +92,38 @@ UIMLDialog::UIMLDialog(
|
|
|
setSize(view->getBreite() + 4, view->getHeight() + 24);
|
|
|
setPosition(window->zBildschirm()->getBackBufferSize() / 2 - getSize() / 2);
|
|
|
setRBreite(2);
|
|
|
- setClosingMe([onClose,
|
|
|
- notifyOnClose,
|
|
|
- notifyOnCloseDimension,
|
|
|
- notifyOnCloseBlock,
|
|
|
- this](void* p, void* o, MausEreignis me) {
|
|
|
- if (me.id == ME_RLinks)
|
|
|
- {
|
|
|
- if (notifyOnClose)
|
|
|
- {
|
|
|
- if (notifyOnCloseDimension >= 0)
|
|
|
- {
|
|
|
- char* msg = new char[name.getLength() + 3];
|
|
|
- msg[0] = 1; // dialog closed
|
|
|
- *(short*)(msg + 1) = (short)name.getLength();
|
|
|
- memcpy(msg + 3, name.getText(), name.getLength());
|
|
|
- World::INSTANCE->zClient()->blockAPIRequest(
|
|
|
+ this->onClose = [onClose,
|
|
|
+ notifyOnClose,
|
|
|
notifyOnCloseDimension,
|
|
|
notifyOnCloseBlock,
|
|
|
- msg,
|
|
|
- name.getLength() + 3);
|
|
|
- delete[] msg;
|
|
|
- } // TODO: else entity notification
|
|
|
- }
|
|
|
- onClose(this);
|
|
|
+ this](UIMLDialog* self) {
|
|
|
+ if (notifyOnClose)
|
|
|
+ {
|
|
|
+ if (notifyOnCloseDimension >= 0)
|
|
|
+ {
|
|
|
+ char* msg = new char[name.getLength() + 3];
|
|
|
+ msg[0] = 1; // dialog closed
|
|
|
+ *(short*)(msg + 1) = (short)name.getLength();
|
|
|
+ memcpy(msg + 3, name.getText(), name.getLength());
|
|
|
+ World::INSTANCE->zClient()->blockAPIRequest(
|
|
|
+ notifyOnCloseDimension,
|
|
|
+ notifyOnCloseBlock,
|
|
|
+ msg,
|
|
|
+ name.getLength() + 3);
|
|
|
+ delete[] msg;
|
|
|
+ } // TODO: else entity notification
|
|
|
}
|
|
|
- return 1;
|
|
|
- });
|
|
|
+ onClose(this);
|
|
|
+ };
|
|
|
+ setClosingMe(
|
|
|
+ [notifyOnClose, notifyOnCloseDimension, notifyOnCloseBlock, this](
|
|
|
+ void* p, void* o, MausEreignis me) {
|
|
|
+ if (me.id == ME_RLinks)
|
|
|
+ {
|
|
|
+ this->close();
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ });
|
|
|
setRFarbe(0xFF52525E);
|
|
|
setTitel(xml->getAttributeValue("title"));
|
|
|
setTSchriftZ(
|
|
@@ -150,4 +155,9 @@ void UIMLDialog::api(char* message)
|
|
|
const Framework::Text& UIMLDialog::getName() const
|
|
|
{
|
|
|
return name;
|
|
|
+}
|
|
|
+
|
|
|
+void UIMLDialog::close()
|
|
|
+{
|
|
|
+ onClose(this);
|
|
|
}
|