 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jan Lund Guest
|
Posted: Wed Feb 28, 2007 5:54 pm Post subject: Updating Object Inspector Properties |
|
|
Hello.
I am in the progress of making a component that has a property (Response)
that changes its class when another property (ResponseType) changes.
This works fine, however my problem is that when i change the ResponseType,
the Object Inspector is not aware of this, unless i select another component
on the form and then reselect my component.
How do i force the inspector to update its Component properties ?
Thanks
Jan
TJLTCPMessageSender = class(TComponent)
published // a lot of stuff removed....
Property ResponseType : TJLTCPResponsetypes read FResponseType write
SetResponseType;
Property Response : TJLBaseTCPMessageResponse read FResponse write
SetResponse;
end;
// Here we create the response class we want.....
procedure TJLTCPMessageSender.SetResponseType(const Value:
TJLTCPResponsetypes);
begin
FResponseType := Value;
If Response<>Nil Then
Response.Free;
case FResponseType of
trtNotDefined: ;
trtInteger: Response:=TJLTCPMessageIntegerResponse.Create(Self);
trtString: Response:=TJLTCPMessageStringResponse.Create(Self);
end;
If csDesigning in ComponentState Then
*** Maybe we want some "Force Object Inspector Update code here ***
end;
TJLBaseTCPMessageResponse = class(Tpersistent)
private
FOwner : TJLTCPMessageSender;
public
constructor Create(AOwner : TJLTCPMessageSender); Overload;Virtual;
end;
TJLTCPMessageIntegerResponse = class(TJLBaseTCPMessageResponse)
private
FIntResponse: Integer;
procedure SetIntResponse(const Value: Integer);
published
Property IntResponse : Integer read FIntResponse write SetIntResponse;
end;
TJLTCPMessageStringResponse = class(TJLBaseTCPMessageResponse)
private
FStrResponse: String;
procedure SetStrResponse(const Value: String);
published
Property StrResponse : String read FStrResponse write SetStrResponse;
end; |
|
| Back to top |
|
 |
Jan Lund Guest
|
Posted: Thu Mar 01, 2007 9:14 am Post subject: Re: Updating Object Inspector Properties |
|
|
I forgot to say that i am using BDS2006.
"Jan Lund" <no (AT) spam (DOT) plz> wrote in message
news:45e56d84$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello.
I am in the progress of making a component that has a property (Response)
that changes its class when another property (ResponseType) changes.
This works fine, however my problem is that when i change the
ResponseType, the Object Inspector is not aware of this, unless i select
another component on the form and then reselect my component.
How do i force the inspector to update its Component properties ?
Thanks
Jan
TJLTCPMessageSender = class(TComponent)
published // a lot of stuff removed....
Property ResponseType : TJLTCPResponsetypes read FResponseType write
SetResponseType;
Property Response : TJLBaseTCPMessageResponse read FResponse write
SetResponse;
end;
// Here we create the response class we want.....
procedure TJLTCPMessageSender.SetResponseType(const Value:
TJLTCPResponsetypes);
begin
FResponseType := Value;
If Response<>Nil Then
Response.Free;
case FResponseType of
trtNotDefined: ;
trtInteger: Response:=TJLTCPMessageIntegerResponse.Create(Self);
trtString: Response:=TJLTCPMessageStringResponse.Create(Self);
end;
If csDesigning in ComponentState Then
*** Maybe we want some "Force Object Inspector Update code here ***
end;
TJLBaseTCPMessageResponse = class(Tpersistent)
private
FOwner : TJLTCPMessageSender;
public
constructor Create(AOwner : TJLTCPMessageSender); Overload;Virtual;
end;
TJLTCPMessageIntegerResponse = class(TJLBaseTCPMessageResponse)
private
FIntResponse: Integer;
procedure SetIntResponse(const Value: Integer);
published
Property IntResponse : Integer read FIntResponse write SetIntResponse;
end;
TJLTCPMessageStringResponse = class(TJLBaseTCPMessageResponse)
private
FStrResponse: String;
procedure SetStrResponse(const Value: String);
published
Property StrResponse : String read FStrResponse write SetStrResponse;
end;
|
|
|
| Back to top |
|
 |
Erik Berry Guest
|
Posted: Tue Mar 13, 2007 6:19 am Post subject: Re: Updating Object Inspector Properties |
|
|
Jan Lund wrote:
| Quote: | This works fine, however my problem is that when i change the ResponseType,
the Object Inspector is not aware of this, unless i select another component
on the form and then reselect my component.
|
I would try calling IOTAComponent.Select on your component and see if
that forces a refresh.
Erik |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|