Unit20.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:3k
源码类别:

教育系统应用

开发平台:

Delphi

  1. unit Unit20;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, Menus, DBCtrls, Mask, StdCtrls, ComCtrls, ExtCtrls;
  6. type
  7.   Tpapermanageform = class(TForm)
  8.     Panel1: TPanel;
  9.     PageControl1: TPageControl;
  10.     TabSheet1: TTabSheet;
  11.     TabSheet2: TTabSheet;
  12.     DBMemo1: TDBMemo;
  13.     DBMemo2: TDBMemo;
  14.     DBEdit1: TDBEdit;
  15.     DBNavigator1: TDBNavigator;
  16.     MainMenu1: TMainMenu;
  17.     N3: TMenuItem;
  18.     N26: TMenuItem;
  19.     P1: TMenuItem;
  20.     N2: TMenuItem;
  21.     N5: TMenuItem;
  22.     N19: TMenuItem;
  23.     N6: TMenuItem;
  24.     N21: TMenuItem;
  25.     FontDialog1: TFontDialog;
  26.     PrintDialog1: TPrintDialog;
  27.     EXT1: TMenuItem;
  28.     EXT2: TMenuItem;
  29.     SaveDialog1: TSaveDialog;
  30.     procedure N26Click(Sender: TObject);
  31.     procedure N19Click(Sender: TObject);
  32.     procedure DBEdit1Change(Sender: TObject);
  33.     procedure N2Click(Sender: TObject);
  34.     procedure N8Click(Sender: TObject);
  35.     procedure N4Click(Sender: TObject);
  36.     procedure N7Click(Sender: TObject);
  37.     procedure EXT1Click(Sender: TObject);
  38.     procedure EXT2Click(Sender: TObject);
  39. //    procedure N10Click(Sender: TObject);
  40.   private
  41.     { Private declarations }
  42.   public
  43.     { Public declarations }
  44.   end;
  45. var
  46.   papermanageform: Tpapermanageform;
  47.    fname:string;
  48. implementation
  49. uses Unit4, Unit14, Unit18;
  50. {$R *.dfm}
  51. procedure Tpapermanageform.N26Click(Sender: TObject);
  52. begin
  53. papermanageform.Close;
  54. end;
  55. procedure Tpapermanageform.N19Click(Sender: TObject);
  56. begin
  57. if fontdialog1.Execute then
  58. begin
  59. DBMemo1.Font:=fontdialog1.Font;
  60. DBMemo2.Font:=fontdialog1.Font;
  61. end;
  62. end;
  63. procedure Tpapermanageform.DBEdit1Change(Sender: TObject);
  64. begin
  65. DBEdit1.Text:=DataModule4.Table_papermanager.fieldbyname('jname').AsString+'   '+'('+DataModule4.Table_papermanager.fieldbyname('sign').AsString+')';
  66. end;
  67. procedure Tpapermanageform.N2Click(Sender: TObject);
  68. begin
  69. Screen.Cursor:=crHourGlass;
  70.   try
  71.     print;
  72.     ShowMessage('打印完毕');
  73.   finally
  74.     Screen.Cursor:=crDefault;
  75.   end;
  76. end;
  77. procedure Tpapermanageform.N8Click(Sender: TObject);
  78. begin
  79. DBmemo1.CopyToClipboard;
  80. end;
  81. procedure Tpapermanageform.N4Click(Sender: TObject);
  82. begin
  83. DBmemo1.Undo;
  84. end;
  85. procedure Tpapermanageform.N7Click(Sender: TObject);
  86. begin
  87. DBmemo1.CutToClipboard;
  88. end;
  89.   {
  90. procedure Tpapermanageform.N10Click(Sender: TObject);
  91. begin
  92. memo1.SelectAll;
  93. papermanageform.N8.Enabled:=true;
  94. papermanageform.N9.Enabled:=true;
  95. end;
  96.       }
  97. procedure Tpapermanageform.EXT1Click(Sender: TObject);
  98. var
  99. filename:string;
  100. begin
  101. savedialog1.Title:='保存试卷';
  102. savedialog1.FileName:=fname;
  103. if savedialog1.Execute then
  104.    begin
  105.    filename:=savedialog1.FileName;
  106.    DBmemo1.Lines.SaveToFile(filename+'.rtf');
  107.    end;
  108. end;
  109. procedure Tpapermanageform.EXT2Click(Sender: TObject);
  110. var filename:string;
  111. begin
  112. savedialog1.Title:='保存试卷答案';
  113. savedialog1.FileName:=fname;
  114. if savedialog1.Execute then
  115.    begin
  116.    filename:=savedialog1.FileName;
  117.    DBmemo2.Lines.SaveToFile(filename+'.rtf');
  118.    end;
  119. end;
  120. end.