gabrielrcouto / php-gui

Extensionless PHP Graphic User Interface library
2.24k stars 175 forks source link

GetObjectProperty does not work for properties in collection format #110

Closed everton3x closed 7 years ago

everton3x commented 7 years ago

I am trying to implement TFileNameEdit and I encountered problems using the DialogFiles property to return the selected files, regardless of whether or not the ofAllowMultiSelect is used.

TFileNameEdit.DialogFiles seems to return a string collection with the name of the selected files. The return type is TStrings.

From what I saw in the source code in Lazarus, TIpcThread.GetObjectProperty always returns a string, but in the specific case the conversion done by VarToStr (propertyValue) is not returning anything.

In addition could you tell me the way to fix this, since TFileNameEdit only provides that property to access all the selected files.

reisraff commented 7 years ago

Please, create a PR with the code you have done, so I'll reproduce here, to understand what is happening, so then I tell you if I discover, what you need do.

reisraff commented 7 years ago

109 I saw you commited, so I'm working on.

reisraff commented 7 years ago

I created a PR in your fork repository with some changes for you continue.

https://github.com/everton3x/php-gui/pull/1/files

reisraff commented 7 years ago

@gabrielrcouto I guess it can be closed... If you give me access in this repository I can help you manage it.

everton3x commented 7 years ago

Thanks to @reisraff's help I was able to implement TFileNameEdit.

Basically, the GetObjectProperty has modified the IF / ELSE that identifies whether the property value is integer or string to also identify if the calling property is TFileNameEdit.DialogFiles.

I still find it interesting to think of a generic way of finding property values in Array format.

I'm going to start studying Free Pascal to come up with a solution.