1 Star 0 Fork 25

Lyon/php_desktop

forked from lobtao/php_desktop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ufrmModal.pas 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
lobtao 提交于 2018-08-30 20:31 . add feature
unit ufrmModal;
interface
uses
Classes, Controls, Forms,
DynamicSkinForm, uCEFChromium,
uframeChrome, uCEFInterfaces, uCEFTypes, SysUtils;
type
TfrmModal = class(TForm)
frameChrome1: TframeChrome;
DSF: TspDynamicSkinForm;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure frameChrome1Chromium1TitleChange(Sender: TObject;
const browser: ICefBrowser; const title: ustring);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FUrl: string;
protected
public
{ Public declarations }
procedure setInfo(Caption: string; Url: string; width, height: Integer);
end;
var
frmModal: TfrmModal;
implementation
uses
unMoudle, unChromeMessage;
{$R *.dfm}
{ TfrmModel }
procedure TfrmModal.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TfrmModal.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := frameChrome1.FCanClose;
if not(frameChrome1.FClosing) then
begin
frameChrome1.FClosing := True;
Visible := False;
frameChrome1.Chromium1.CloseBrowser(True);
end;
end;
procedure TfrmModal.FormCreate(Sender: TObject);
begin
// ע
// if Assigned(subject) then
// subject.attach(Self.Handle);
end;
procedure TfrmModal.FormDestroy(Sender: TObject);
begin
// ע
// if Assigned(subject) then
// subject.unAttach(Self.Handle);
end;
procedure TfrmModal.FormShow(Sender: TObject);
begin
frameChrome1.setInfo(Self, Self.FUrl);
if fsModal in Self.FormState then
Self.FormStyle := fsNormal;
end;
procedure TfrmModal.frameChrome1Chromium1TitleChange(Sender: TObject;
const browser: ICefBrowser; const title: ustring);
var
tmpTitle: string;
begin
if Self.Caption <> '' then
Exit;
tmpTitle := Trim(title);
if (tmpTitle <> '') and (tmpTitle <> 'about:blank') then
Self.Caption := tmpTitle;
end;
procedure TfrmModal.setInfo(Caption, Url: string; width, height: Integer);
begin
Self.Caption := Trim(Caption);
Self.width := width;
Self.height := height;
Self.FUrl := Url;
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/LyonH/php_desktop.git
git@gitee.com:LyonH/php_desktop.git
LyonH
php_desktop
php_desktop
master

搜索帮助