home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kolekce / d56 / DM2KVCL.ZIP / WKSDEMO / WKSDEMOU.PAS < prev   
Pascal/Delphi Source File  |  2000-11-26  |  3KB  |  94 lines

  1. {****************************************************************************}
  2. {                            Data Master 2000                                }
  3. {****************************************************************************}
  4. unit WksDemoU;
  5.  
  6. interface
  7.  
  8. uses
  9.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  10.   Data, Grids, WorkGrid, ExtCtrls, StdCtrls;
  11.  
  12. type
  13.   TWKSDemoForm = class(TForm)
  14.     Panel1: TPanel;
  15.     Worksheet: TWorksheet;
  16.     TitlesMemo: TMemo;
  17.     Label1: TLabel;
  18.     CopyTitlesButton: TButton;
  19.     AlignRightCheckBox: TCheckBox;
  20.     DrawHeadersCheckBox: TCheckBox;
  21.     CopyButton: TButton;
  22.     PasteButton: TButton;
  23.     InsLinesCheckBox: TCheckBox;
  24.     Container: TContainer;
  25.     DeleteButton: TButton;
  26.     OverwriteCheckBox: TCheckBox;
  27.     EditCheckBox: TCheckBox;
  28.     ModifiedCheckBox: TCheckBox;
  29.     procedure CopyTitlesButtonClick(Sender: TObject);
  30.     procedure AlignRightCheckBoxClick(Sender: TObject);
  31.     procedure DrawHeadersCheckBoxClick(Sender: TObject);
  32.     procedure CopyButtonClick(Sender: TObject);
  33.     procedure PasteButtonClick(Sender: TObject);
  34.     procedure DeleteButtonClick(Sender: TObject);
  35.     procedure EditCheckBoxClick(Sender: TObject);
  36.     procedure ContainerChanged(Sender: TObject);
  37.   private
  38.     { Private declarations }
  39.   public
  40.     { Public declarations }
  41.   end;
  42.  
  43. var
  44.   WKSDemoForm: TWKSDemoForm;
  45.  
  46. implementation
  47.  
  48. {$R *.DFM}
  49.  
  50. procedure TWKSDemoForm.CopyTitlesButtonClick(Sender: TObject);
  51. begin
  52.   Worksheet.Header.Assign(TitlesMemo.Lines);
  53. end;
  54.  
  55. procedure TWKSDemoForm.AlignRightCheckBoxClick(Sender: TObject);
  56. begin
  57.   Worksheet.AlignRight:=AlignRightCheckBox.Checked;
  58. end;
  59.  
  60. procedure TWKSDemoForm.DrawHeadersCheckBoxClick(Sender: TObject);
  61. begin
  62.   Worksheet.DrawHeaders:=DrawHeadersCheckBox.Checked;
  63. end;
  64.  
  65. procedure TWKSDemoForm.CopyButtonClick(Sender: TObject);
  66. begin
  67.   Worksheet.CopyToClipBoard(true);
  68. end;
  69.  
  70. procedure TWKSDemoForm.PasteButtonClick(Sender: TObject);
  71. begin
  72.   Worksheet.PasteFromClipBoard(InsLinesCheckBox.Checked,
  73.   OverwriteCheckBox.Checked);
  74. end;
  75.  
  76. procedure TWKSDemoForm.DeleteButtonClick(Sender: TObject);
  77. begin
  78.   Worksheet.Delete;
  79. end;
  80.  
  81. procedure TWKSDemoForm.EditCheckBoxClick(Sender: TObject);
  82. begin
  83.   if EditCheckBox.Checked
  84.   then Worksheet.Options:=Worksheet.Options+[goEditing]
  85.   else Worksheet.Options:=Worksheet.Options-[goEditing];
  86. end;
  87.  
  88. procedure TWKSDemoForm.ContainerChanged(Sender: TObject);
  89. begin
  90.   ModifiedCheckBox.Checked:=true;
  91. end;
  92.  
  93. end.
  94.