Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

ÃüÁîģʽ¿ÉÒÔºÜÇáËɵÄʵÏÖ³·Ïú£¨Undo£©¹¦ÄÜ¡£
1. ÃüÁîµÄ½ÓÊÜÕß
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.');
end;

procedure TLight.Open;
begin
Writeln('Light is on.');
end;

end.


2.ÃüÁî¶ÔÏó
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.');
end;

procedure TLight.Open;
begin
Writeln('Light is on.');
end;

end.


 
3.ÃüÁîµÄÇëÇóÕß
unit uSimpleRemoteWithUndo;

interface

uses
uCommandObject;

type
TSimpleRemoteWithUndo = class(TObject)
private
FOnCommand : TCommand;
FOffCommand : TCommand;
FUndoCommand: TCommand;
public
procedure SetCommand(aOnCommand, aOffCommand: TCommand);
procedure OnButtonWasPressed;
procedure OffButtonWasPressed;
procedure UndoButtonWasPressed;
end;

implementation

{ TSimpleRemoteWithUndo }

procedure TSimpleRemoteWithUndo.OffButtonWasPressed;
begin
FOffCommand.Execute;
FUndoCommand := FOffCommand;
end;

procedure TSimpleRemoteWithUndo.OnButtonWasPressed;
begin
FOnCommand.Execute;
FUndoCommand := FOnCommand;
end;

procedure TSimpleRemoteWithUndo.SetCommand(aOnCommand, aOffCommand: TCommand);
begin
FOnCommand := aOnCommand;
FOffCommand := aOffCommand;
end;

procedure TSimpleRemoteWithUndo.UndoButtonWasPressed;
begin
FUndoCommand.Undo;
end;

end.


 
4.¿Í»§¶Ë£¬´´½¨¾ßÌåµÄÃüÁî
program pSimpleRemoteWithUndoTest;

{$APPTYPE CONSOLE}

uses
uSimpleRemoteWithUndo in 'uSimpleRemoteWithUndo.pas',
uCommandObject in 'uCommandObject.pas',
uReceiveObje


Ïà¹ØÎĵµ£º

DelphiͼÏñ´¦Àí

    ±¾ÎÄÊÇ»ùÓÚ¡¶GDI+ÔÚDelphi³ÌÐòµÄÓ¦Óà – PhotoshopÉ«Ïà/±¥ºÍ¶È/Ã÷¶È¹¦ÄÜ¡·Ò»ÎĵÄBASMʵÓÃÐÔ¹ý³Ì£¬ÓйØÊµÏÖÔ­Àí¿É²Î¼û¡¶GDI+ ÔÚDelphi³ÌÐòµÄÓ¦Óà -- ͼÏñ±¥ºÍ¶Èµ÷Õû¡·ºÍ¡¶GDI+ ÔÚDelphi³ÌÐòµÄÓ¦Óà -- ·ÂPhotoshopµÄÃ÷¶Èµ÷Õû¡·£¬´¿PASʵÏÖ´úÂëºÍ²âÊÔÀý×Ó´úÂë¼û¡¶GDI+ÔÚDelphi³ÌÐòµÄÓ¦Óà – Phot ......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

1. ²úÆ·Àà
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·¹¤³§Ä£Ê½Ö®¼òµ¥¹¤³§ }
{ ²úÆ·Àà }
{ ±àÒ빤¾ß £ºDelphi7.0 }
{ ÁªÏµ·½Ê½ £ºxshlife@163.com }

unit uProducts;

interface

type
TPizza = class(TObject)
public
procedure Prepare; virt ......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

Ä£°å·½·¨Ä£Ê½¶¨ÒåÁËÒ»¸öËã·¨¹Ç¼Ü£¬ÔÊÐí×ÓÀà¶ÔËã·¨µÄij¸ö»òijЩ²½Öè½øÐÐÖØÐ´£¨override)¡£
1.CoffeineBeverageWithHook
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Ö®Ä£°å·½·¨Ä£Ê½ }
{ ±àÒ빤¾ß: Delphi7.0 }
{ E-Mail : xshlife@163.com }

unit uCoffeineBeverageWithHook;

interface

uses
SysUti ......

Delphi TIniFile Àà ²Ù×÷iniÅäÖÃÎļþ

Delphi TIniFile Àà ²Ù×÷iniÅäÖÃÎļþ
2007Äê12ÔÂ08ÈÕ ÐÇÆÚÁù 09:56
Ò»¡¢ÓбØÒªÁ˽âINIÎļþµÄ½á¹¹£º
;×¢ÊÍ
[С½ÚÃû]
¹Ø¼ü×Ö=Öµ
...
---- INIÎļþÔÊÐíÓжà¸öС½Ú£¬Ã¿¸öС½ÚÓÖÔÊÐíÓжà¸ö¹Ø¼ü×Ö£¬ “=”ºóÃæÊǸùؼü×ÖµÄÖµ¡£
---- ÖµµÄÀàÐÍÓÐÈýÖÖ£º×Ö·û´®¡¢ÕûÐÍÊýÖµºÍ²¼¶ûÖµ¡£ÆäÖÐ×Ö·û´®´æÖüÔÚINIÎļþÖÐÊ±Ã»Ó ......

Delphi Éè¼ÆÄ£Ê½£º¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Delphi7´úÂë

 1.²ßÂÔÀà
{¡¶HeadFirstÉè¼ÆÄ£Ê½¡·Ö®²ßÂÔģʽ }
{ ±¾µ¥ÔªÖеÄÀàΪ²ßÂÔÀà }
{ ±àÒ빤¾ß: Delphi7.0 }
{ E-Mail : xshlife@163.com }

unit uStrategy;

interface

type
{·ÉÐнӿڣ¬¼°ÆäʵÏÖÀà }

IFlyBehavior = Interface(IInterface)
procedure Fly;
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