cdar
diff unit_Start.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_Start.pas Sun Dec 03 21:54:43 2006 +0100 1.3 @@ -0,0 +1,116 @@ 1.4 +unit unit_Start; 1.5 + 1.6 +interface//#################################################################################### 1.7 + 1.8 +uses 1.9 + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 1.10 + Dialogs, jpeg, ExtCtrls, StdCtrls, shellapi, ComCtrls, Buttons; 1.11 + 1.12 +type 1.13 + Tform_Start = class(TForm) 1.14 + img_Logo: TImage; 1.15 + img_Copyright: TImage; 1.16 + img_ThanksJuFo: TImage; 1.17 + btn_close: TBitBtn; 1.18 + btn_Editor: TBitBtn; 1.19 + img_Easteregg: TImage; 1.20 + License: TMemo; 1.21 + procedure FormCreate(Sender: TObject); 1.22 + procedure btn_CloseClick(Sender: TObject); 1.23 + procedure btn_EditorClick(Sender: TObject); 1.24 + procedure img_EastereggClick(Sender: TObject); 1.25 + private 1.26 + 1.27 + public 1.28 + 1.29 + end; 1.30 + 1.31 +var 1.32 + form_Start: Tform_Start; 1.33 + 1.34 + const ini = 'cdar.ini'; 1.35 + welcome = 'welcome.jpg'; 1.36 + enter = 'enter.jpg'; 1.37 + 1.38 + procedure shellexec(const Zielpfad :string); 1.39 + 1.40 +implementation//############################################################################### 1.41 +uses unit_Welcome, unit_Editor, modul_allgemein, unit_Easteregg; 1.42 +{$R *.dfm}//################################################################################### 1.43 + 1.44 +//------------------------------------------------------------------------------ Form Create 1.45 +procedure Tform_Start.FormCreate(Sender: TObject); 1.46 +begin 1.47 + // init 1.48 + form_start.Color := rgb(192,192,192); 1.49 + 1.50 + // command line parameters 1.51 + if lowercase(paramstr(1)) = 'editor' then // start editor 1.52 + begin 1.53 + application.CreateForm(tform_editor, form_editor); 1.54 + form_editor.Show; 1.55 + end 1.56 + else if lowercase(paramstr(1)) = 'welcome' then // show welcome screen 1.57 + begin 1.58 + application.CreateForm(tform_welcome, form_welcome); 1.59 + form_welcome.Show; 1.60 + end 1.61 + else if lowercase(paramstr(1)) = 'marmaro' then // easteregg ... bit boring in open source ;-) 1.62 + begin 1.63 + application.CreateForm(tform_easteregg, form_easteregg); 1.64 + form_easteregg.show; 1.65 + form_Start.hide; 1.66 + end 1.67 + else if lowercase(paramstr(1)) = '' then // about window 1.68 + begin 1.69 + // do nothing special 1.70 + end 1.71 + else // direct call 1.72 + begin 1.73 + shellexec(paramstr(1)); 1.74 + application.Terminate; 1.75 + end; 1.76 +end;//-------------------------------------------------------------------------- 1.77 + 1.78 +//############################################################################################# 1.79 + 1.80 +//------------------------------------------------------------------------------ kill 1.81 +procedure Tform_Start.btn_CloseClick(Sender: TObject); 1.82 +begin 1.83 + application.Terminate; 1.84 +end;//-------------------------------------------------------------------------- 1.85 +//------------------------------------------------------------------------------ editor 1.86 +procedure Tform_Start.btn_EditorClick(Sender: TObject); 1.87 +begin 1.88 + application.CreateForm(tform_editor, form_editor); 1.89 + form_Editor.show; 1.90 + form_Start.hide; 1.91 +end;//-------------------------------------------------------------------------- 1.92 + 1.93 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1.94 + 1.95 +//------------------------------------------------------------------------------ easteregg 1.96 +procedure Tform_Start.img_EastereggClick(Sender: TObject); 1.97 +begin 1.98 + application.CreateForm(tform_easteregg, form_easteregg); 1.99 + form_Easteregg.show; 1.100 + form_Start.hide; 1.101 +end;//-------------------------------------------------------------------------- 1.102 + 1.103 +//############################################################################################# 1.104 + 1.105 +//------------------------------------------------------------------------------ shellexec 1.106 +procedure shellexec(const Zielpfad :string); 1.107 +begin 1.108 + if zielpfad <> '..\-' then // '..\-' means 'no action' 1.109 + begin 1.110 + try 1.111 + ShellExecute(application.Handle, 'open', pchar(zielpfad), nil, nil, sw_shownormal); 1.112 + except 1.113 + showmessage('could not execute file or open dir'); 1.114 + end; 1.115 + end; 1.116 + application.Terminate; 1.117 +end;//-------------------------------------------------------------------------- 1.118 + 1.119 +end.//#########################################################################################