Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hard coded paths, please #18

Open
mawg opened this issue Jan 25, 2018 · 9 comments
Open

No hard coded paths, please #18

mawg opened this issue Jan 25, 2018 · 9 comments

Comments

@mawg
Copy link

mawg commented Jan 25, 2018

Not everyone installed Delphi to the default path. Which leads to ...

In InspDemo.vrc

AmethystKamri VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\AmethystKamri.vsf"
CyanDusk VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\CyanDusk.vsf"
Luna VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\Luna.vsf"

[BRCC32 Error] InspDemo.vrc(66): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\AmethystKamri.vsf
[BRCC32 Error] InspDemo.vrc(67): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\CyanDusk.vsf
[BRCC32 Error] InspDemo.vrc(68): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\Luna.vsf

@pyscripter
Copy link
Contributor

The vrc file is created by the compiler. If you see the source code of
zcontrols/Demo/InspDemo.dproj it does not contain hard coded paths. However it does specify the use of AmethystKamri and the other styles which apparently are not available in your Delphi installation or at least they are not present in the location expected by the compiler. Just go to the Project options, Appearance, remove these styles and you should be OK.

@mawg
Copy link
Author

mawg commented Jan 26, 2018

Yes, I can see that the file is auto-generated. When I editted it to my path, the file was overwritten when I built. What I did was to copy those three files to the default location & everything was fine. is it worth making a small note in How To Install.txt?


A separate question.:I have long been looking for something like the Object Inspector which I can use at run-time to examine & change (some of) the properties of my own objects, which are not all VCL controls. Can I do that with this component?

@pyscripter
Copy link
Contributor

The inspector can be used to inspect and change any object. The property Component is of type TObject and can be set to any Delphi object.

@MahdiSafsafi
Copy link
Owner

Hi there,

As pyscripter pointed you out, there is no hard paths from the library. Only the compiler that made such paths.
Please, select Project => Options => Appearance and then press OK. This will fix all paths.

Note: There is no need to remove styles. The demo enumerates the available styles and it doesn't force
for a particular style.

For your second question, I believe that pyscripter explained it very well :)

@mawg
Copy link
Author

mawg commented Feb 4, 2018

Can you show a very basic demo of adding a non-VCL control class and showing its properties in the inspector?

@mawg
Copy link
Author

mawg commented Feb 5, 2018

I tried
TMyClass = Class(TObject)
public
val :Integer;
motto : String;
End;
myObject : TMyClass;

and

procedure TMain.FormCreate(Sender: TObject);
begin
GetObjsList;
EnumStyles;

myObject := TMyClass.Create();
myObject.val := 13;
myObject.motto := 'Hello, world';

zObjectInspector1.Component := TComponent(myObject);
end;

but my object was not shown in the object inspector :-(

@MahdiSafsafi
Copy link
Owner

That's because var is not a published property. Inspector works with properties and not variables/constants.

@mawg
Copy link
Author

mawg commented Feb 6, 2018

You are correct !!! I changed it to

TMyClass = Class(TObject)
private
myValue : Integer;
myMotto : String;

 Published
    property  val :Integer read myValue write myValue;
    property  motto : String read myMotto write myMotto;

End;

and now those properties of my object show in the Object Inspector !

Wow! I have been looking for something like this for over ten years; thank you so much !

@pyscripter
Copy link
Contributor

Please close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants