📄 fbaseform.pas
字号:
unit FBaseform;
{页面进入和退出的特效
进入页面<meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)">
推出页面<meta http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)">
这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使
用哪种特效,取值为1-23:
0 矩形缩小 1 矩形扩大 2 圆形缩小 3 圆形扩大
4 下到上刷新 5 上到下刷新 6 左到右刷新 7 右到左刷新
8 竖百叶窗 9 横百叶窗 10 错位横百叶窗 11 错位竖百叶窗
12 点扩散 13 左右到中间刷新 14 中间到左右刷新 15 中间到上下
16 上下到中间 17 右下到左上 18 右上到左下 19 左上到右下
20 左下到右上 21 横条 22 竖条 23 以上22种随机选择一种}
interface
uses
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Controls,
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit,
IWVCLComponent, IWBaseLayoutComponent, IWBaseContainerLayout,
IWContainerLayout, IWTemplateProcessorHTML, IWCompLabel, IWCompButton,
IWCompRectangle, IWGrids, IWDBGrids,ADODB,DB;
type
TBaseForm = class(TIWAppForm)
UserID: TIWEdit;
PASS: TIWEdit;
IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
Login: TIWButton;
Reg: TIWButton;
Label1: TIWRectangle;
Label2: TIWRectangle;
Search: TIWButton;
Searchedit: TIWEdit;
Sysbtn: TIWButton;
procedure IWAppFormRender(Sender: TObject);
procedure LoginClick(Sender: TObject);
procedure RegClick(Sender: TObject);
procedure SearchClick(Sender: TObject);
procedure SysbtnClick(Sender: TObject);
public
end;
implementation
uses ServerController,Fadminform,FControl,FRegForm,FSystem,FlistForm;
{$R *.dfm}
procedure TBaseForm.IWAppFormRender(Sender: TObject);
procedure changeface;
begin
Login.Visible:=False;
Reg.Visible:=false;
UserID.Visible:=False;
PASS.Visible:=False;
Label2.Visible:=False;
Label1.Text:=''+GetHourStr+'好,<strong>'+usersession.UserLoginName+'</strong>';
if UserSession.IsAdmin then begin
Label2.Visible:=True;
Label2.Text:='<a href="#none" onclick="return SubmitClickConfirm(''SYSBTN'','''', true, '''');">【站内管理】</a>';
end;
end;
var
VLIst:TStringList;
begin
VLIst:=TStringList.Create;
VLIst.LoadFromFile(WebApplication.ApplicationPath+'files\FilmSystem.ini'); //保存系统的相关信息
StyleSheet.Filename := 'Files\Skin\'+usersession.Skin+'\style.css';
IWTemplateProcessorHTML1.Templates.Default:=usersession.Skin+'\'+ WebApplication.ActiveForm.Name+'.Html';
if StrToBoolDef(VLIst.ValueFromIndex[3],False) then //是否支持页面特效
ExtraHeader.Text:='<meta HTTP-EQUIV="Page-Enter" CONTENT="revealtrans(duration=0.5, transition=23)">';
VLIst.Free;
if UserSession.IsRegUser then changeface; //注册会员的话改变页面
end;
procedure TBaseForm.LoginClick(Sender: TObject);
begin
with UserSession.qryUserTable do begin
Close;
SQL.Clear;
SQL.Add('select * from usertables where userid=:1 and passwords=:2');
Parameters[0].Value:= UserID.Text;
Parameters[1].Value:= PASS.Text;
Open;
if not IsEmpty then begin
if FieldByName('admin').AsBoolean= True then begin //管理员
UserSession.IsAdmin:=true;
UserSession.IsRegUser:=True;
UserSession.UserLoginName:=UserID.Text;
if not ShowForm('SystemForm') then TSystemForm.Create(WebApplication).Show;
end
else begin //普通用户
UserSession.IsRegUser:=True;
UserSession.UserLoginName:=UserID.Text;
end;
Edit; // 登录次数
FieldByName('LoginCount').AsInteger:=FieldByName('LoginCount').AsInteger+1;
Post;
end
else begin
WebApplication.ShowMessage('系统无此用户名,请确定用户名,和密码输入是否正确!');
end;
end;
UserID.Text:='';
PASS.Text:='';
Searchedit.Text:='';
end;
procedure TBaseForm.RegClick(Sender: TObject);
begin
if not ShowForm('RegForm') then TRegForm.Create(WebApplication).Show;
end;
procedure TBaseForm.SearchClick(Sender: TObject);
begin
UserSession.FilmSearch:=Searchedit.Text;
Searchedit.Text:='';
if not ShowForm('ListForm') then TListForm.Create(WebApplication).Show;
end;
procedure TBaseForm.SysbtnClick(Sender: TObject);
begin
if not ShowForm('SystemForm') then TSystemForm.Create(WebApplication).Show;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -