Unit20.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:3k
- unit Unit20;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Menus, DBCtrls, Mask, StdCtrls, ComCtrls, ExtCtrls;
- type
- Tpapermanageform = class(TForm)
- Panel1: TPanel;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- DBMemo1: TDBMemo;
- DBMemo2: TDBMemo;
- DBEdit1: TDBEdit;
- DBNavigator1: TDBNavigator;
- MainMenu1: TMainMenu;
- N3: TMenuItem;
- N26: TMenuItem;
- P1: TMenuItem;
- N2: TMenuItem;
- N5: TMenuItem;
- N19: TMenuItem;
- N6: TMenuItem;
- N21: TMenuItem;
- FontDialog1: TFontDialog;
- PrintDialog1: TPrintDialog;
- EXT1: TMenuItem;
- EXT2: TMenuItem;
- SaveDialog1: TSaveDialog;
- procedure N26Click(Sender: TObject);
- procedure N19Click(Sender: TObject);
- procedure DBEdit1Change(Sender: TObject);
- procedure N2Click(Sender: TObject);
- procedure N8Click(Sender: TObject);
- procedure N4Click(Sender: TObject);
- procedure N7Click(Sender: TObject);
- procedure EXT1Click(Sender: TObject);
- procedure EXT2Click(Sender: TObject);
- // procedure N10Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- papermanageform: Tpapermanageform;
- fname:string;
- implementation
- uses Unit4, Unit14, Unit18;
- {$R *.dfm}
- procedure Tpapermanageform.N26Click(Sender: TObject);
- begin
- papermanageform.Close;
- end;
- procedure Tpapermanageform.N19Click(Sender: TObject);
- begin
- if fontdialog1.Execute then
- begin
- DBMemo1.Font:=fontdialog1.Font;
- DBMemo2.Font:=fontdialog1.Font;
- end;
- end;
- procedure Tpapermanageform.DBEdit1Change(Sender: TObject);
- begin
- DBEdit1.Text:=DataModule4.Table_papermanager.fieldbyname('jname').AsString+' '+'('+DataModule4.Table_papermanager.fieldbyname('sign').AsString+')';
- end;
- procedure Tpapermanageform.N2Click(Sender: TObject);
- begin
- Screen.Cursor:=crHourGlass;
- try
- print;
- ShowMessage('打印完毕');
- finally
- Screen.Cursor:=crDefault;
- end;
- end;
- procedure Tpapermanageform.N8Click(Sender: TObject);
- begin
- DBmemo1.CopyToClipboard;
- end;
- procedure Tpapermanageform.N4Click(Sender: TObject);
- begin
- DBmemo1.Undo;
- end;
- procedure Tpapermanageform.N7Click(Sender: TObject);
- begin
- DBmemo1.CutToClipboard;
- end;
- {
- procedure Tpapermanageform.N10Click(Sender: TObject);
- begin
- memo1.SelectAll;
- papermanageform.N8.Enabled:=true;
- papermanageform.N9.Enabled:=true;
- end;
- }
- procedure Tpapermanageform.EXT1Click(Sender: TObject);
- var
- filename:string;
- begin
- savedialog1.Title:='保存试卷';
- savedialog1.FileName:=fname;
- if savedialog1.Execute then
- begin
- filename:=savedialog1.FileName;
- DBmemo1.Lines.SaveToFile(filename+'.rtf');
- end;
- end;
- procedure Tpapermanageform.EXT2Click(Sender: TObject);
- var filename:string;
- begin
- savedialog1.Title:='保存试卷答案';
- savedialog1.FileName:=fname;
- if savedialog1.Execute then
- begin
- filename:=savedialog1.FileName;
- DBmemo2.Lines.SaveToFile(filename+'.rtf');
- end;
- end;
- end.