Unit17.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:5k
- unit Unit17;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Menus, DB, DBTables;
- type
- Tpapermadeform = class(TForm)
- MainMenu1: TMainMenu;
- N3: TMenuItem;
- N24: TMenuItem;
- N26: TMenuItem;
- N5: TMenuItem;
- N19: TMenuItem;
- N6: TMenuItem;
- N21: TMenuItem;
- FontDialog1: TFontDialog;
- Memo1: TMemo;
- N1: TMenuItem;
- Query1: TQuery;
- N4: TMenuItem;
- N7: TMenuItem;
- N8: TMenuItem;
- N9: TMenuItem;
- N10: TMenuItem;
- N11: TMenuItem;
- procedure N22Click(Sender: TObject);
- procedure N26Click(Sender: TObject);
- procedure U1Click(Sender: TObject);
- procedure N12Click(Sender: TObject);
- procedure N13Click(Sender: TObject);
- procedure N14Click(Sender: TObject);
- procedure N16Click(Sender: TObject);
- procedure N19Click(Sender: TObject);
- procedure N24Click(Sender: TObject);
- procedure N1Click(Sender: TObject);
- procedure N2Click(Sender: TObject);
- procedure N7Click(Sender: TObject);
- procedure N8Click(Sender: TObject);
- procedure N9Click(Sender: TObject);
- procedure N10Click(Sender: TObject);
- procedure N11Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- papermadeform: Tpapermadeform;
- fname:string;
- implementation
- // uses Unit19;
- uses printers,Unit19, Unit10, Unit3, Unit4;
- {$R *.dfm}
- procedure Tpapermadeform.N22Click(Sender: TObject);
- begin
- // memo1.Clear;
- //if opendialog1.Execute then
- //begin
- //fname:=opendialog1.FileName;
- //memo1.Lines.LoadFromFile(fname);
- //editpaperform.Caption:=editpaperform.Caption+'['+fname+']';
- //end;
- end;
- procedure Tpapermadeform.N26Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tpapermadeform.U1Click(Sender: TObject);
- begin
- memo1.Undo;
- end;
- procedure Tpapermadeform.N12Click(Sender: TObject);
- begin
- memo1.CutToClipboard;
- end;
- procedure Tpapermadeform.N13Click(Sender: TObject);
- begin
- memo1.CopyToClipboard;
- end;
- procedure Tpapermadeform.N14Click(Sender: TObject);
- begin
- memo1.PasteFromClipboard;
- end;
- procedure Tpapermadeform.N16Click(Sender: TObject);
- begin
- memo1.SelectAll;
- //papermadeform.N14.Enabled:=true;
- //papermadeform.N13.Enabled:=true;
- end;
- procedure Tpapermadeform.N19Click(Sender: TObject);
- begin
- if fontdialog1.Execute then
- begin
- memo1.Font:=fontdialog1.Font;
- end;
- end;
- procedure Tpapermadeform.N24Click(Sender: TObject);
- //var
- //filename:string;
- begin
- //mainform.papertime:=mainform.papertime+1;
- query1.Close;
- query1.SQL.Clear;
- // query1.SQL.text:='insert into papermanager values('''+inttostr(mainform.papertime)+''','''+definepaperform.DBEdit1.Text+''',''手动'','''+papermadeform.Memo1.Text+''','''+madeanswerform.Memo1.Text+''')' ;
- query1.SQL.text:='insert into papermanager values(:gg,''手动'',:ss,:dd)' ;
- // query1.ParamByName('nn').AsInteger:=mainform.papertime;
- query1.ParamByName('gg').AsString:=definepaperform.DBEdit1.Text;
- query1.ParamByName('ss').AsString:=papermadeform.Memo1.Text ;
- query1.ParamByName('dd').AsString:=madeanswerform.Memo1.Text ;
- // query1.ParamByName('hh').AsInteger:=strtoint(definepaperform.DBEdit18.Text) ;
- query1.ExecSQL;
- // mainform.papertime:=mainform.papertime+1;
- //savedialog1.Title:='保存生成后的试卷';
- //savedialog1.FileName:=fname;
- //if savedialog1.Execute then
- // begin
- // filename:=savedialog1.FileName;
- // memo1.Lines.SaveToFile(filename+'.doc');
- // end;
- DataModule4.Table_papermanager.Active:=false;
- DataModule4.Table_papermanager.Active:=true;
- end;
- procedure Tpapermadeform.N1Click(Sender: TObject);
- begin
- madeanswerform.Show;
- end;
- procedure Tpapermadeform.N2Click(Sender: TObject);
- //var lines :integer;
- // prntext:system.text;
- begin
- Screen.Cursor:=crHourGlass;
- try
- print;
- ShowMessage('打印完毕');
- finally
- Screen.Cursor:=crDefault;
- end;
- {
- if printdialog1.Execute then
- assignprn(prntext);
- rewrite(prntext);
- printer.canvas.Font:=memo1.font;
- for lines:=0 to memo1.Lines.Count-1 do
- begin
- writeln(prntext,memo1.lines[lines]);
- system.Close(prntext);
- end; }
- end;
- procedure Tpapermadeform.N7Click(Sender: TObject);
- begin
- memo1.Undo;
- end;
- procedure Tpapermadeform.N8Click(Sender: TObject);
- begin
- memo1.CutToClipboard;
- end;
- procedure Tpapermadeform.N9Click(Sender: TObject);
- begin
- memo1.CopyToClipboard;
- end;
- procedure Tpapermadeform.N10Click(Sender: TObject);
- begin
- Memo1.PasteFromClipboard;
- end;
- procedure Tpapermadeform.N11Click(Sender: TObject);
- begin
- memo1.SelectAll;
- papermadeform.N10.Enabled:=true;
- papermadeform.N9.Enabled:=true;
- end;
- end.
-