Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-12

Compiling

12 messages · 8 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

The "global.pp" problem with Designerform is fixed.

my error...

Pavlovic, you should remove your setting in your email package for the "Reply To:" box. That way when we reply to an email from you on the list, it'll go to the list.

Thanks
Shane

Reply by email

Unknown author
to Shane Miller: If you are going to add a procedure SetProp(Instance: TObject; const PropName:…
Shane Miller wrote 8 lines
If you are going to add a procedure SetProp(Instance: TObject; const PropName: string;const Value: string); can you add a procedure SetSetProp(Instance: TObject; Index : Intger;const Value: string); That way I don't have to do a thing! :-)

I'll keep it in mind :-)

I have TComponentInterface setup to set Boolean, Integers, Floats, Methods and strings. The functions seem to work but setting certain properties seems to fail.

There were some issues setting string properties, but these should be solved in the snapshots I think; release 1.0.4 may solve these.

Michael.

Reply by email

Michael Van Canneyt
to Shane Miller: Question for all: Using RTTI howdo I set a property value? In my source code for…
Shane Miller wrote 19 lines
Question for all: Using RTTI howdo I set a property value? In my source code for TComponentInterface.SetPropbyName I get the PPropinfo record for the property VISIBLE and I check the Setproc variable. It's nil so I need to call it somehow. I have a TMySetProc type that is a Procedure (const value) of Object; In TComponentInterface I have a variable MySetProc of type TMySetProc. I assign MySetProc by.... MySetProc := TMySetProc(SetProc^); then I call it MySetProc(Value); It crashes. Thoughts?

The correct way to do this is using setordprop:

procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo;  Value : Longint);
You could do like this;
// Easy access function:
function GetPropInfo(Instance: TObject; const PropName: string): PPropInfo;
begin
  Result := GetPropInfo(Instance.ClassType, PropName);
end;

Actual code:

begin
  SetOrdProp(Instance,GetPropInfo(Instance),Ord(Value))
end;

Only use the SetXXXprop functions to set properties, don't start looking in the propinfo records.

I will enhance the typinfo unit ASAP, so functions of the kind
procedure SetSetProp(Instance: TObject; const PropName: string;const Value: string);

are available. They were introduced in Delphi 5 as well; you could then use these functions.

Michael.

Reply by email

Shane Miller

Cool. Thanks. I got it to work with the visible property and the NAME property but doing the CAPTION causes it to crash. Trying to do the TOP parameter does nothing along with HINT and a few others.

Not sure why.
Feel free to examine my code. I will continue to

>> 12/01/00 07:44AM >>>
Shane Miller wrote 19 lines
Question for all: Using RTTI howdo I set a property value? In my source code for TComponentInterface.SetPropbyName I get the PPropinfo record for the property VISIBLE and I check the Setproc variable. It's nil so I need to call it somehow. I have a TMySetProc type that is a Procedure (const value) of Object; In TComponentInterface I have a variable MySetProc of type TMySetProc. I assign MySetProc by.... MySetProc := TMySetProc(SetProc^); then I call it MySetProc(Value); It crashes. Thoughts?

The correct way to do this is using setordprop:

procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo;  Value : Longint);
You could do like this;
// Easy access function:
function GetPropInfo(Instance: TObject; const PropName: string): PPropInfo;
begin
  Result := GetPropInfo(Instance.ClassType, PropName);
end;

Actual code:

begin
  SetOrdProp(Instance,GetPropInfo(Instance),Ord(Value))
end;

Only use the SetXXXprop functions to set properties, don't start looking in the propinfo records.

I will enhance the typinfo unit ASAP, so functions of the kind
procedure SetSetProp(Instance: TObject; const PropName: string;const Value: string);

are available. They were introduced in Delphi 5 as well; you could then use these functions.

Michael.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Mattias Gaertner
to Shane Miller
Show quoted text 6 lines
Cool. Thanks. I got it to work with the visible property and the NAME property but doing the CAPTION causes it to crash. Trying to do the TOP parameter does nothing along with HINT and a few others. Not sure why.

There is a bug in the TypInfo.pp for setting shortstrings (two simple typos). I have already committed the bug.
Because the most are using the stable version of fpc, we can fix it using a simple workaround til a fixed version is available. Just copying the four procedures SetIndexValues, SetSStrProp, SetAStrProp and SetStrProp and replacing in the SetSStrProp the GetProc with the SetProc should do the trick.
I will test it.

Mattias

Reply by email

Shane Miller

If you are going to add a

procedure SetProp(Instance: TObject; const PropName: string;const Value: string);
can you add a
procedure SetSetProp(Instance: TObject; Index : Intger;const Value: string);

That way I don't have to do a thing! :-)

I have TComponentInterface setup to set Boolean, Integers, Floats, Methods and strings. The functions seem to work but setting certain properties seems to fail.

I successfully set a Method so that was pretty cool.

Shane

