ȨÏÞ¿ØÖÆ(delphi TActionList·½°¸)
ÔÚÈí¼þ¿ª·¢ÖУ¬ÎªÈí¼þ¼ÓÈëȨÏÞ¿ØÖƹ¦ÄÜ£¬Ê¹²»Í¬µÄÓû§Óв»Í¬µÄʹÓÃȨÏÞ£¬ÊǷdz£ÖØÒªµÄÒ»ÏÄÜ£¬
ÓÉÆäÔÚ¿ª·¢Êý¾Ý¿â·½ÃæµÄÓ¦Óã¬ÕâÏÄܸüÎªÖØÒª¡£
µ«ÊÇ£¬ÒªÎªÒ»¸öÓ¦ÓüÓÈëÈ«ÃæµÄȨÏÞ¿ØÖƹ¦ÄÜ£¬ÓÖÔõÑùʵÏÖÄØ£¿
´ó¼ÒÖªµÀ£¬ÏÖÔÚµÄÓ¦Óã¬Ò»°ã¾ùÒԲ˵¥·ÃÎʹ¦ÄܵÄÐÎʽ³öÏÖ£¬°´ÕÕ³£¹æµÄ×ö·¨£¬
Ö»ÒªÈÃ×¢²á½øÈëÓ¦ÓõIJ»Í¬Óû§£¬¿ÉÒÔ·ÃÎʲ»Í¬µÄ¹¦Äܲ˵¥£¬´Ó¶øÊµÏÖ¹¦ÄÜȨÏ޵ĿØÖÆ£¬
µ«ÊÇ£¬ÓÐÕâÑùÒ»¸öÎÊÌ⣬´ËÖÖ·½·¨±ãÎÞÄÜΪÁ¦£¬ÏÖÔÚµÄÓ¦ÓÃÈí¼þ£¬ÎªÁËÌá¸ßÈí¼þµÄÒײÙ×÷ÐÔ£¬
ͬһ¹¦ÄÜ¿ÉÄÜÓжàÖÖ²»Í¬µÄ·ÃÎÊ·½Ê½£¬È繤¾ßÌõ£¬ÓÒ¼ü²Ëµ¥µÈ£»
ͬÑù£¬Í¬Ò»¸ö¹¦ÄÜ£¬Ò²¿ÉÄÜÔÚÈí¼þµÄ²»Í¬µØ·½±»µ÷Ó㬶ø²»½ö½ö±»ÏÞÖÆÎªÓóÌÐòµÄÖ÷²Ëµ¥À´µ÷Óã¬
ÕâÑù£¬²ÅÄܱ£Ö¤Ó¦ÓõÄÒ×ÓÃÐÔ¡£
дµ½Õ⣬ÎÊÌâÒѾ·Ç³£Çå³þ£¬¶ÔÓÚÒªÏÞÖÆµÄÈí¼þ¹¦ÄÜ£¬½öͨ¹ýÒ»´Î´úÂëÉè¼Æ£¬
ÎÞÂÛÔÚÕû¸öÓ¦ÓõÄÈκεط½»òͨ¹ýºÎÖÖÐÎʽµ÷Óô˹¦ÄÜ£¬¶¼Äܱ»¹¦ÄÜȨÏÞËùÏÞÖÆ¡£
±ÊÕßÀûÓÃDelphiƽ̨×÷Ó¦Óÿª·¢Ê±£¬Í¨¹ýDelphi7ÌṩµÄVCL¿Ø¼þ½â¾öÁËÕâÒ»ÎÊÌâ¡£
ÔÚÁ˽âÈçºÎʵÏÖ¹¦ÄÜȨÏÞ¿ØÖÆÖ®Ç°£¬µÃÏÈ¿´Ò»ÏÂDelphi7ÌṩµÄпؼþTActionList£¬
ͨ¹ýTActionList,Ó¦ÓóÌÐò¿ÉÒÔͳһ¹ÜÀíÆäTAction,ÕâÀïµÄAction,¿ÉÒ ......
ÈçºÎ´ÓÒ»ÕÅͼƬÖвüôÒ»²¿·Ö¾àÐÎͼƬÁí´æÎªÎļþ?
ÐèÒªÒ»¶ÎʵÏֵŦÄܵĴúÂë
procedure TForm1.Button1Click(Sender: TObject);
var
SrcBmp, DestBmp: TBitmap;
begin
SrcBmp := TBitmap.Create;
SrcBmp.LoadfromFile('C:\Source.bmp');
DestBmp := TBitmap.Create;
DestBmp.Width := 100;
DestBmp.Height := 100;
DestBmp.Canvas.CopyRect(Rect(0, 0, 100, 100), SrcBmp.Canvas, Rect(50, 50, 150, 150)); {ÒªÓë¸ø³öµÄλͼ´óС±£³ÖÒ»Ö±±ÜÃâѹËõ}
DestBmp.SaveToFile('C:\Dest.bmp');
&nb ......
absolute
//ËüʹµÃÄãÄܹ»´´½¨Ò»¸öбäÁ¿, ²¢ÇҸñäÁ¿µÄÆðʼµØÖ·ÓëÁíÒ»¸ö±äÁ¿Ïàͬ.
var
Str: string[32];
StrLen: Byte absolute Str;
//Õâ¸öÉùÃ÷Ö¸¶¨Á˱äÁ¿StrLenÆðʼµØÖ·ÓëStrÏàͬ.
//ÓÉÓÚ×Ö·û´®µÄµÚ0¸öλÖñ£´æÁË×Ö·û´®µÄ³¤¶È, ËùÒÔStrLenµÄÖµ¼´×Ö·û´®³¤¶È.
begin
Str := 'abc';
Edit1.Text := IntToStr(StrLen);
end;
abstract
//ËüÔÊÐíÄã´´½¨³éÏóµÄ·½·¨, °üÀ¨ÓгéÏó·½·¨µÄÀà³ÆÎª³éÏóÀà.
//Abstract¹Ø¼ü×Ö±ØÐëÓëVirtual»òDynamic¹Ø¼ü×ÖͬʱʹÓÃ, ÒòΪ³éÏó·½·¨±ØÐë±»¸²¸ÇʽʵÏÖ.
//³éÏóÀ಻ÄÜʵÀý»¯, ³éÏó·½·¨²»Äܰüº¬·½·¨Ìå.
type
TDemo = class
private
protected
procedure X; virtual; abstract;
public
constructor Create;
destructor Destroy; override;
published
end;
and
//Ò»¡¢±íʾÂß¼Óë
if (a>0) and (b>0) then
//¶þ¡¢±íʾλÔËËã
var
a,b,c: Integer;
begin
c := (a and b);
end;
//ʹÓÃAnd±íʾÂ߼ʱ, And×óÓҵıí´ïʽ±ØÐëÓÃСÀ¨ºÅÀ¨Æð, ÒÔ±ÜÃâÒÔÉúÌõ¼þµÄ³åÍ».
//ÀýÈç:
if a>0 and b>0 then
//±àÒëÆ÷¿ÉÄÜ»áÀí½âΪ:
if a>(0 and b)>0 then ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,MSHTML, SHDOCVW,IdGlobal;
type
TMainFrm = class(TForm)
btnTest: TButton;
edURL: TEdit;
Label1: TLabel;
procedure btnTestClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainFrm: TMainFrm;
implementation
{$R *.dfm}
procedure FillIEForm(aURL:string);
procedure DoWithHtmlElement(aElementCollection:IHTMLElementCollection);
var
k:integer;
vk:oleVariant;
Dispatch: IDispatch;
HTMLInputElement:IHTMLInputElement;
HTMLSelectElement:IHTMLSelectElement;
HTMLOptionElement: IHTMLOptionElement;
HTMLText ......
ControlState ÊôÐÔ
¶ÔÓ¦¶ÔÏó£ºTControl
ÉùÃ÷£ºTControlState = set of (csLButtonDown, csClicked, csPalette, csReadingState, csAlignmentNeeded, csFocusing, csCreating);
property ControlState: TControlState;
¹¦ÄÜ£ºControlStateÊôÐÔÓÃÀ´²éѯ¿Ø¼þÔËÐÐʱµÄ״̬¡£
ControlStateÊôÐÔÓÃÀ´Ö¸Ã÷ÔËÐеÄÿһ¸öʱ¿Ì¿Ø¼þµÄ״̬¡£ÊôÐÔÊôÓÚTControlStateÀàÐÍ£¬Õâ¸öÀàÐÍÊÇÒ»¸ö±êÖ¾¼¯£¬Ëü¿ÉÒÔ±»ÉèÖóÉΪÒÔÏÂÖµµÄ×éºÏÐÎʽ¡£
Öµ / Òâ Òå
csLButtonDown / µã»÷Êó±êµÄ×ó°´Å¥²»·Å£¬Õâ¸öÊÇΪËùÓеÄÊó±ê°´ÏÂʼþÉèÖõġ£
csClicked / ºÍcsLButtonDownÒ»Ñù£¬Ö»ÊÇÔÚControlStyleÊôÐÔ°üº¬csClickEvents±ê־ʱËü²Å±»ÉèÖã¬ÒÔ˵Ã÷Êó±ê°´ÏÂʱµÄʼþ¡£
csPalette / ˵Ã÷Ò»¸öWM_PALETTCHANGEDÐÅÏ¢±»¿Ø¼þ½ÓÊÜ»òÕß±»¿Ø¼þµÄ¸¸Àà½ÓÊÜ¡£
csReadingState / ¿Ø¼þÕýÔÚ´ÓÒ»¸öÁ÷ÖжÁÈ¡ËüµÄ״̬¡£
csAlignmentNeeded / µ±¶ÓÁÐÔٴα»ÔÊÐíʱ¿Ø¼þÐèÒªÖØÐÂÅÅÁÐËü×Ô¼º¡£
csFocusing / Ó¦ÓóÌÐò¹ý³Ì½¹µãË͸ø¿Ø¼þ¡£Õâ²»Äܱ£Ö¤¿Ø¼þ¾Í½«ÊÕµ½½¹µã£¬µ«ÊÇ·ÀÖ¹Á˵ݹéµÄµ÷Óá£
csPaintCopy / ¿Ø¼þ±»¸´ÖÆ£¬Òâζ×ſؼþµÄ¿½±´±»´òÓ¡£¬¿ØÖÆ·ç¸ñ±ê¼ÇcsReplicatable±ØÐë±»ÉèÖÃΪ¸Ã״̬µÄ·¢Éú¡£
csCreati ......
ת×Ô£ºhttp://hi.baidu.com/dragonmen2008/blog/item/0dd079dc026895d08c10294b.html
ͼÎIJ¢Ã¯:delphi ±àдÄãµÄcom³ÌÐò
DELPHI²Ëµ¥:
File\New\Other…
°´È·¶¨[ok]°´Å¥
µã»÷File\Save²Ëµ¥±£´æ:
ÊäÈ빤³ÌÃûMyCOM,°´±£´æ°´Å¥
ÔÙ´ò¿ª²Ëµ¥File\New\Other…
°´[OK}°´Å¥
ÔÚCoClassName´òÈëMyObject£¬°´OK
ÔÚIMyObjectÉϰ´MOUSEÓÒ¼ü£¬ImyObject\New\Method¡£
ÔÚName´¦ÊäÈëTest
Çл»µ½ParametersÒ³´Î£¬°´AddÁ½Ï£¬½«µÚÒ»¸öParametersµÄName¸Ä³ÉPsParam1, Type´òÈëBSTR£¬½«µÚ¶þ¸öParametersµÄName¸Ä³ÉPsResult, Type´òÈëBSTR*£¬½«MOUSEµãµ½µÚ¶þ¸öParametersµÄModifier×ֶ䦣¬°´ “…” °´¼ü¡£
½«RetVal´ò¹´£¬°´OK
(ÔÀ´µÄ[in]±ä³ÉÁË[out,retval], ±íʾÕâ¸öÊÇÒª»Ø´«µÄ, ÆäÐÍ̬Ϊ×Ö·û´®)£¬¹ØµôÕâ¸ö´°¿Ú¡£
(Äã»á¿´µ½Ëü°ïÄ㽨ºÃÁËCODEµÄÄ£ÐÍ)¡£
File\Save£¬ÊäÈëÎļþÃûMyObject£¬°´±£´æ¡£
¸ÄÒ»ÏÂCODE£¬°´Ò»ÏÂCtrl+S±£´æ£¬P ......