U DPR fajlu se najcesce nalaze reference i osnovni inicijalizacioni kod za forme
(DPR - Delphi PRoject), dok se u PAS fajlovima zaista i nalazi source.
Evo ga jedan DPR:
Code:
program Test;
uses
Forms,
TestMainForm in 'TestMainForm.pas' {Form1},
SplashScreen in 'SplashScreen.pas';
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Kao sto vidis to je samo kreiranje i poziv glavne forme, a prethodno, koje se PAS
datoteke nalaze u projektu...
dok je (deo) koda:
Code:
unit TestMainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, SplashScreen, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
TrackBar1: TTrackBar;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
type
TUpdateLayeredWindow = function(Handle: THandle; hdcDest: HDC; pptDst:
PPoint; _psize: PSize; hdcSrc: HDC; pptSrc: PPoint; crKey: COLORREF;
pblend: PBLENDFUNCTION; dwFlags: DWORD): Boolean; stdcall;
var
UpdateLayeredWindow: TUpdateLayeredWindow = nil;
procedure TForm1.Button1Click(Sender: TObject);
begin
if SplashScreenVisible then
begin
Label1.Enabled := False;
TrackBar1.Enabled := False;
Button1.Enabled := False;
HideSplashScreen;
Button1.Caption := 'Show the splash screen';
Button1.Enabled := True;
end
else
begin
Button1.Enabled := False;
ShowSplashScreen;
Button1.Caption := 'Hide the splash screen';
Label1.Enabled := True;
TrackBar1.Enabled := True;
Button1.Enabled := True;
end;
end;
... ITD ...