|
@@ -5,6 +5,7 @@
|
|
|
#include "Fenster.h"
|
|
|
#include "Knopf.h"
|
|
|
#include "Rahmen.h"
|
|
|
+#include "RCPointer.h"
|
|
|
#include "Schrift.h"
|
|
|
#include "Scroll.h"
|
|
|
#include "Tabelle.h"
|
|
@@ -893,6 +894,20 @@ void UIMLView::doMausEreignis(MausEreignis& me, bool userRet)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void Framework::UIMLView::setOnMemberMouseEvent(std::function<bool(
|
|
|
+ XML::Element& element, Zeichnung& member, MausEreignis me)>
|
|
|
+ onEventAction)
|
|
|
+{
|
|
|
+ onMemberMouseEvent = onEventAction;
|
|
|
+}
|
|
|
+
|
|
|
+void Framework::UIMLView::setOnMemberKeyboardEvent(std::function<bool(
|
|
|
+ XML::Element& element, Zeichnung& member, TastaturEreignis te)>
|
|
|
+ onEventAction)
|
|
|
+{
|
|
|
+ onMemberKeyboardEvent = onEventAction;
|
|
|
+}
|
|
|
+
|
|
|
//! entfernt alle bekannten elemente, die im uiml verwendet werden können
|
|
|
void UIMLView::removeAllKnownElements()
|
|
|
{
|
|
@@ -1218,6 +1233,41 @@ Zeichnung* UIMLView::parseElement(
|
|
|
}
|
|
|
if (z)
|
|
|
{
|
|
|
+ if (hatStyle(Style::GlobalMouseEvent))
|
|
|
+ {
|
|
|
+ z->addMausEreignis(
|
|
|
+ [this, z](void* p, void* o, MausEreignis me) {
|
|
|
+ return dom->selectChildren()
|
|
|
+ .selectAllElements()
|
|
|
+ .whereAttributeEquals("id", getZeichnungId(*z))
|
|
|
+ .getFirstElement()
|
|
|
+ .map<bool>([this, &me, z](
|
|
|
+ RCPointer<XML::Element> element) {
|
|
|
+ return onMemberMouseEvent
|
|
|
+ ? onMemberMouseEvent(*element, *z, me)
|
|
|
+ : 0;
|
|
|
+ })
|
|
|
+ .orElse(0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (hatStyle(Style::GlobalTastaturEvent))
|
|
|
+ {
|
|
|
+ z->addTastaturEreignis(
|
|
|
+ [this, z](void* p, void* o, TastaturEreignis te) {
|
|
|
+ return dom->selectChildren()
|
|
|
+ .selectAllElements()
|
|
|
+ .whereAttributeEquals("id", getZeichnungId(*z))
|
|
|
+ .getFirstElement()
|
|
|
+ .map<bool>([this, &te, z](
|
|
|
+ RCPointer<XML::Element> element) {
|
|
|
+ return onMemberKeyboardEvent
|
|
|
+ ? onMemberKeyboardEvent(
|
|
|
+ *element, *z, te)
|
|
|
+ : 0;
|
|
|
+ })
|
|
|
+ .orElse(0);
|
|
|
+ });
|
|
|
+ }
|
|
|
members->set(
|
|
|
id, id.getLength(), dynamic_cast<Zeichnung*>(z->getThis()));
|
|
|
idList.add(new Text(id));
|
|
@@ -1271,10 +1321,10 @@ void Framework::UIMLView::removeZeichnung(Zeichnung& z)
|
|
|
if (index >= 0)
|
|
|
{
|
|
|
Text id = *idList.z(index);
|
|
|
- idList.remove(index);
|
|
|
- memberList.remove(index);
|
|
|
+ idList.remove(index);
|
|
|
+ memberList.remove(index);
|
|
|
members->remove(id, id.getLength());
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
bool Framework::UIMLView::registerZeichnung(const char* id, Zeichnung* z)
|