📄 fsystem.pas
字号:
unit FSystem;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, FBaseform, IWVCLComponent, IWBaseLayoutComponent,
IWBaseContainerLayout, IWContainerLayout, IWTemplateProcessorHTML,
IWCompRectangle, IWCompButton, IWVCLBaseControl, IWBaseControl,
IWBaseHTMLControl, IWControl, IWCompEdit, IWCompCheckbox,IniFiles,
IWGrids, IWDBGrids,Iwhtmltag;
type
TSystemForm = class(TBaseForm)
EdtPort: TIWEdit;
EdtNewFilm: TIWEdit;
EdtHotFilm: TIWEdit;
FilmControl: TIWRectangle;
UserControl: TIWRectangle;
IWCheckBox1: TIWCheckBox;
AffirmBtn: TIWButton;
ReturnBtn: TIWButton;
ComGrid: TIWDBGrid;
procedure IWAppFormRender(Sender: TObject);
procedure AffirmBtnClick(Sender: TObject);
procedure IWAppFormCreate(Sender: TObject);
procedure ComGridColumns2Click(ASender: TObject; const AValue: String);
procedure ComGridColumns1Click(ASender: TObject; const AValue: String);
procedure ComGridColumns3Click(ASender: TObject; const AValue: String);
procedure EdtPortHTMLTag(ASender: TObject; ATag: TIWHTMLTag);
procedure ReturnBtnClick(Sender: TObject);
private
{ Private declarations }
public
myinifile:TInifile;
{ Public declarations }
end;
var
SystemForm: TSystemForm;
implementation
uses FRegForm,ServerController,FplayForm,FMainForm,FlistForm,FControl,Fadminform,FUserForm;
{$R *.dfm}
procedure TSystemForm.IWAppFormRender(Sender: TObject);
var
VLIst:TStringList;
begin
inherited;
VLIst:=TStringList.Create;
VLIst.LoadFromFile(WebApplication.ApplicationPath+'files\FilmSystem.ini');
EdtPort.Text:= IIF(VLIst.ValueFromIndex[0],'8080');
EdtNewFilm.Text:= IIF(VLIst.ValueFromIndex[1],'4');
EdtHotFilm.Text := IIF(VLIst.ValueFromIndex[2],'14');
IWCheckBox1.Checked:=StrToBoolDef(VLIst.ValueFromIndex[3],False);
VLIst.Free;
FilmControl.Text:=GetSpace(1)+GetLinkString('2','append','【添加】')+GetSpace(1)+GetLinkString('2','appendOrDelete','【修改,删除】');
UserControl.Text:=GetSpace(1)+GetLinkString('3','append','【添加】')+GetSpace(1)+GetLinkString('3','appendOrDelete','【修改,删除】');;
end;
procedure TSystemForm.AffirmBtnClick(Sender: TObject);
var
VLIst:TStringList;
begin
inherited;
VLIst:=TStringList.Create;
with VList do begin
Values['Port']:= IIF(EdtPort.Text,'8080');
Values['New']:= IIF(EdtNewFilm.Text,'4');
Values['Hot']:= IIF(EdtHotFilm.Text,'14');
Values['effect']:=BoolToStr(IWCheckBox1.Checked);
end;
VLIst.SaveToFile(WebApplication.ApplicationPath+'files\FilmSystem.ini');
VLIst.Free;
end;
procedure TSystemForm.IWAppFormCreate(Sender: TObject);
var
VLIst:TStringList;
begin
inherited;
if not FileExists(WebApplication.ApplicationPath+'files\FilmSystem.ini') then
begin
VLIst:=TStringList.Create;
with VList do begin
Values['Port']:= '8080';
Values['New']:= '4';
Values['Hot']:= '14';
Values['effect']:='false';
end;
VLIst.SaveToFile(WebApplication.ApplicationPath+'files\FilmSystem.ini');
VLIst.Free;
end;
end;
procedure TSystemForm.ComGridColumns2Click(ASender: TObject;
const AValue: String);
begin // 添加 ,删除电影
inherited;
if AValue= 'append' then begin
if not ShowForm('ModiforAddForm') then TModiforAddForm.Create(WebApplication).Show;
UserSession.isEditAppendFilm:=AValue
end
else begin
UserSession.FilMType := 'All';
if not ShowForm('adminForm') then Tadminform.Create(WebApplication).Show;
end;
end;
procedure TSystemForm.ComGridColumns1Click(ASender: TObject;
const AValue: String);
begin
inherited;
If AValue ='MainForm' then
begin
if not ShowForm('MainForm') then TMainForm.Create(WebApplication).Show;
end
else
begin
UserSession.FilMType:=AValue;
if not ShowForm('ListForm') then TListForm.Create(WebApplication).Show;
end;
end;
procedure TSystemForm.ComGridColumns3Click(ASender: TObject;
const AValue: String);
begin //添加,删除用户
inherited;
if AValue = 'append' then begin
if not ShowForm('RegForm') then TRegForm.Create(WebApplication).Show;
UserSession.isEditAppendUser:='';
end
else begin
UserSession.isEditAppendUser :='all';
if not ShowForm('UserForm') then TUserform.Create(WebApplication).Show;
end;
end;
procedure TSystemForm.EdtPortHTMLTag(ASender: TObject; ATag: TIWHTMLTag);
begin
inherited;
ATag.AddStringParam('onpaste','return false;');
ATag.AddStringParam('onkeypress','return yancheck(event);');
end;
procedure TSystemForm.ReturnBtnClick(Sender: TObject);
begin
inherited;
if not ShowForm('MainForm') then TMainForm.Create(WebApplication).Show;
end;
initialization
RegisterClass(TSystemForm);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -