1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| unit Main;
interface
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, SHDocVw, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.ComCtrls;
type TFMain = class(TForm) pnl: TPanel; btnMsg: TButton; btnForm: TButton; mmoLog: TMemo; Splitter1: TSplitter; PageControl1: TPageControl; TabSheet1: TTabSheet; wbs: TWebBrowser; procedure FormCreate(Sender: TObject); procedure wbsStatusTextChange(ASender: TObject; const Text: WideString); procedure btnFormClick(Sender: TObject); procedure btnMsgClick(Sender: TObject); private procedure AddLog(s: String); public published procedure delFunc_MainMessage; procedure delFunc_MainForm; end;
var FMain: TFMain;
implementation
uses UCommon, UCallFunc;
{$R *.dfm}
procedure TFMain.AddLog(s: String); begin mmoLog.Lines.Add(s); end;
procedure TFMain.btnFormClick(Sender: TObject); var f: TForm; begin f := TForm.Create(nil); f.Caption := '메인 폼'; f.ShowModal; f.Free; end;
procedure TFMain.btnMsgClick(Sender: TObject); begin ShowMessage('메인 메시지'); end;
procedure TFMain.delFunc_MainForm; begin btnForm.Click; end;
procedure TFMain.delFunc_MainMessage; begin btnMsg.Click; end;
procedure TFMain.FormCreate(Sender: TObject); begin wbs.Navigate2(ExtractFilePath(Application.ExeName) + 'index.html'); end;
procedure TFMain.wbsStatusTextChange(ASender: TObject; const Text: WideString); const CST_DEL_FUNC = 'delFunc_'; var sFuncName: String; begin sFuncName := Text; if Pos(CST_DEL_FUNC, sFuncName) = 0 then Exit;
AddLog('Web Status: ' + String(Text)); SetTimeOut( procedure begin CallMethod(g_CallFunc, sFuncName)
end, 1); end;
end.
|