[Ocs-comps-commits] OCS2/Samples/VCL/AddinManager/Simple/Plugins/Web MailForm.dfm,NONE,1.1 MailForm.
Brought to you by:
tectsoft
From: Si C. <tec...@us...> - 2005-11-21 10:33:48
|
Update of /cvsroot/ocs-comps/OCS2/Samples/VCL/AddinManager/Simple/Plugins/Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10593/Samples/VCL/AddinManager/Simple/Plugins/Web Added Files: MailForm.dfm MailForm.pas Web.cfg Web.dof Web.dpr Web.res Log Message: Initially added to source control --- NEW FILE: Web.res --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Web.dof --- [FileVersion] Version=6.0 [Compiler] A=8 B=0 C=1 D=1 E=0 F=0 G=1 H=1 I=1 J=1 K=0 L=1 M=0 N=1 O=1 P=1 Q=0 R=0 S=0 T=0 U=0 V=1 W=0 X=1 Y=1 Z=1 ShowHints=1 ShowWarnings=1 UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [Linker] MapFile=0 OutputObjs=0 ConsoleApp=1 DebugInfo=0 RemoteSymbols=0 MinStackSize=16384 MaxStackSize=1048576 ImageBase=4194304 ExeDescription= [Directories] OutputDir=D:\Program Files\Other\TB2K\Demo UnitOutputDir= PackageDLLOutputDir= PackageDCPOutputDir= SearchPath= Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;inetdb;nmfast;webdsnap;websnap;soaprtl;dbexpress;dbxcds;indy;dclOffice2k;ibam;OrckaD6 Conditionals= DebugSourceDirs= UsePackages=0 [Parameters] RunParams= HostApplication= Launcher= UseLauncher=0 DebugCWD= [Language] ActiveLang= ProjectLang= RootDir= [Version Info] IncludeVerInfo=0 AutoIncBuild=0 MajorVer=1 MinorVer=0 Release=0 Build=0 Debug=0 PreRelease=0 Special=0 Private=0 DLL=0 Locale=1033 CodePage=1252 [Version Info Keys] CompanyName= FileDescription= FileVersion=1.0.0.0 InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= ProductVersion=1.0.0.0 Comments= [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [HistoryLists\hlOutputDirectorry] Count=1 Item0=D:\Program Files\Other\TB2K\Demo --- NEW FILE: MailForm.pas --- unit MailForm; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Psock, NMsmtp, StdCtrls, ExtCtrls, ComCtrls; type TForm1 = class(TForm) NMSMTP1: TNMSMTP; PageControl1: TPageControl; TabSheet2: TTabSheet; Memo1: TMemo; Panel1: TPanel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Edit7: TEdit; Edit8: TEdit; Edit9: TEdit; Panel2: TPanel; Label11: TLabel; Button6: TButton; Edit10: TEdit; Edit4: TEdit; Label4: TLabel; Label2: TLabel; Edit2: TEdit; Label1: TLabel; Edit1: TEdit; Edit5: TEdit; Label5: TLabel; Label6: TLabel; Edit6: TEdit; procedure Button6Click(Sender: TObject); private { Private declarations } public { Public declarations } end; procedure SendEMail; implementation {$R *.DFM} procedure SendEMail; var Form1: TForm1; begin Form1 := TForm1.Create(nil); try Form1.ShowModal; finally Form1.Free; end; end; procedure TForm1.Button6Click(Sender: TObject); begin Screen.Cursor := crHourGlass; { Setup Sender Info } NMSMTP1.Host := Edit1.Text; NMSMTP1.Port := StrToInt(Edit2.Text); NMSMTP1.UserID := Edit4.Text; { Connect } NMSMTP1.Connect; { Setup message } NMSMTP1.PostMessage.FromAddress := Edit6.Text; NMSMTP1.PostMessage.FromName := Edit5.Text; NMSMTP1.PostMessage.Subject := Edit10.Text; NMSMTP1.PostMessage.ToAddress.Add(Edit7.Text); NMSMTP1.PostMessage.ToBlindCarbonCopy.Add(Edit9.Text); NMSMTP1.PostMessage.ToCarbonCopy.Add(Edit8.Text); NMSMTP1.PostMessage.Body.Assign(Memo1.Lines); { Send } NMSMTP1.SendMail; {Disconnect } NMSMTP1.Disconnect; Screen.Cursor := crDefault; end; end. --- NEW FILE: MailForm.dfm --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Web.dpr --- library Web; uses Forms, Windows, SysUtils, ShellAPI, OrckaAddinManagerShared, MailForm in 'MailForm.pas' {Form1}; {$R *.RES} type TWebPlugin = class private Service: TOToolServices; //mnuHelpSep: TOMenuItem; mnuHelpWeb: TOMenuItem; mnuHelpWebHome: TOMenuItem; mnuHelpWebBorland: TOMenuItem; //mnuHelpWebSep: TOMenuItem; //mnuHelpWebEMail: TOMenuItem; public constructor Create(AService: TOToolServices); destructor Destroy; override; procedure WebPage(Sender: TOMenuItem); procedure EMail(Sender: TOMenuItem); end; var WebPlugin: TWebPlugin; resourcestring sNoHelpMenu = 'The help menu could not be found'; procedure PluginExit; stdcall; begin WebPlugin.Free; end; function Plugin (InParams: TOrckaAddinManagerParams; var ExitProc: Pointer): Boolean; stdcall; begin WebPlugin := TWebPlugin.Create(InParams.Service); ExitProc := @PluginExit; Result := True; end; exports Plugin name OrckaAddinManagerExportProc; { TPluginInfo } constructor TWebPlugin.Create(AService: TOToolServices); var mnuHelp: TOMenuItem; begin Service := AService; Application.Handle := Service.GetHandle; {Get the Help menu} mnuHelp := Service.FindMenu('Help'); if not Assigned(mnuHelp) then mnuHelp := Service.InsertMenu(100, nil, '&Help', nil); {Add Menu's} mnuHelpWeb := Service.InsertMenu(mnuHelp.GetItemCount - 1, mnuHelp, 'On the Web', nil); // mnuHelpSep := Service.InsertMenu(mnuHelp.GetItemCount -1, mnuHelp, '-', nil); mnuHelpWebHome := Service.InsertMenu(0, mnuHelpWeb, 'Orcka Home Page', WebPage); mnuHelpWebBorland := Service.InsertMenu(1, mnuHelpWeb, 'Borland Home Page', WebPage); // mnuHelpWebSep := Service.InsertMenu(2, mnuHelpWeb, '-', nil); // mnuHelpWebEMail := Service.InsertMenu(3, mnuHelpWeb, 'Send EMail', EMail); end; destructor TWebPlugin.Destroy; begin {RemoveMenu's} // Service.RemoveMenu(mnuHelpSep); Service.RemoveMenu(mnuHelpWeb); Service.RemoveMenu(mnuHelpWebHome); Service.RemoveMenu(mnuHelpWebBorland); // Service.RemoveMenu(mnuHelpWebSep); // Service.RemoveMenu(mnuHelpWebEMail); end; procedure TWebPlugin.EMail(Sender: TOMenuItem); begin SendEMail; end; procedure TWebPlugin.WebPage(Sender: TOMenuItem); var sURL: string; begin if Sender = mnuHelpWebBorland then sURL := 'http://www.borland.com' else sURL := 'http://www.orcka.com'; ShellExecute(0, 'open', PChar(sURL), nil, nil, SW_SHOW); end; begin end. --- NEW FILE: Web.cfg --- -$A8 -$B- -$C+ -$D+ -$E- -$F- -$G+ -$H+ -$I+ -$J+ -$K- -$L+ -$M- -$N+ -$O+ -$P+ -$Q- -$R- -$S- -$T- -$U- -$V+ -$W- -$X+ -$YD -$Z1 -cg -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -H+ -W+ -M -$M16384,1048576 -K$00400000 -E"D:\Program Files\Other\TB2K\Demo" -LE"d:\program files\borland\delphi6\Projects\Bpl" -LN"d:\program files\borland\delphi6\Projects\Bpl" |