Delphi components and attribute editing

zhaozj2021-02-17  52

Delphi components and attribute editing

(A) Password This will describe the component development and attribute editor with an example of an example. An example (TDSWAITDIALOGEX) is a visual component that displays a Dialog after which it is called, which contains a TANIMATE, two prompt information (ie TLabel), a TGAGE. ? Enumeration Properties: DialogStyle, Aviposition? Record Properties: Options? Property Set Object Inheritance from TPERSIStent, this example Avisource property set Contains TANIMATE Movie Attributes CommONAVI, FileName? Properties editor application with avisource's filename properties, ie String FileName When editing, a TopEndialog pops up, it filter Filter is * .avi

(2) Component package DSDLGPACK.DPK For easy release, installation, etc., to use the component package .dpk. ? In the version after Delphi6 (I don't know how D5 previous version), there are several files Delphi not release, such as Proxies. If you use these files when you install the components, you can bypass these files and use the package containing these files. • This Category Property editor uses the Designeditors file, and the Proxies file is required in Designeditors, so in the package (.dpk) containing this component (.dpk) contains Designide, solve the problem that Proxies does not exist, so that the component will succeed? ?? Package DSDLGPACK; ??? ... ??? Requires ????? rs, ????? vclsmp, ????? design; ??????? ??? Contains ????? DSDLGWAITEX IN 'DSDLGWAITEX}, ????? DSDLGWAITEXREG IN' DSDLGWAITEXREG.PAS '; ??? end. (3) Component Registration file DSDLGWAITEXREG.PAS Q: Why do you want to use this? A file? Because: If the code in DSDLGWaItemXREG.PAS is merged into dsdlgwaitex.pas, although the DSDLGPACK.DPK contains DesignIDe to solve the problem that Proxies does not exist when the installation component is set, it still outstributed PROXIES when the application calls this component. Problem, because the Proxies file is required in DesignedIster; therefore, the code is simply forming a file separately, and the application calls this component does not require DSDLGWAITEXREG.PAS, which can bypass the Proxies does not have problems.

??? unit dsDlgWaitExReg; ??? interface ??? uses Classes, Dialogs, Forms, dsDlgWaitEx, DesignIntf, DesignEditors; ??? type ????? TdsAVIFileNameProperty = class (TStringProperty) // property editor to use DesignEditors File ????? public ??????? function getttributes: tpropertyattributes; override; // method overwrites ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????? Method coverage ????? end; ??? procedure register; ??? impiCedation ??? procedure register; ??? begin ???? ? // Register this component to the Delisoft component page ????? registercomponents ('Delisoft', [TDSWAITDIALOGEX]); ????? // Register this property editor ???? registerpropertyEditor (TypeInfo (String), TdsAVISource, 'FileName', TdsAVIFileNameProperty); ??? end; ??? {TdsAVIFileNameProperty} ??? function TdsAVIFileNameProperty.GetAttributes: TPropertyAttributes; ??? begin ????? result: = [paDialog]; ??? end ; ??? procedure tdsavifilenameproperty.EDIT; ??? begin ????? with topndialog.create (application) do ????? Try ??????? filter: = 'avi files (*. avi) | * .avi | All files (*. *) | *. * '; ?????? ife (filename); ????? Finally ??????? free; ????? end; ??? end; ??? end. (4) component file DSDLGWAITEX.PAS ??? Unit DSDLGWaitex; {Define all properties, methods of this component; The property borderstyle of the form TDLGWaitex is BSDIALOG, this component component TDSDLGWaitex uses the form TDLGWaitex; attribute object Avisource used tdsavisource, which inherited directly from TPERSIStent, and used enumeration properties (DialogStyle, Aviposition) and record properties ( Options, etc. }

??? interface

??? Uses ????? Windows, Messages, Sysutils, Variants, Classes, Graphics, Controls, Forms, ???? Dialogs, Stdctrls, Gauges, Comctrls

