本人按照以前别人的贴子写了做了edit,就是多了个Alignment属性,但是编译后会出现一些warning,请大家帮我看看,谢谢啦
Build
[Warning] ComCtrls.pas(8366): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(8385): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13542): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13543): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13564): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13567): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(22122): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(22150): Symbol 'FreeObjectInstance' is deprecated
[Warning] StdCtrls.pas(2412): Symbol 'FreeObjectInstance' is deprecated
[Warning] StdCtrls.pas(2413): Symbol 'FreeObjectInstance' is deprecated
[Warning] Controls.pas(10554): Symbol 'Win32Check' is specific to a platform
[Warning] Controls.pas(10594): Symbol 'Win32Check' is specific to a platform
下面是我的组件的代码:
unit MyEditEx;interface
{$R MYEDITEX.dcr}
uses Messages, Windows, SysUtils, Classes, Controls, Forms, StdCtrls;type
TEditEx = class(TCustomEdit)
private
{ Private declarations }
FAlignment: TAlignment;
protected
{ Protected declarations }
procedure CreateParams(var Params: TCreateParams); override;
procedure Loaded; override;
procedure SetAlignment(Value: TAlignment);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetControlsAlignment: TAlignment; override;
published
{ Published declarations }
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
property Align;
property Anchors;
property BevelEdges;
property BevelInner;
property BevelKind default bkNone;
property BevelOuter;
property BiDiMode;
property BorderStyle;
property Color;
property Constraints;
property Ctl3D;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property HideSelection;
property ImeMode;
property ImeName;
property MaxLength;
property OEMConvert;
property ParentBiDiMode;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Standard', [TEditEx]);
end;constructor TEditEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ParentBackground := False;
end;procedure TEditEx.CreateParams(var Params: TCreateParams);
const
Alignments: array[Boolean, TAlignment] of DWORD =
((ES_LEFT, ES_RIGHT, ES_CENTER),(ES_RIGHT, ES_LEFT, ES_CENTER));
begin
inherited CreateParams(Params);
with Params do
begin
Style := Style or
Alignments[UseRightToLeftAlignment, FAlignment];
end;
end;destructor TEditEx.Destroy();
begin
inherited Destroy();
end;function TEditEx.GetControlsAlignment: TAlignment;
begin
Result := FAlignment;
end;procedure TEditEx.Loaded;
begin
inherited Loaded;
Modified := False;
end;procedure TEditEx.SetAlignment(Value:TAlignment);
begin
if FAlignment <> Value then
begin
FAlignment := Value;
RecreateWnd;
end;
end;end.
Build
[Warning] ComCtrls.pas(8366): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(8385): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13542): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13543): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13564): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(13567): Symbol 'FreeObjectInstance' is deprecated
[Warning] ComCtrls.pas(22122): Symbol 'MakeObjectInstance' is deprecated
[Warning] ComCtrls.pas(22150): Symbol 'FreeObjectInstance' is deprecated
[Warning] StdCtrls.pas(2412): Symbol 'FreeObjectInstance' is deprecated
[Warning] StdCtrls.pas(2413): Symbol 'FreeObjectInstance' is deprecated
[Warning] Controls.pas(10554): Symbol 'Win32Check' is specific to a platform
[Warning] Controls.pas(10594): Symbol 'Win32Check' is specific to a platform
下面是我的组件的代码:
unit MyEditEx;interface
{$R MYEDITEX.dcr}
uses Messages, Windows, SysUtils, Classes, Controls, Forms, StdCtrls;type
TEditEx = class(TCustomEdit)
private
{ Private declarations }
FAlignment: TAlignment;
protected
{ Protected declarations }
procedure CreateParams(var Params: TCreateParams); override;
procedure Loaded; override;
procedure SetAlignment(Value: TAlignment);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetControlsAlignment: TAlignment; override;
published
{ Published declarations }
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
property Align;
property Anchors;
property BevelEdges;
property BevelInner;
property BevelKind default bkNone;
property BevelOuter;
property BiDiMode;
property BorderStyle;
property Color;
property Constraints;
property Ctl3D;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property HideSelection;
property ImeMode;
property ImeName;
property MaxLength;
property OEMConvert;
property ParentBiDiMode;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Standard', [TEditEx]);
end;constructor TEditEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ParentBackground := False;
end;procedure TEditEx.CreateParams(var Params: TCreateParams);
const
Alignments: array[Boolean, TAlignment] of DWORD =
((ES_LEFT, ES_RIGHT, ES_CENTER),(ES_RIGHT, ES_LEFT, ES_CENTER));
begin
inherited CreateParams(Params);
with Params do
begin
Style := Style or
Alignments[UseRightToLeftAlignment, FAlignment];
end;
end;destructor TEditEx.Destroy();
begin
inherited Destroy();
end;function TEditEx.GetControlsAlignment: TAlignment;
begin
Result := FAlignment;
end;procedure TEditEx.Loaded;
begin
inherited Loaded;
Modified := False;
end;procedure TEditEx.SetAlignment(Value:TAlignment);
begin
if FAlignment <> Value then
begin
FAlignment := Value;
RecreateWnd;
end;
end;end.
解决方案 »
- 双击文件得到它的路径
- 实现上传PDF文件并显示出来。并保存到服务器。
- 我想创建一个文件,请问应该怎么做,需要标准的答案哈,在线等………………!!
- 请建DELPHI三层数据库讨论群,大家顶一下呀。
- 请高手根据下面的要求给个算法,100分送上
- 请问:为什么 bmp.savetofile('a.bmp');后文件大小是零呢?
- Delphi5 的ReportBuilder的版本不同的问题,Help me!!!!!!!
- 激情送分:恳望得到帮助,有关ftp下载上传整个目录包括其中文件的问题。
- 怎么使双击窗体标题栏时窗体大小不能改变?
- 关于TADTField和TArrayField两个类型字段对象
- DElPHI中使用MessageBox显示时显示信息在最前面
- 寻XP风格界面的例程。
是在哪里?dpr里还是窗体里
能再详细说明下这个warning的涵义吗?
谢谢啦
unit Unit1;interfaceuses
......................
这里表示StdCtrls单元的第2413行的函数FreeObjectInstance是一个过时或仅仅是向后兼容的函数[Warning] Controls.pas(10554): Symbol 'Win32Check' is specific to a platform
而这里表示Ctontrols单元的第10554行的函数Win32Check仅仅是使用于特定平台的----注意使用platform和library的时候是不指定具体平台和库结构的,仅仅是个提示作用对于这样的提示不是在任何情况下都显示的,必须在编译开关 {$HINTS ON} 或{$WARNINGS ON} 的情况下才会显示,所以为了避免显示只要关闭OK了....