Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified lazarus/lib/x86_64-linux/unit1.o
Binary file not shown.
Binary file modified lazarus/lib/x86_64-linux/unit1.ppu
Binary file not shown.
Binary file modified lazarus/lib/x86_64-linux/unitipcthread.o
Binary file not shown.
Binary file modified lazarus/lib/x86_64-linux/unitipcthread.ppu
Binary file not shown.
Binary file modified lazarus/phpgui-x86_64-linux
Binary file not shown.
4 changes: 4 additions & 0 deletions lazarus/unitipcthread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ procedure TIpcThread.SetObjectProperty;
propertyValue: Variant;
propInfo: PPropInfo;
subpropertyName: String;
messageId: Integer;
begin
// param[0] = objectId
// param[1] = propertyName
Expand Down Expand Up @@ -467,6 +468,9 @@ procedure TIpcThread.SetObjectProperty;
begin
// @TODO: Convert propertyValue to a object checking with PropIsType and GetObjectPropClass
SetPropValue(obj, propertyName, propertyValue);

messageId := jData.FindPath('id').AsInteger;
Output('{"id": ' + IntToStr(messageId) + ',"result": { "propertyName": "' + propertyName + '", "propertyValue": "' + VarToStr(propertyValue) + '"}}');
end;
end;
end;
Expand Down
3 changes: 2 additions & 1 deletion src/Components/LazarusObjectInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public function getLazarusClass();
* Fire an object event
*
* @param string $eventName Event Name
* @param array $arguments Aguments
*
* @return void
*/
public function fire($eventName);
public function fire($eventName, array $arguments = []);

/**
* Add a listener to an event
Expand Down
14 changes: 10 additions & 4 deletions src/Components/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,14 @@ protected function set($name, $value)
$name,
$value
],
function ($result) {
// Ok, the property changed
function ($result) use ($name, $value) {
$this->fire(
'onpropertySet',
[
$name,
$value
]
);
}
);
}
Expand Down Expand Up @@ -234,11 +240,11 @@ public function getLazarusClass()
/**
* {@inheritdoc}
*/
public function fire($eventName)
public function fire($eventName, array $arguments = [])
{
if (array_key_exists($eventName, $this->eventHandlers)) {
foreach ($this->eventHandlers[$eventName] as $eventHandler) {
$eventHandler();
call_user_func_array($eventHandler, $arguments);
}
}
}
Expand Down