cdar
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/unit_Welcome.pas Sun Dec 03 21:54:43 2006 +0100 1.3 @@ -0,0 +1,126 @@ 1.4 +unit unit_Welcome; 1.5 + 1.6 +interface//#################################################################################### 1.7 + 1.8 +uses 1.9 + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 1.10 + Dialogs, ExtCtrls, shellapi, jpeg; 1.11 + 1.12 +type 1.13 + Tform_Welcome = class(TForm) 1.14 + img_Background: TImage; 1.15 + img_Enter: TImage; 1.16 + timer_delay: TTimer; 1.17 + procedure FormClose(Sender: TObject; var Action: TCloseAction); 1.18 + procedure img_EnterClick(Sender: TObject); 1.19 + procedure FormCreate(Sender: TObject); 1.20 + procedure timer_delayTimer(Sender: TObject); 1.21 + private 1.22 + 1.23 + public 1.24 + Zielpfad : string; 1.25 + end; 1.26 + 1.27 +var 1.28 + form_Welcome: Tform_Welcome; 1.29 + 1.30 +implementation//############################################################################### 1.31 +uses unit_Start, modul_allgemein; 1.32 +{$R *.dfm}//################################################################################### 1.33 + 1.34 +// Forwardings 1.35 + procedure ClickEnter(const x_enter:string; const y_enter:string; const zielpfad:string); forward; 1.36 + procedure Time(const delay :string; const zielpfad:string); forward; 1.37 + procedure None(const zielpfad:string); forward; 1.38 + 1.39 +//------------------------------------------------------------------------------ Form create 1.40 +procedure Tform_Welcome.FormCreate(Sender: TObject); 1.41 + var txtfile : textfile; 1.42 + showscreentill : string; 1.43 + delay : string; 1.44 + x_enter : string; 1.45 + y_enter : string; 1.46 + //Zielpfad : string; 1.47 + begin 1.48 + // Form immer im Vordergrund 1.49 + SetWindowPos(handle, HWND_TopMost, left, top, width, height, SWP_ShowWindow); 1.50 + 1.51 + //Daten aus ini laden 1.52 + assignfile (txtfile, fktcmd(0) + ini); 1.53 + reset (txtfile); 1.54 + readln (txtfile, showscreentill); 1.55 + readln (txtfile, delay); 1.56 + readln (txtfile, x_enter); 1.57 + readln (txtfile, y_enter); 1.58 + readln (txtfile, zielpfad); 1.59 + closefile (txtfile); 1.60 + //Fallunterscheidung 1.61 + if showscreentill = 'click' then 1.62 + begin 1.63 + clickenter(x_enter, y_enter, zielpfad); 1.64 + end 1.65 + else if showscreentill = 'time' then 1.66 + begin 1.67 + time(delay,zielpfad); 1.68 + end 1.69 + else if showscreentill = 'none' then 1.70 + begin 1.71 + none(zielpfad); 1.72 + end; 1.73 +end;//-------------------------------------------------------------------------- 1.74 +//------------------------------------------------------------------------------ Form close 1.75 +procedure Tform_Welcome.FormClose(Sender: TObject; 1.76 + var Action: TCloseAction); 1.77 +begin 1.78 + // ShellExec trotzdem ausführen 1.79 + shellexec(zielpfad); 1.80 +end;//-------------------------------------------------------------------------- 1.81 + 1.82 +//############################################################################################# 1.83 + 1.84 +//------------------------------------------------------------------------------ Klick Enter 1.85 +procedure Tform_Welcome.img_EnterClick(Sender: TObject); 1.86 +begin 1.87 + shellexec(zielpfad); 1.88 +end;//-------------------------------------------------------------------------- 1.89 + 1.90 +//------------------------------------------------------------------------------ Delay vorbei 1.91 +procedure Tform_Welcome.timer_delayTimer(Sender: TObject); 1.92 +begin 1.93 + shellexec(Zielpfad); 1.94 +end;//-------------------------------------------------------------------------- 1.95 + 1.96 +//############################################################################################# 1.97 + 1.98 +//------------------------------------------------------------------------------ Klick ini 1.99 +procedure ClickEnter(const x_enter:string; const y_enter:string; const zielpfad:string); 1.100 +begin 1.101 + form_welcome.img_Enter.Picture.LoadFromFile(fktcmd(0) + enter); 1.102 + // Nur wenn das Enter-Bild <> 600x450 dann HG-Bild 1.103 + if form_welcome.img_enter.Width <> form_welcome.img_Background.Width then 1.104 + begin 1.105 + if form_welcome.img_enter.Height <> form_welcome.img_Background.Height then 1.106 + begin 1.107 + form_welcome.img_Background.picture.loadfromfile(fktcmd(0) + welcome); 1.108 + end 1.109 + end; 1.110 + form_welcome.img_Enter.Left := strtoint(x_enter); 1.111 + form_welcome.img_Enter.top := strtoint(y_enter); 1.112 +end;//-------------------------------------------------------------------------- 1.113 + 1.114 +//------------------------------------------------------------------------------ Time ini 1.115 +procedure Time(const delay :string; const zielpfad:string); 1.116 +begin 1.117 + form_welcome.img_Background.picture.loadfromfile(fktcmd(0) + welcome); 1.118 + form_welcome.img_Enter.Enabled := false; 1.119 + form_welcome.timer_delay.Interval := strtoint(delay) * 1000; 1.120 + form_welcome.timer_delay.Enabled := true; 1.121 +end;//-------------------------------------------------------------------------- 1.122 + 1.123 +//------------------------------------------------------------------------------ Direktaufruf 1.124 +procedure None(const zielpfad:string); 1.125 +begin 1.126 + shellexec(zielpfad); 1.127 +end;//-------------------------------------------------------------------------- 1.128 + 1.129 +end.//#########################################################################################