??? Type ????? tdialogstyle = (DLGNORMAL, DLGSTAYONTOP); ????? TaviPosition = (avileft, avitop, avibottom); ????? TDLGOPTIONS =? set of (showavi, showcaption, showMessage1, showMessage2 , ShowProgress, ShowProgressText;

????? TDLGWAITEX = Class (TFORM) ??????? Animate1: Tanimate; ??????? Gauge1: Tgauge; ??????? Label1: TLABEL; ?????? Label2: TLABEL; ??????? procedure formclose (sender: Tobject; var action: tclosection); ????? private ??????????????????????????? ????????????????????????????????????? fcloseafter: DWORD;?? ????? FUserFormClose: TCloseEvent; ????? public ??????? property UserFormClose: TCloseEvent read FUserFormClose write FUserFormClose; ??????? property CloseAfter: DWORD read FCloseAfter write FCloseAfter; ??? ?? End; ????? tdsavisource = class (tpersistent) ????? private ??????? fcommonavi: Tcommonavi; ??????? ffilename: string; ??????? Procedure setcommonavi (const value: tcommonavi); ??????? Procedure setFileName (const value: string); ????? protected ????? public ????? public ??????? Property Commonavi: Tcommonavi Read FCOMMONAVI WRITE SETCOMMONAVI DEFAULT AVINONED; ??????? Property FileName: String Read FFileName Write setFileName; ?????

????? tdswaitdialogex = class (tcomponent) ????? private ???????? form ??????? fdlgform: TDLGWAITEX; ??????? fmessage1: string ;? ?????? fmessage2: string; ??????? fMessage1Font: tfont; ??????? fMessage2Font: tfont; ??????? fcaption: string; ??????? FDISLOGSTYLE: TDIALOGSTYLE; ??????? fwordwrap: boolean; ??????? FOPTIONS: TDLGOPTION; ??????? fshowMessage1, fshowMessage2: boolean;

????????? avi ??????? faviposition: TAVIPSITION; ??????? faviactive: boolean; ??????? fshowavi: boolean; ??????? Favisource: tdsavisource;

?????????????????? fprogressmax: integer; ??????? fprogressmin: integer; ??????? fprogresspos: integer; ??????? FPROGRESSTEP: INTEGER; ??????? fshowprogress: boolean; ??????? fshowprogressText: boolean

????????????????? fonposchange: TNOTIFYEVENT; ??????? fonshow: tNotifyEvent; ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? procedure SetProgressMax (const Value: integer); ??????? procedure SetProgressMin (const Value: integer); ??????? procedure SetProgressPos (const Value: integer); ??????? procedure SetProgressStep Const Value: integer;

??????? procedure drawform; ??????? function setLableHeight (SCAPTION: STRING): Integer; ??????? Procedure SetOptions (Const value: TDLGOPTION); ??????? Procedure setMessage1 (const value: string); ??????? Procedure setMessage2 (Const value: string); ??????? procedure setcaption (const value: string); ??????? Procedure setMessage1Font (const value: tfont); ??????? Procedure setMessage2Font (const value: tfont); ??????? function isments ,; boolean; ??????? function isments, 2FontStored: boolean

??????? Procedure setAviposition (const value: taviPosition); ??????? procedure setavisource (const value: tdsavisource);

??????? procedure setonformhide (const value: tcloseeent); ????? protected ??????? procedure doposchange; virtual; ??????? procedure doshow; virtual

????? public ??????? constructor create (aowner: tcomponent); OVERRIDE; ??????? destructor destroy; Override; ??????? procedure? FormShow; ?????? ??? procedure? FormHide; ??????? procedure? formupdate; ??????? procedure? progressstepit; ????? public, ?????? // Form ????? ?? property Message1: string read FMessage1 write setMessage1; ??????? property Message2: string read FMessage2 write setMessage2; ??????? property Message1Font: TFont read FMessage1Font write SetMessage1Font stored IsMessage1FontStored; ????? ?? property Message2Font: TFont read FMessage2Font write SetMessage2Font stored IsMessage2FontStored; ??????? property Caption: string read FCaption write setCaption; ??????? property DislogStyle: TDialogStyle read FDislogStyle write FDislogStyle; ????? ?? property wordWrap: boolean read FwordWrap write FwordWrap; ??????? property Options: TDlgOptions read FOptions write setOptions; ??????? // AVI ??????? property AviActive: boolean read FAviActive Write faviactive; ??????? Property Aviposition: TAVIPO SITION read Faviposition Write SetAviposition; ??????? Property Avisource: Tdsavisource Read Favisource Write setaviSource

????????????????? PrOPERTY ProgressMax: Integer Read FPRESSMAX? WRITE SETPROGRESSMAX; ??????? Property Progressmin: Integer Read FProgressmin? Write setProgressmin; ?????? ? Property ProgressPos: Integer Read FPRESSPOS? WRITE SETPROGRESSPOS? WRITE SETPROGRESSPOS; ??????? Property ProgressStep: INTEGER ReadProgressStep;

????????????????? Property ONPOSCHANGE: TNOTIFYEVENT READ FONPOSCHANGE WRITE FONPOSCHANGE; ??????? Property OnShow: TNOTIFYEVENT READ FONSHOW WRITE FONSHOW; ???????property OnHide: TcloseEvent Read FonformHide Write setonFormHide; ?????

??? IMPLEMENTATION ??? {$ r * .dfm} ??? {tdsavisource} ??? procedure tdsavisource.setcommonavi (const value: tcommonavi); ??? begin ????? ife = fcommonavi kiln ????? fcommonavi: = value; ????? ffilename: = ''; ??? End; ??? procedure tdsavisource.setFileName (const value: string); ??? begin ????? Value = ffilename dam; ????? ffilename: = value; ????? fcommonavi: = Avinone; ??? End; ??? {tdswaitdialogex} ??? procedure tdswaitdialogex.doshow; ??? begin? ???? i i e; ??? end; ??? procedure tdswaitdialogex.doposchange; ??? begin ????? if Assigned (fonposchange) THEN FONPOSCHANGE (Self); ?? ? End; ??? procedure tdswaitdialogex.setavisource (const value: tdsavisource); ??? begin ????? if favisource = value dam; ????? favisource.assign (value); ????? IF (favisource.ffilename = ') and (favisource.fcommonavi = avinone) THEN fshowavi: = false; ????? fssigned (fdlgform) THEN ????? begin ??????? fdlgform.animate11 .Act: = false; ??????? fdlgform.animate1.filename: = ''; ??????? fdlgf Orm.animate1.commonavi: = Avinone; ??????? if fshowavi the ??????? begin ????????? ife ?????? = 'THEN ?????? ????? fdlgform.animate1.commonavi: = favisource.fcommonavi ????????? Else ??????????? fdlgform.animate1.FileName: = Favisource.ffilename;??? ?????? fdlgform.animate1.active: = true; ??????? end; ??????? DrawForm ;? // animate1-> AVI change, may cause an ANIMATE1 size change = => DRAWFORM ??????? fdlgform.Update; ????? end; ??? end; ??? function tdswaitdialogex.IsMessage1FontStored: boolean; ??? begin ?????????? ????? result: = ????????? (Name <> MS SANS SERIF ') or ????????? (Style <>

[]) OR ????????? (SIZE <> 8) or ????????? (CHARSET <> default_charset) ) OR ????????? (PITCH <> fpdefault); ??? End; ??? function tdswaitdialogex.isMessage2FontStored: boolean; ??? begin ????? with fMessage2Font Do ????? ?? Result: = ????????? (Name <> MS SANS Serif ') or ????????? (Style <> []) or ???????? ? (SIZE <> 8) or ????????? (color <> CLWindowText) or ????????? (CHARSET <> Default_Charset) or ???????? ( Pitch <> fpdefault; ??? End; ??? procedure tdswaitdialogex.setMessage: tfont); ??? begin ????? fMessage1Font.assign (value); ????? if Assigned (fdlgform ) THEN ????? begin ??????? fdlgform.label1.Font.Assign (value); ??????? fdlgform.Update; ????? end; ??? end;? ?? Procedure tdswaitdialogex.setMessage2Font (const value: tfont); ??? begin ????? fMessage2Font.Assign (value); ????? if Assigned (fdlgform) THEN ???? begin ???? ??? font.assign (value); ??????? fdlgform.Update; ????? End; ??? end; ??? procedure tdswaitdialoGex.setcaption (const value: string ); ??? begin ????? if value = fcaption kil in; ????? fcaption: = value; ????? if not (showcaption in favorions) THEN ????? begin ??? ???? fcaption: = ''; ??????? EXIT; ????? end; ????? if Assigned (fdlgform) THEN ????? begin ??????? FDLGFORM.CAPTION: = value; ??????? fdlgform.Update; ????? End; ??? End; ??? procedure tdswaitdialogex.setMessage11 (Const value: string); ??? var i: Integer; ??? begin ????? if value = fMessage1 the exit; ????? fMessage1: = value; ????? if Assigned (fdlgform) Then ????? begin ????? ?? IF not (showMessage1 in favorions) THEN EXIT; ??????? fdlgform.label1.caption: = value; ??????? i: = setlableheight (fMessage1) 13; ????? ?? IF i <>

FDLGFORM.LABEL1.HEIGHT THEN DRABEL1.HEIGHT THEN DRABELM; ??????? fdlgform.Update; ????? End; ??? End; ??? procedure tdswaitdialogex.setMessage2 (Const value: string); ??? Var i : Integer; ??? begin ????? if value = fMessage2 Then exit; ????? fMessage2: = value; ????? if Assigned (fdlgform) THEN ???? begin ???? ??? IF not (showMessage2 in favorions "" ??????? fdlgform.label2.caption: = value; ??????? i: = setLableHeight (fMessage2) 13; ???? ??? IF i <> fdlgform.label2.Height Ten Drawform; ??????? fdlgform.Update; ????? End; ??? End; ??? Procedure TdswaitDialoGex.SetOptions (Const value: TDLGOPTIONS ); ??? var dodrawform: boolean; ??? begin ????? if FOPTIONS = VALUE THEN EXIT; ????? dodrawform: = false; ????? if not ((Showavi in ​​value) and (showform: = true; ????? = true; if not (showProgress in value) THEN DODRAWFORM: = true; ??? ?? if not dodrawform the ????? if not (ShowMessage1 in value) THEN DODRAWFORM: = true; ????? if not do Dodrawform Then? ???? if not (showMessage2 in value) THEN DODRAWFORM: = true; ????? FOPTIONS: = value; ??????? = value; showcaption in favorions the FCaption: = ''; ??????? if showAVI in FOptions then FshowAVI: = true else FshowAVI: = false; ??????? if showMessage1 in FOptions then FShowMessage1: = true else FShowMessage1: = false; ??????? if showMessage2 in FOptions then FShowMessage2: = true else FShowMessage2: = false; ??????? if showProgress in FOptions then FShowProgress: = true else FShowProgress: = false; ?????? • IF showProgressText in FOPTIONS TENFSHOWPROGRESSTEXT: = true else fshowprogressText: = false;

????? if assigned (fdlgform) THEN ????? begin ??????? ife; ??????? if showcaption in FOPTIONS THEN FDLGMM.CAPTION: = FcAption Else FDLGFORM .Caption: = ''; ??????? if showprogresstext in foptions the fdlgform.gauge1.showText: = true else fdlgform.gauge1.showtext: = false; ??????? fdlgform.update; ?? ??? End; ??? End; ??? procedure tdswaitdialogex.setaviposition (const value: taviPosition); ??? begin ????? if Faviposition = value feviposition: = value; ????? if assigned (fdlgform) THEN ????? begin ??????? drawform; ??????? fdlgform.Update; ????? end; ??? end;? ?? procedure tdswaitdialogex.formhide; ??? begin ????? if not assigned (fdlgform) THEN EXIT; ????? fdlgform.close; ????? fdlgform.position: = podesktopcenter; ??? End ; ??? constructor tdswaitdialogex.create (Aowner: tcomponent); ??? begin ????? inherited create (aowner); ????? // Form ??????? fcaption: = 'is processing Medium ... '; ??????? fMessage1: =' processing information 1 '; ??????? fimentage2: =' processing information 2 '; ??????? fdislogstyle: = DLGSTAYONTOP; ??????? fwordwrap: = T Rue; ??????? fShowMessage1: = true; fShowMessage2: = true; ??????? FOPTIONS: = [ShowAvi, Showcaption, ShowMessage1, ShowMessage2, ShowProgress, ShowProgressText]; ??????? FMessage1Font: = TFONT.CREATE; ??????? with fMessage1Font Do ??????? begin ????????? fMessage1Font.Charset: = GB2312_CHARSET; ????????? Name: = 'Song Body'; ????????? size: = 9; ??????? End; ??????? fmessage2Font: = tfont.create; ?????? ? with fMessage2font do ??????? begin ????????? fMessage2Font.Charset: = GB2312_CHARSET; ?????????? Name: = 'Song Body'; ?????? ??? size: = 9; ??????? end; ??????? fshowprogress: = true; ??????? fshowprogressText: = true;

??????? fprogressmax: = 100; ??????? fprogressmin: = 0; ??????? fprogresspos: = 0; ??????? fprogressstep: = 10; ?? ???? = true; ??????? fshowavi: = true; ??????? faviposition: = avitop; ??????? favisource : = Tdsavisource.create; ??????? favisource.fcommonavi: = avicopyfile; ??????? favisource.ffilename: = ''; ??? End; ??? destructor tdswaitdialogex.destroy; ???? ? begin ????? try ??????? fMessage1Font.Free; ??????? fMessage2Font.Free; ??????? Favisource.Free; ??????? if Assigned (Fdlgform) THEN ??????? begin ????????? fdlgform.close; ?????????freeandnil (fdlgform); ??????? end; ??? ??? EXCEPT ????? End; ????? inherited destroy; ??? end; ??? procedure tdswaitdialogex.formshow; ??? begin ?????i assigned; ????? if Assigned (Fdlgform) THEN DOSHOW; ??? end; ??? function tdswaitdialogex.setLableHeight (Scaption: string): integer; ??? var i, iMax: integer; ??? begin ????? result: = 0; ????? ife: = 48 else imax: = 56; ????? i: = length (scaption) -Imax; // 56 ;? //> 1 line ??? 48? ???? IF i <= 0 THEN EXIT; ????? IF ( I mod 56)> 0 THEN ??????? Result: = (i Div 56 1) * 13 ????? Else ??????? result: = (I Div 56) * 13; ?????????? procedure tdswaitdialogex.drawform; ??? var h, ah: integer; ??? begin ????? if not assigned (fdlgform) Then EXIT; ????? case faviposition of? ???? Avitop: ??????? begin ????????? fdlgform.label1.height: = 13 setLableHeight (fdlgform.label1.caption); ????????? FDLGMM.Label2.height: = 13 setLableHeight (fdlgform.label2.caption); ????????????????????? fdlgform. Width: = 356; ?????? fdlgform.animate1.top: = 3; ???? ????????? fdlgform.gauge1.LGT?: = 14; ?? fdlgform.gauge1.width : = 320; ????????? fdlgform.Label1.Left?: = 9;

?? fdlgform.label1.width: = 340; ????????? fdlgform.label2.LGM.Label2.Width: = 340; ?????????????????????????????????????????????????????? FDLGFORM.ANIMATE1.LGT: = (fdlgform.width Div 2) - (fdlgform.animate1.width div 2); // animate1 home ????????? fdlgform.label1.top ??: = 3 fdlgform .Animate1.height 8; ????????? fdlgform.label2.top ??: = fdlgform.label1.top fdlgform.label1.Height 4; ????????? fdlgform. Gauge1.top ??: = fdlgform.label2.top fdlgform.Label2.Height 6; ????????? fdlgform.height: = 27 3 fdlgform.animate1.height ?????? ???????????????????? 8 fdlgform.label1.height ?????????????? ?? 4 fdlgform.label2.height ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? h ????? if not fshowavi the ????????? begin ??????????? fdlgform.Label1.top: = fdlgform.label1.top - fdlgform.animate1.height;? ?????????? fdlgform.Label2.top: = fdlgform.label2.top - fdlgform.animate1.height; ??????????? fdlgform.gauge1.top: = fdlgorm.gauge1 .Top - fdlgform.animate1.height; ??????????? fdlgform.height: = fdlgfo RM.HEIGHT -? fdlgform.animate1.height; ????????? end; ????????? f not fshowMessage1 Then ???????? begin ????? ?????? fdlgform.label2.top: = fdlgform.label2.top - fdlgform.Label1.Height - 4; ??????????? fdlgform.gauge1.top: = fdlgform.gauge1.top - fdlgform.label1.Height - 4; ??????????? fdlgform.height: = fdlgform.height - fdlgform.label1.height - 4; ????????? end; ?? ??????? if not fshowMessage2 Then ????????? begin ??????????? fdlgform.gauge1.top: = fdlgform.gauge1.top - fdlgform.label2.height - 4; ??????????? fdlgform.height: = fdlgform.height - fdlgform.label2.Height - 4; ?????????

????????? if not fshowprogress the ????????? begin ??????????? fdlgform.height: = fdlgform.height -? fdlgform.gauge1.height- 6; ????????? end; ???????? End; ????? Avileft: ??????? begin ????????? fdlgform.label1. Height: = 13 setLableHeight (fdlgform.label1.caption); ????????? fdlgform.label2.height: = 13 setLableHeight (fdlgform.label2.caption); ????????? FDLGMM.Label1.Width: = 288; fdlgform.label2.width: = 288; ????????? fdlgform.Label1.Lab: = 12 fdlgform.animate1.width; ??????? ?? fdlgform.label2.left?: = Fdlgform.Label1.Left; ????????? fdlgform.Label1.top ??: = 11; ????????? fdlgform.label2.top ??: = 11 fdlgform.label1.height 4; ????????? fdlgform.gauge1.LGM.: = 16; ????????? fdlgform.animate1.left: = 6 ; ????????? fdlgform.animate1.top: = 11; ????????? fdlgform.Width: = fdlgform.animate1.width 306; ????????? Ah: = fdlgform.animate1.height; ????????? ife fshowavi the ????????? begin ??????????? fdlgform.gauge1.Width: = 291; ?? fdlgform.width: = 329; ??????????? fdlgform.Label1.Left?: = 16; ??????????? fdlgform.Label 2.LEFT?: = 16; ???????????? ah: = 0; ????????????????????? i not fshowprogress the ?? ??????? begein ??????????? fdlgform.height: = fdlgform.height-26; ????????????????????? H: = fdlgform.Label1.Height 4 fdlgform.label1.height; ????????? f NOT FSHOWMESSAGE1 THEN ????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ? H: = h-fdlgform.label1.height; ??????????? fdlgform.label2.top: = 11; ????????? End; ??????? ?? if not fshowMessage2 Then ????????? begin ??????????? h: = h-fdlgform.label2.height; ????????? end;? ???????? IF h ????????? fdlgform.gauge1.top ??: = 11 h 12;

????????? fdlgform.gauge1.width: = fdlgform.width-33;

????????? fdlgform.height: = fdlgform.gauge1.top 53; ??????? End;

????? Avibottom: ??????? begin ????????? fdlgform.label1.height: = 13 setLableHeight (fdlgform.label1.caption); ???????? FDLGMM.Label2.Height: = 13 setLableHeight (fdlgform.label2.caption); ??? ????????? fdlgform.width: = 356; ?? fdlgform.label1.top ??: = 8 ; ????????? fdlgform.label2.top ??: = fdlgform.Label1.top fdlgform.label1.Height 4; ????????? fdlgform.animate1.top: = fdlgform .Label2.top fdlgform.label2.height 6; ???????????????? fdlgform.gauge1.top ??: = fdlgform.animate1 .Top fdlgform.animate1.height 6; ????????? fdlgform.gauge1.LGM.Gauge1.Width: = 320;? ??????? Fdlgform.Label1.LGT?: = 9; ?? fdlgform.label1.width: = 340; ????????? fdlgform.Label2.Labl2.Width: = 340; ????????? fdlgform.animate1.Left: = (fdlgform.width Div 2) - (fdlgform.animate1.width div 2); // Animate1 hin ????? ????? ???? fdlgform.height: = 27 8 fdlgform.label1.height ????????????????? 4 fdlgform.label2 .Height ?????????????????? 6 fdlgform.an IMATE1.HEIGHT ????????????????????????? 6 fdlgform.gauge1.height 6; ??????????? ???????????????????? IF not fshowMessage1 Then ????????? begin ??????????? fdlgform.Label2.top? : = Fdlgform.label2.top - fdlgform.label1.Height-4; ??????????? fdlgform.animate1.top:= fdlgform.Animate1.top - fdlgform.label1.Height-4; ?? ????????? fdlgform.gauge1.top?: = Fdlgform.gauge1.top - fdlgform.label1.Height-4; ??????????? fdlgform.height ????? : = Fdlgform.height - fdlgform.label1.Height-4; ????????? End; ????????? f not fshowMessage2 Then ????????? begin ?? ????????? fdlgform.animate1.top:=

FDLGFORM.ANIMATE1.TOP - fdlgform.label2.height-6; ??????????? fdlgform.gauge1.top?: = Fdlgform.gauge1.top - fdlgform.Label2.Height-6; ??? ???????? fdlgform.height ?????: = fdlgform.height - fdlgform.label2.Height-6; ?????????? If not fshowavi the ????????? begin ??????????? fdlgform.gauge1.top?: = fdlgform.gauge1.top - fdlgform.animate1.height-6; ??? ???????? fdlgform.height ?????: = fdlgform.height - fdlgform.animate1.height-6; ??????????????? IF not fshowprogress the ????????? begin ??????????? fdlgform.height: = fdlgform.height -? fdlgform.gauge1.height-6; ??????? ?? End; ??????? End; ????? end; ????? fdlgform.Label1.visible: = fShowMessage1; ????? fdlgform.label2.visible: = fshowMessage2; ?? ??? fdlgform.gauge1.visible: = fshowProgress; ????? fdlgform.animate1.visible: = fShowavi; ??? End; ??? procedure tdswaitdialogex.formupdate; ??? begin ????? if Favisource .Ffilename <> '' Ten Favisource.Fcommonavi: = Avinone; ?????i favisource.fcommonavi <> avinone kiln favisource.ffilename: = ''; ????? IF (favisource.ffilename = ') and (favisource.fcommonavi = avinone) THEN FOPTIONS: = FOPTIONS- [Showavi]; ????? ing not assigned (fdlgform) ?????? begin ?????????? ??? fdlgform: = tdlgwaitex.create (self); ??????? fdlgform.position: = podesktopcenter; ????? End ;? ?????? f (showcaption in favorions) THEN FCaption: = ''; ??????? if showAVI in FOptions then FshowAVI: = true else FshowAVI: = false; ??????? if showMessage1 in FOptions then FShowMessage1: = true else FShowMessage1: = false; ??????? f = true else fshowMessage2: = false; ??????? =

true else FShowProgress: = false; ??????? if ShowProgressText in FOptions then FShowProgressText: = true else FShowProgressText: = false; ??????? FDlgForm.Caption: = FCaption; ??????? FDLGFORM.LABEL1.CAPTION: = fMessage1; ??????? fdlgform.label1.wordwrap: = fwordwrap; ??????? fdlgform.Label2.caption: = fMessage2; ??????? fdlgform. Label2.wordwrap: = fwordwrap; ??????? if fdislogstyle = DLGSTAYONTOP THEN ????????? fdlgform.FormStyle: = fsstayontop ??????? ELSE ???????? ? Fdlgform.formStyle: = fsnormal; ??????? fdlgform.label1.font.assign (fMessage1Font); ??????? fdlgform.label2.Font.assign (fMessage2font); ????? / / Avi ??????? fdlgform.animate1.active: = false; ??????? fdlgform.animate1.filename: =? ''; ??????? fdlgform.animate1.commonavi: = Avinone; ??????? fdlgform.animate1.height: = 60; ??????? ife fshowavi the ??????? begin ????????? ife ???????? ife > '' TEN ??????????? fdlgform.animate1.filename: = favisource.ffilename ????????????? fdlgform.animate1. Commonavi: = favisource.fcommonavi; ????????? fdlgform. Animate1.Active: = faviactive; ??????? end; ?????? fdlgform.gauge1.showText: = fShowProgressText; ??????? fdlgform.gauge1 .Minvalue: = fprogressmin; ??????? fdlgform.gauge1.MaxValue: = fprogressmax; ??????? fdlgform.gauge1.progress: = fprogresspos; ????? // refresh the form ?? ????? DrawForm; ??????? fdlgform.show; ??????? fdlgform.Update; ??????? fdlgform.UserformClose: = fonformhide; ??? ??? End : ??? procedure tdswaitdialogex.setProgressMax (const value: integer); ??? begin ????? if fprogressmax = value dam; ????? fprogressmax: = value; ????? if not (showProgress Infoptions.

????? if assigned (fdlgform) THEN ????? begin ??????? fdlgform.gauge1.MaxValue: = fprogressmax; ??????? if fdlgform.gauge1.Progress fprogresspos dam; ????? if fprogressmax ????? if not (showProgress in foptions) kiln =

????? if assigned (fdlgform) THEN

????? begin

??????? fdlgform.gauge1.Progress: = fprogresspos;

??????? fdlgform.update;

??????? doposchange;

????? end;

???

??? procedure? tdswaitdialogex.progressstepit; ??? begin ????? if fprogresspos fprogressstep> fProgressMax Then ??????? fprogresspos: = 0 ????? Else ??????? fprogresspos : = Fprogresspos fprogressstep; ????? if fprogressmin> fprogresspos dam; ????? if fprogressmax

????? if not (showProgress in foptions "," ????? if Assigned (fdlgform) THEN

????? begin

??????? fdlgform.gauge1.Progress: = fprogresspos;

??????? fdlgform.update;

??????? doposchange;

????? end;

???

??? procedure tdswaitdialogex.setonformhide (const value: = value; ????? if fdlgform <> nil the ?????? fdlgform.userformClose: = Value; ??? End; ??? procedure tdlgwaitex.formclose (sender: Tobject; var action: tclosection); ??? begin ????? While gettickcount

??? End.

转载请注明原文地址:https://www.9cbs.com/read-28942.html

New Post(0)