>> 12/01/00 07:44AM >>>
Shane Miller wrote 19 lines
Question for all: Using RTTI howdo I set a property value? In my source code for TComponentInterface.SetPropbyName I get the PPropinfo record for the property VISIBLE and I check the Setproc variable. It's nil so I need to call it somehow. I have a TMySetProc type that is a Procedure (const value) of Object; In TComponentInterface I have a variable MySetProc of type TMySetProc. I assign MySetProc by.... MySetProc := TMySetProc(SetProc^); then I call it MySetProc(Value); It crashes. Thoughts?

The correct way to do this is using setordprop:

procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo;  Value : Longint);
You could do like this;
// Easy access function:
function GetPropInfo(Instance: TObject; const PropName: string): PPropInfo;
begin
  Result := GetPropInfo(Instance.ClassType, PropName);
end;

Actual code:

begin
  SetOrdProp(Instance,GetPropInfo(Instance),Ord(Value))
end;

Only use the SetXXXprop functions to set properties, don't start looking in the propinfo records.

I will enhance the typinfo unit ASAP, so functions of the kind
procedure SetSetProp(Instance: TObject; const PropName: string;const Value: string);

are available. They were introduced in Delphi 5 as well; you could then use these functions.

Michael.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Pavlovic Ivan
to Shane Miller: Cool. Thanks. I got it to work with the visible property and the NAME property but…

Friday, 01 December 2000, 16:50:35, you wrote:

SM> Cool. Thanks. I got it to work with the visible property and the NAME property but doing the CAPTION causes it to crash. Trying to do the TOP parameter does nothing along with HINT and a few SM> others.

SM> Not sure why.
SM> Feel free to examine my code. I will continue to > Shane

>>> 12/01/00 07:44AM >>>
Shane Miller wrote 19 lines
> Question for all: > > Using RTTI howdo I set a property value? > In my source code for TComponentInterface.SetPropbyName > I get the PPropinfo record for the property VISIBLE and > I check the Setproc variable. It's nil so I need > to call it somehow. I have a TMySetProc type that is a > > Procedure (const value) of Object; > > In TComponentInterface I have a variable MySetProc of type TMySetProc. I assign MySetProc by.... > > MySetProc := TMySetProc(SetProc^); > > then I call it > > MySetProc(Value); > > It crashes. Thoughts?

SM> The correct way to do this is using setordprop:

SM> procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo;  Value : Longint);
SM> You could do like this;

SM> // Easy access function:

SM> function GetPropInfo(Instance: TObject; const PropName: string): PPropInfo;
SM> begin
SM>   Result := GetPropInfo(Instance.ClassType, PropName);
SM> end;

SM> Actual code:

SM> begin
SM> SetOrdProp(Instance,GetPropInfo(Instance),Ord(Value)) SM> end;

SM> Only use the SetXXXprop functions to set properties, don't start looking in SM> the propinfo records.

SM> I will enhance the typinfo unit ASAP, so functions of the kind
SM> procedure SetSetProp(Instance: TObject; const PropName: string;const Value: string);

SM> are available. They were introduced in Delphi 5 as well; you could then SM> use these functions.

SM> Michael.

SM> _________________________________________________________________ SM> To unsubscribe: mail with
SM> "unsubscribe" as the Subject
Hi, I've just downloaded lazarus from CVS and tried to compile it using "make all" but it says that there is a reference (in global.pp) to a unit named designerform.pp which does not exist... It says something like 'DesignerForm searched but Designer found'... Am I doing something wrong (I forgot to say that I'm using Linux RedHat 7 and official FPC 1.0)

Pavlovic Ivan Mail: ---- Homepage: ---- http://www.tisoft.cjb.net

Reply by email

Marco van de Voort
to Ronan van Riet: Do you have a projection as to when version 1.04 will become available? Ronan
Show quoted text 5 lines
> Do you have a projection as to when version 1.04 will become available? It was planned for last week; but we decided to wait for the FreeBSD maintainer; I will urge the core team to release 1.0.4 next week if possible.

The delay is not FreeBSD related. Even if I manage to fix the IDE, I don't want to release it yet (without testing).
I wanted to look into the demoes some more, but a concussion kept me in bed for nearly the entire last week. (I only allow myself 20-40 minutes on the computer atm)

The demo stuff is btw nothing somebody else couldn't do. Just compile them for all targets possible. Specially the graph win32 demos needed some small fixes, Florian knows which ones.

Marco van de Voort ( or )

Reply by email

Shane Miller

Question for all:

Using RTTI howdo I set a property value? In my source code for TComponentInterface.SetPropbyName I get the PPropinfo record for the property VISIBLE and I check the Setproc variable. It's nil so I need to call it somehow. I have a TMySetProc type that is a

Procedure (const value) of Object;

In TComponentInterface I have a variable MySetProc of type TMySetProc. I assign MySetProc by....

MySetProc := TMySetProc(SetProc^);

then I call it

MySetProc(Value);

It crashes. Thoughts?
Shane

Reply by email