cdar
view unit_Editor.pas @ 1:87b91371db05
removed files from hg-test
author | "Meillo r e t u r n s <meillo@marmaro.de>" |
---|---|
date | Sun, 03 Dec 2006 21:56:21 +0100 |
parents | |
children |
line source
1 unit unit_Editor;
3 interface//####################################################################################
5 uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, Menus, ExtCtrls, Buttons, StdCtrls;
9 type
10 Tform_Editor = class(TForm)
11 mnu_Main: TMainMenu;
12 mnu_tutorial: TMenuItem;
13 mnu_WelcomeScreen: TMenuItem;
14 mnu_Autorun: TMenuItem;
15 mnu_CreateAR: TMenuItem;
16 img_Background: TImage;
17 img_button: TImage;
18 mnu_nzl: TMenuItem;
19 mnu_Sprache: TMenuItem;
20 procedure FormClose(Sender: TObject; var Action: TCloseAction);
21 procedure FormCreate(Sender: TObject);
22 procedure mnu_tutorialClick(Sender: TObject);
23 procedure mnu_WelcomeScreenClick(Sender: TObject);
24 procedure mnu_AutorunClick(Sender: TObject);
25 procedure mnu_CreateARClick(Sender: TObject);
26 procedure img_buttonMouseDown(Sender: TObject; Button: TMouseButton;
27 Shift: TShiftState; X, Y: Integer);
28 procedure img_buttonMouseMove(Sender: TObject; Shift: TShiftState; X,
29 Y: Integer);
30 procedure img_buttonMouseUp(Sender: TObject; Button: TMouseButton;
31 Shift: TShiftState; X, Y: Integer);
32 procedure mnu_SpracheClick(Sender: TObject);
34 private
35 dX : integer;
36 dY : integer;
37 public
38 DraggingStatus : byte;
40 PfadHG_neu : String; // 'C:\'
41 PfadEnter_neu : String; // 'C:\'
42 PfadIcon_neu : string;
43 CDRoot_neu : string;
44 xEnter_neu : integer; // '225'
45 yEnter_neu : integer; // '325'
46 WelcomeKind_neu : String; // 'click' 'time' 'none'
47 Delay_neu : byte; // '3000' (in ms)
48 StartsFD_neu : string;
50 PfadHG_alt : String;
51 PfadEnter_alt : String;
52 PfadIcon_alt : string;
53 CDRoot_alt : string;
54 xEnter_alt : integer;
55 yEnter_alt : integer;
56 WelcomeKind_alt : String;
57 Delay_alt : byte;
58 StartsFD_alt : string;
60 Delay : string;
61 englisch : boolean;
62 end;
64 var
65 form_Editor: Tform_Editor;
67 implementation//###############################################################################
68 uses unit_Start, unit_Welcome, unit_Editor_ws, unit_Editor_as,
69 unit_Editor_tutorial, unit_Editor_CreateAR;
70 {$R *.dfm}//###################################################################################
72 //------------------------------------------------------------------------------ form create
73 procedure Tform_Editor.FormCreate(Sender: TObject);
74 begin
75 // close form 'start'
76 form_start.Hide;
78 // init global vars
79 PfadHG_alt := '';
80 PfadEnter_alt := '';
81 PfadIcon_alt := '';
82 CDRoot_alt := 'C:\NewCD\';
83 xEnter_alt := 0;
84 yEnter_alt := 0;
85 WelcomeKind_alt := 'click';
86 Delay_alt := 2;
87 StartsFD_alt := '';
88 Delay := '3';
89 englisch := true;
91 // background color
92 form_editor.Color := rgb(192,192,192);
93 // dragging dtatus = 0
94 DraggingStatus := 0;
95 end;//--------------------------------------------------------------------------
96 //------------------------------------------------------------------------------ kill
97 procedure Tform_Editor.FormClose(Sender: TObject;
98 var Action: TCloseAction);
99 begin
100 application.Terminate;
101 end;//--------------------------------------------------------------------------
103 //#############################################################################################
105 //------------------------------------------------------------------------------ tutorial
106 procedure Tform_Editor.mnu_tutorialClick(Sender: TObject);
107 begin
108 application.CreateForm(tform_editor_tutorial, form_editor_tutorial);
109 form_editor_tutorial.show;
110 end;//--------------------------------------------------------------------------
111 //------------------------------------------------------------------------------ welcome settings
112 procedure Tform_Editor.mnu_WelcomeScreenClick(Sender: TObject);
113 begin
114 application.CreateForm(tform_editor_ws, form_editor_ws);
115 form_editor_ws.show;
116 end;//--------------------------------------------------------------------------
117 //------------------------------------------------------------------------------ autorun settings
118 procedure Tform_Editor.mnu_AutorunClick(Sender: TObject);
119 begin
120 application.CreateForm(tform_editor_as, form_editor_as);
121 form_editor_as.show;
122 end;//--------------------------------------------------------------------------
123 //------------------------------------------------------------------------------ create settings
124 procedure Tform_Editor.mnu_CreateARClick(Sender: TObject);
125 begin
126 application.CreateForm(tform_editor_CreateAR, form_editor_CreateAR);
127 form_editor_CreateAR.show;
128 end;//--------------------------------------------------------------------------
129 //------------------------------------------------------------------------------ toggle language
130 procedure Tform_Editor.mnu_SpracheClick(Sender: TObject);
131 begin
132 if englisch = true then
133 begin
134 englisch := false;
135 mnu_sprache.caption := ' -> English '; // German
136 mnu_Tutorial.Caption := ' Anleitung ';
137 mnu_WelcomeScreen.Caption := ' Begrüßungsbild Optionen ';
138 mnu_Autorun.Caption := ' Autorun Optionen ';
139 mnu_CreateAR.Caption := ' Autorunner erstellen ';
140 end
141 else
142 begin
143 englisch := true;
144 mnu_sprache.Caption := ' -> Deutsch '; // English
145 mnu_Tutorial.Caption := ' Tutorial ';
146 mnu_WelcomeScreen.Caption := ' Welcome-Screen Settings ';
147 mnu_Autorun.Caption := ' Autorun Settings ';
148 mnu_CreateAR.Caption := ' Create CD-Autorunner ';
149 end;
150 end;//--------------------------------------------------------------------------
152 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
154 //------------------------------------------------------------------------------ // mouse down
155 procedure Tform_Editor.img_buttonMouseDown(Sender: TObject;
156 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
157 var MouseArea : trect;
158 begin
159 // right drag'n'drop status needed
160 if DraggingStatus <> 0 then exit;
161 // remember cursor position on 'img_button'
162 dX := x;
163 dY := y;
164 // jail mouse in mousearea
165 mousearea.Left := form_editor.Left + dX + 3;
166 mousearea.Right := form_editor.Left + form_editor.Width - (img_button.Width - dX + 2);
167 mousearea.Top := form_editor.Top + dY + 41;
168 mousearea.Bottom := form_editor.Top + form_editor.Height - (img_button.Height - dY +2);
169 clipcursor(@mousearea);
170 // set drag'n'drop status
171 DraggingStatus := 1;
172 end;//--------------------------------------------------------------------------
173 //------------------------------------------------------------------------------ // mouse move
174 procedure Tform_Editor.img_buttonMouseMove(Sender: TObject;
175 Shift: TShiftState; X, Y: Integer);
176 begin
177 // right drag'n'drop status needed
178 if (DraggingStatus = 0) or (draggingstatus = 3) then exit;
179 // drag
180 img_button.Left := img_button.Left + (x - dX);
181 img_button.Top := img_button.Top + (y - dY);
182 // set drag'n'drop status
183 DraggingStatus := 2;
184 end;//--------------------------------------------------------------------------
185 //------------------------------------------------------------------------------ // mouse up
186 procedure Tform_Editor.img_buttonMouseUp(Sender: TObject;
187 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
188 begin
189 // right drag'n'drop status needed
190 if DraggingStatus <> 2 then exit;
191 // free cursor from jail
192 clipcursor(nil);
193 // set 'img_button' coordinated
194 xEnter_alt := img_button.left;
195 yEnter_alt := img_button.top;
196 // set drag'n'drop status
197 DraggingStatus := 0;
198 end;//--------------------------------------------------------------------------
200 end.//#########################################################################################