Unit3.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:5k
- unit Unit3;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Menus, ExtCtrls, ComCtrls, StdCtrls, DB, DBTables, jpeg;
- type
- Tmainform = class(TForm)
- MainMenu1: TMainMenu;
- N1: TMenuItem;
- N2: TMenuItem;
- N3: TMenuItem;
- N4: TMenuItem;
- N6: TMenuItem;
- N7: TMenuItem;
- N8: TMenuItem;
- StatusBar1: TStatusBar;
- Timer1: TTimer;
- Panel1: TPanel;
- Label2: TLabel;
- Query3: TQuery;
- Query3qx: TStringField;
- N10: TMenuItem;
- N9: TMenuItem;
- N13: TMenuItem;
- N14: TMenuItem;
- N15: TMenuItem;
- N16: TMenuItem;
- N17: TMenuItem;
- Image1: TImage;
- N5: TMenuItem;
- N11: TMenuItem;
- N12: TMenuItem;
- N18: TMenuItem;
- N19: TMenuItem;
- procedure N8Click(Sender: TObject);
- procedure N7Click(Sender: TObject);
- procedure N6Click(Sender: TObject);
- procedure N4Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- // procedure Timer1Timer(Sender: TObject);
- procedure FormActivate(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure N9Click(Sender: TObject);
- procedure N13Click(Sender: TObject);
- procedure N14Click(Sender: TObject);
- procedure N15Click(Sender: TObject);
- procedure N16Click(Sender: TObject);
- procedure N17Click(Sender: TObject);
- procedure N3Click(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure N12Click(Sender: TObject);
- procedure N18Click(Sender: TObject);
- procedure N19Click(Sender: TObject);
- // procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- password,username:string;
- // papertime:integer;
- updateno:integer;
- { Public declarations }
- end;
- var
- mainform: Tmainform;
- havelogin:boolean;
- implementation
- uses Unit2,Unit4,Unit5,Unit1, Unit6, Unit7, Unit8, Unit9, Unit10, Unit11,
- Unit12, Unit15, Unit16, Unit17, Unit21, Unit20;
- {$R *.dfm}
- procedure Tmainform.N8Click(Sender: TObject);
- begin
- if (messagedlg('确认要退出系统吗 ?',mtconfirmation,[mbyes,mbno],0))=mryes then
- application.Terminate;
- end;
- procedure Tmainform.N7Click(Sender: TObject);
- begin
- restoreform.show;
- end;
- procedure Tmainform.N6Click(Sender: TObject);
- begin
- backupform.Show;
- end;
- procedure Tmainform.N4Click(Sender: TObject);
- begin
- changemi.show;
- end;
- procedure Tmainform.FormCreate(Sender: TObject);
- Const
- count=2000;//显示欢迎窗体的最少时间(毫秒)
- var
- st,et:Integer;
- begin
- //papertime:=0;
- havelogin:=false;
- label2.Caption:='欢迎使用通用试卷生成系统! ';
- Label2.Left:=300;
- statusbar1.Panels[2].Text:=DateToStr(Date);
- statusbar1.Panels[3].Text:=TimeToStr(time);
- //记录开始时间
- st:=GetTickCount;
- welcomeform:=Twelcomeform.Create(Application);
- welcomeform.Show;
- welcomeform.Update;
- //初始化程序
- //记录结束时间
- et:=GetTickCount;
- if et-st<count then //是否显示够了规定时间
- Sleep(count-(et-st));
- welcomeform.Close;
- welcomeform.Free;
- //if query3.FieldByName('qx').AsString ='b' then
- //form3.N3.Enabled:=false;
- //else
- //if query3.FieldByName('qx').AsString ='a' then
- //form3.N3.Visible:=true;
- end;
- procedure Tmainform.FormActivate(Sender: TObject);
- var
- t:integer;
- begin
- if not havelogin then
- begin
- loginform.show;
- end;
- t:=StatusBar1.Top+2;
- Panel1.Top:=t;
- //if query3.FieldByName('qx').AsString ='b' then
- //form3.N3.Visible:=false ;
- //else
- //if query3.FieldByName('qx').AsString ='a' then
- //form3.N3.Visible:=true;
- end;
- procedure Tmainform.Timer1Timer(Sender: TObject);
- begin
- //字幕从左向右移动,这儿可以修改成任意方向的
- //移动,请读者自己完成。
- label2.Left:=label2.Left -1;
- ///当整个label移动出了panel的边界后,
- //重新开始
- if(label2.Left<=-180 ) then
- label2.Left :=300;
- // if(label2.Left>=StatusBar1.Panels[0].Width ) then
- // label2.Left :=-label2.Width;
- end;
- procedure Tmainform.N9Click(Sender: TObject);
- begin
- chooseform.show;
- end;
- procedure Tmainform.N13Click(Sender: TObject);
- begin
- filltextform.show;
- end;
- procedure Tmainform.N14Click(Sender: TObject);
- begin
- judgeform.show;
- end;
- procedure Tmainform.N15Click(Sender: TObject);
- begin
- readproform.show;
- end;
- procedure Tmainform.N16Click(Sender: TObject);
- begin
- definepaperform.show;
- DataModule4.Table_shijuan.Close;
- DataModule4.Table_shijuan.Open;
- end;
- procedure Tmainform.N17Click(Sender: TObject);
- begin
- procedureform.show;
- end;
- procedure Tmainform.N3Click(Sender: TObject);
- begin
- DataModule4.Table_u.Close;
- DataModule4.Table_u.Open;
- usermanage.Show;
- end;
- procedure Tmainform.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- begin
- if (messagedlg('确认要退出系统吗 ?',mtconfirmation,[mbyes,mbno],0))=mryes then
- application.Terminate;
- end;
- procedure Tmainform.N12Click(Sender: TObject);
- begin
- loginform.ComboBox1.Text:='';
- loginform.Edit1.Text:='';
- loginform.Show;
- end;
- procedure Tmainform.N18Click(Sender: TObject);
- begin
- rightform.Show;
- end;
- procedure Tmainform.N19Click(Sender: TObject);
- begin
- papermanageform.Show;
- end;
- end.