cdar

view unit_Welcome.pas @ 0:ef71164288c1

begin of using hg for cdar
author "Meillo r e t u r n s <meillo@marmaro.de>"
date Sun, 03 Dec 2006 21:54:43 +0100
parents
children
line source
1 unit unit_Welcome;
3 interface//####################################################################################
5 uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, ExtCtrls, shellapi, jpeg;
9 type
10 Tform_Welcome = class(TForm)
11 img_Background: TImage;
12 img_Enter: TImage;
13 timer_delay: TTimer;
14 procedure FormClose(Sender: TObject; var Action: TCloseAction);
15 procedure img_EnterClick(Sender: TObject);
16 procedure FormCreate(Sender: TObject);
17 procedure timer_delayTimer(Sender: TObject);
18 private
20 public
21 Zielpfad : string;
22 end;
24 var
25 form_Welcome: Tform_Welcome;
27 implementation//###############################################################################
28 uses unit_Start, modul_allgemein;
29 {$R *.dfm}//###################################################################################
31 // Forwardings
32 procedure ClickEnter(const x_enter:string; const y_enter:string; const zielpfad:string); forward;
33 procedure Time(const delay :string; const zielpfad:string); forward;
34 procedure None(const zielpfad:string); forward;
36 //------------------------------------------------------------------------------ Form create
37 procedure Tform_Welcome.FormCreate(Sender: TObject);
38 var txtfile : textfile;
39 showscreentill : string;
40 delay : string;
41 x_enter : string;
42 y_enter : string;
43 //Zielpfad : string;
44 begin
45 // Form immer im Vordergrund
46 SetWindowPos(handle, HWND_TopMost, left, top, width, height, SWP_ShowWindow);
48 //Daten aus ini laden
49 assignfile (txtfile, fktcmd(0) + ini);
50 reset (txtfile);
51 readln (txtfile, showscreentill);
52 readln (txtfile, delay);
53 readln (txtfile, x_enter);
54 readln (txtfile, y_enter);
55 readln (txtfile, zielpfad);
56 closefile (txtfile);
57 //Fallunterscheidung
58 if showscreentill = 'click' then
59 begin
60 clickenter(x_enter, y_enter, zielpfad);
61 end
62 else if showscreentill = 'time' then
63 begin
64 time(delay,zielpfad);
65 end
66 else if showscreentill = 'none' then
67 begin
68 none(zielpfad);
69 end;
70 end;//--------------------------------------------------------------------------
71 //------------------------------------------------------------------------------ Form close
72 procedure Tform_Welcome.FormClose(Sender: TObject;
73 var Action: TCloseAction);
74 begin
75 // ShellExec trotzdem ausführen
76 shellexec(zielpfad);
77 end;//--------------------------------------------------------------------------
79 //#############################################################################################
81 //------------------------------------------------------------------------------ Klick Enter
82 procedure Tform_Welcome.img_EnterClick(Sender: TObject);
83 begin
84 shellexec(zielpfad);
85 end;//--------------------------------------------------------------------------
87 //------------------------------------------------------------------------------ Delay vorbei
88 procedure Tform_Welcome.timer_delayTimer(Sender: TObject);
89 begin
90 shellexec(Zielpfad);
91 end;//--------------------------------------------------------------------------
93 //#############################################################################################
95 //------------------------------------------------------------------------------ Klick ini
96 procedure ClickEnter(const x_enter:string; const y_enter:string; const zielpfad:string);
97 begin
98 form_welcome.img_Enter.Picture.LoadFromFile(fktcmd(0) + enter);
99 // Nur wenn das Enter-Bild <> 600x450 dann HG-Bild
100 if form_welcome.img_enter.Width <> form_welcome.img_Background.Width then
101 begin
102 if form_welcome.img_enter.Height <> form_welcome.img_Background.Height then
103 begin
104 form_welcome.img_Background.picture.loadfromfile(fktcmd(0) + welcome);
105 end
106 end;
107 form_welcome.img_Enter.Left := strtoint(x_enter);
108 form_welcome.img_Enter.top := strtoint(y_enter);
109 end;//--------------------------------------------------------------------------
111 //------------------------------------------------------------------------------ Time ini
112 procedure Time(const delay :string; const zielpfad:string);
113 begin
114 form_welcome.img_Background.picture.loadfromfile(fktcmd(0) + welcome);
115 form_welcome.img_Enter.Enabled := false;
116 form_welcome.timer_delay.Interval := strtoint(delay) * 1000;
117 form_welcome.timer_delay.Enabled := true;
118 end;//--------------------------------------------------------------------------
120 //------------------------------------------------------------------------------ Direktaufruf
121 procedure None(const zielpfad:string);
122 begin
123 shellexec(zielpfad);
124 end;//--------------------------------------------------------------------------
126 end.//#########################################################################################