home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- vivrep20, Menus, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls, Db,
- DBTables, ImgList, ActnList, ComCtrls, ToolWin, ExtDlgs, jpeg;
-
- type
- TMainForm = class(TForm)
- MainMenu: TMainMenu;
- FilePrintItem: TMenuItem;
- FilePrintSetupItem: TMenuItem;
- FileExitItem: TMenuItem;
- HelpAboutItem: TMenuItem;
- Preview: TMenuItem;
- N1: TMenuItem;
- LoadPicture1: TMenuItem;
- ClearPicture1: TMenuItem;
- ImageList: TImageList;
- ActionList: TActionList;
- ExitAction: TAction;
- PrintSetupAction: TAction;
- PrintAction: TAction;
- PrintPreviewAction: TAction;
- AboutAction: TAction;
- LoadAction: TAction;
- ClearAction: TAction;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- ToolButton8: TToolButton;
- ToolButton9: TToolButton;
- ToolButton10: TToolButton;
- LoadButton: TSpeedButton;
- SpeedButton1: TSpeedButton;
- TargetsPanel: TPanel;
- FromPanel: TPanel;
- FromLabel: TLabel;
- NologoLabel: TLabel;
- TargetsLabel: TLabel;
- FromEdit: TMemo;
- LogoImage: TImage;
- TargetsGrid: TDBGrid;
- TargetsTable: TTable;
- TargetsSource: TDataSource;
- LoadDialog: TOpenPictureDialog;
-
- procedure ExitActionExecute(Sender: TObject);
- procedure AboutActionExecute(Sender: TObject);
- procedure PrintSetupActionExecute(Sender: TObject);
- procedure PrintActionExecute(Sender: TObject);
- procedure PrintPreviewActionExecute(Sender: TObject);
- procedure LoadActionExecute(Sender: TObject);
- procedure ClearActionExecute(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- constructor Create (AOwner: TComponent); override;
- end;
-
- var
- MainForm: TMainForm;
-
- implementation
-
- uses Rep, About;
-
- {$R *.DFM}
-
- constructor TMainForm.Create (AOwner: TComponent);
- begin
- inherited Create (AOwner);
- TargetsTable.Active:= true;
- end;
-
- procedure TMainForm.ExitActionExecute(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TMainForm.AboutActionExecute(Sender: TObject);
- begin
- AboutBox.ShowModal;
- end;
-
- procedure TMainForm.PrintSetupActionExecute(Sender: TObject);
- begin
- RepForm.VividReport.PrinterSetup;
- end;
-
- procedure TMainForm.PrintActionExecute(Sender: TObject);
- begin
- if RepForm.VividReport.PrintSetup then RepForm.VividReport.Print;
- end;
-
- procedure TMainForm.PrintPreviewActionExecute(Sender: TObject);
- begin
- RepForm.VividReport.PrintPreview (RepForm.VRPreview);
- end;
-
- procedure TMainForm.LoadActionExecute(Sender: TObject);
- begin
- if LoadDialog.Execute then
- LogoImage.Picture.LoadFromFile (LoadDialog.FileName);
- end;
-
- procedure TMainForm.ClearActionExecute(Sender: TObject);
- begin
- LogoImage.Picture.Assign (nil);
- end;
-
- end.
-