我正在使用一个TMS物体监察员,但假定我的问题在设计时间对Delphi同样有效。
我想有一个能够按方案(在时间)或硬编码(在设计时间)确定的财产。 用户应当看到这一信息,因为信息对他有用,因此,信息在方案操作时间上应当改变,但用户不应通过目标检查员改变。
审判
published property FileName : String read FFileName;
并且财产是显而易见的,但物品检查员也可以改变(如果改变,将读出地址为零0除外)
我正在使用一个TMS物体监察员,但假定我的问题在设计时间对Delphi同样有效。
我想有一个能够按方案(在时间)或硬编码(在设计时间)确定的财产。 用户应当看到这一信息,因为信息对他有用,因此,信息在方案操作时间上应当改变,但用户不应通过目标检查员改变。
审判
published property FileName : String read FFileName;
并且财产是显而易见的,但物品检查员也可以改变(如果改变,将读出地址为零0除外)
这看起来是完全有效和正确的<>只有。 财产
published property FileName : String read FFileName;
如果你增加公共财产,因此在经营期间只能确定:
public property RuntimeFilename: string read FFileName write FFilename;
//note that two properties, one published and one public point to the same field.
However if you want to hack it and get rid of the exception in Design-time
change it to:
//Only writable during runtime.
private
procedure SetFileName(Value: string);
published
property FileName: string read FFileName write SetFileName;
....
procedure TMyClass.SetFileName(Value: string);
begin
if csDesigning in Componentstate then {do nothing}
else FFileName:= Value;
end;
www.un.org/Depts/DGACM/index_spanish.htm 我认为也可以做些什么。
Disconnect between designtime and runtime code
In order to change the runtime behaviour of the code you need only change the source code and remove the write ...
part of the property.
This will not effect the design-time code though, for that you need to reinstall the component.
If you change the source code of a registered component and you keep the changes within the private
, protected
and/or public
sections of the component you are usually OK.
但是,如果您修改了一部分内容的<代码>公布的<>>>,并且你不会再重复这一组成部分,你在开始时会有不正常的行为。
这是因为在设计时间上,你仍在使用该构成部分的老版/译本。 该版本的没有write/code>部分被删除<>/strong>,并允许您修改其背后示意图
。
Come runtime the init-code will read the form resource 1) and spots a value to be written to FFilename. However the procedure SetFilename
is no longer available and therefore a access violation occurs during program startup.
1
最容易的方式:
private
procedure SetFileName(Value: string);
published
property FileName: string read FFileName write SetFileName;
....
procedure TMyClass.SetFileName(Value: string);
begin
FFileName := FFileName;
end;
这显然是泰米尔猛虎人解组织目标检查员的ug子,你应向猛虎人解组织提交一份丑闻。
my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...
Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...
i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...
In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...
What is the equivalent of SetLength using Oxygene? I m trying to size an integer array. var listIndexes: array of integer; begin setLength(listIndexes,5); // doesn t work end;
How can I monitor or visualize memory fragmentation of a delphi application?
I have consistently had IDE problems in Delphi/C++Builder for years, with every version. I usually just reboot, recompile, etc. and move on. However, I keep seeing others say that the IDE is rock ...
I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...