File: CastleMessages.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (470 lines) | stat: -rw-r--r-- 41,038 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleMessages</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<h1 class="unit">Unit CastleMessages</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Uses">Uses</a></td><td>Classes, Interfaces, Objects and Records</td><td><a class="section" href="#PasDoc-FuncsProcs">Functions and Procedures</a></td><td><a class="section" href="#PasDoc-Types">Types</a></td><td><a class="section" href="#PasDoc-Constants">Constants</a></td><td>Variables</td></tr></table>
<a name="PasDoc-Description"></a><h2 class="description">Description</h2>
<p>
Dialog windows (asking user for confirmation, question, simple text input and such) displayed within an OpenGL context (<a class="normal" href="CastleWindow.TCastleWindow.html">TCastleWindow</a> or <a class="normal" href="CastleControl.TCastleControl.html">TCastleControl</a>).

<p>Features:

<p></p>

<ul class="paragraph_spacing">
  <li><p>All the MessageXxx routines display a modal dialog. They return only when the user accepted / answered the dialog box. This way they are comfortable to use anywhere in your program.</p></li>
  <li><p>MessageInputXxx family of functions ask user to enter some text.</p></li>
  <li><p>All the dialog boxes have vertical scroll bar, displayed when needed. So it's OK to use really long text. Scroll bar can be operated with keys (up/down, ctrl+up/down, page up/down, home/end) and mouse (drag the scroll bar, or click below/above it).</p></li>
  <li><p>Long text lines are automatically broken. So it's OK to use text with long lines. We will try to break text only at whitespace.

<p>If you pass a text as a single string parameter, then our &quot;line breaking&quot; works correctly even for text that already contains newline characters (they are correctly recognized as forcing line break).

<p>If you pass a text as an &quot;array of string&quot; or TStringList, it's expected that strings inside don't contain newline characters anymore. It's undefined what will happen (i.e. whether they will be correctly broken) otherwise. Of course, TStringList contents used to pass text to MessageXxx will never be modified in any way.</p></li>
  <li><p>User is allowed to resize the window while MessageXxx works. (As long as <a class="normal" href="CastleWindow.TCastleWindowCustom.html#ResizeAllowed">TCastleWindowCustom.ResizeAllowed</a> = raAllowed, of course.) Long lines are automatically broken taking into account current window width.</p></li>
  <li><p>You can configure dialog boxes look using <a class="normal" href="CastleControls.TCastleTheme.html">TCastleTheme</a>. Various parts of the dialog use scaled images. This way you can change the border, background of the dialog, you can also make the dialog box partially transparent.</p></li>
</ul>

<p>

<p>Call MessageXxx functions only when Window.Closed = false. Note that MessageXxx will do Window.MakeCurrent (probably more than once). Calling MessageXxx requires one free place on OpenGL attrib stack.

<p>Notes about implementation:

<p></p>

<ul class="paragraph_spacing">
  <li><p>We temporary replace normal window callbacks and controls using <a class="normal" href="CastleWindowModes.TGLMode.html">TGLMode</a>. This allows you to call MessageXxx procedures in any place of your program, and things will just work, the MessageXxx will return only once user answers the dialog box.</p></li>
  <li><p>Be careful if you use <a class="normal" href="CastleWindow.TCastleApplication.html#OnUpdate">TCastleApplication.OnUpdate</a> or <a class="normal" href="CastleWindow.TCastleApplication.html#OnTimer">TCastleApplication.OnTimer</a>. As these events are not tied to a particular window, they continue to work even while we're inside MessageXxx procedure. Be sure to implement them such that they make sense also when we're inside a dialog box.

<p>In particular, remember that you cannot close the Window when the message box in running. So do not blindly call <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Close">TCastleWindowCustom.Close</a> from <a class="normal" href="CastleWindow.TCastleApplication.html">TCastleApplication</a> callbacks. </p></li>
  <li><p>Since your normal callbacks and controls are not run when message box is running, you usually don't need to do anything special about it, unless you use <a class="normal" href="CastleWindow.TCastleApplication.html">TCastleApplication</a> callbacks mentioned above.</p></li>
</ul>

<p></p>
<a name="PasDoc-Uses"></a><h2 class="uses">Uses</h2>
<ul class="useslist"><li>Classes</li><li><a  href="CastleWindow.html">CastleWindow</a></li><li><a  href="CastleGLUtils.html">CastleGLUtils</a></li><li><a  href="CastleUtils.html">CastleUtils</a></li><li><a  href="CastleStringUtils.html">CastleStringUtils</a></li><li><a  href="CastleVectors.html">CastleVectors</a></li><li><a  href="CastleKeysMouse.html">CastleKeysMouse</a></li><li><a  href="CastleControls.html">CastleControls</a></li><li><a  href="CastleRectangles.html">CastleRectangles</a></li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-FuncsProcs"></a><h3 class="summary">Functions and Procedures</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code>procedure <b><a  href="CastleMessages.html#MessageOK">MessageOK</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>procedure <b><a  href="CastleMessages.html#MessageOK">MessageOK</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>procedure <b><a  href="CastleMessages.html#MessageOK">MessageOK</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInput">MessageInput</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const answerDefault: string = ''; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): string; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInput">MessageInput</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const answerDefault: string = ''; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): string; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; var answer: string; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; var answer: string; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageChoice">MessageChoice</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageChoice">MessageChoice</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageChoice">MessageChoice</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageKey">MessageKey</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const S: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageKey">MessageKey</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageKey">MessageKey</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>procedure <b><a  href="CastleMessages.html#MessageKeyMouse">MessageKeyMouse</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const S: string; out Event: <a  href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>procedure <b><a  href="CastleMessages.html#MessageKeyMouse">MessageKeyMouse</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; out Event: <a  href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageYesNo">MessageYesNo</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageYesNo">MessageYesNo</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageYesNo">MessageYesNo</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputCardinal">MessageInputCardinal</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const AnswerDefault: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): Cardinal; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputCardinal">MessageInputCardinal</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const AnswerDefault: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): Cardinal; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQueryCardinal">MessageInputQueryCardinal</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQueryCardinalHex">MessageInputQueryCardinalHex</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Cardinal; const MaxWidth: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Extended; const ValueAsString: string = ''; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a></b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Single; const ValueAsString: string = ''; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQueryVector3Single">MessageInputQueryVector3Single</a></b>( Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleMessages.html#MessageInputQueryVector4Single">MessageInputQueryVector4Single</a></b>( Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
</table>
<a name="PasDoc-Types"></a><h3 class="summary">Types</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleMessages.html#TTextAlign">TTextAlign</a></b> = <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> deprecated;</code></td>
</tr>
</table>
<a name="PasDoc-Constants"></a><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a></b> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleMessages.html#taRight">taRight</a></b> = <a  href="CastleUIControls.html#hpRight">hpRight</a> deprecated;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleMessages.html#taMiddle">taMiddle</a></b> = <a  href="CastleUIControls.html#hpMiddle">hpMiddle</a> deprecated;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleMessages.html#taLeft">taLeft</a></b> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a> deprecated;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Functions and Procedures</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageOK"></a><code>procedure <b>MessageOK</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user for simple confirmation. This is the simplest &quot;OK&quot; dialog box.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageOK"></a><code>procedure <b>MessageOK</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageOK"></a><code>procedure <b>MessageOK</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInput"></a><code>function <b>MessageInput</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const answerDefault: string = ''; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): string; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to input a string. User must give an answer (there is no &quot;Cancel&quot; button), use <a class="normal" href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a> if you want a version with &quot;Cancel&quot; button. 

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AnswerMaxLen</dt>
<dd>0 (zero) means that there's no maximum answer length.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInput"></a><code>function <b>MessageInput</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const answerDefault: string = ''; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): string; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQuery"></a><code>function <b>MessageInputQuery</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; var answer: string; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to input a string, or cancel. Returns <code>True</code> and sets Answer if user accepted some text. Note that initial Answer value is the answer proposed to the user. 

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AnswerMaxLen</dt>
<dd>0 (zero) means that there's no maximum answer length.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQuery"></a><code>function <b>MessageInputQuery</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; var answer: string; const answerMinLen: integer = 0; const answerMaxLen: integer = 0; const answerAllowedChars: <a  href="CastleStringUtils.html#TSetOfChars">TSetOfChars</a> = <a  href="CastleStringUtils.html#AllChars">AllChars</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageChoice"></a><code>function <b>MessageChoice</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to choose one option from many. Buttons contain a list of button captions.

<p>ButtonsChars (must have always the same length as Buttons) contains the chars that are returned for each corresponding button press. The user can also directly press the given key. ButtonsChars is not case sensitive, all letters on this list must be different (not only in case). We always return a lowercase letter corresponding to one of ButtonsChars letters.

<p>Example usage:

<p></p>

<pre class="longcode">
<span class="pascal_keyword">case</span> MessageChoice(Window, <span class="pascal_string">'Which fruit to you want to eat?'</span>,
  [<span class="pascal_string">'Apple'</span>, <span class="pascal_string">'Banana'</span>, <span class="pascal_string">'Cancel'</span>],
  [<span class="pascal_string">'a'</span>, <span class="pascal_string">'b'</span>, CharEscape]) <span class="pascal_keyword">of</span>
  <span class="pascal_string">'a'</span>: <span class="pascal_comment">// ... user pressed &quot;Apple&quot; button or &quot;A&quot; key -&gt; likes apples</span>
  <span class="pascal_string">'b'</span>: <span class="pascal_comment">// ... user pressed &quot;Banana&quot; button or &quot;B&quot; key -&gt; likes bananas</span>
  CharEscape: <span class="pascal_comment">// ... user pressed &quot;Cancel&quot; button or &quot;Escape&quot; key -&gt; cancelled</span>
<span class="pascal_keyword">end</span>;
</pre>

<p>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageChoice"></a><code>function <b>MessageChoice</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageChoice"></a><code>function <b>MessageChoice</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const Buttons: array of string; const ButtonsChars: array of char; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): char; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageKey"></a><code>function <b>MessageKey</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const S: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to press any key, return this key as Keys.TKey.

<p>Never returns K_None (which means that keys that cannot be interpreted as Keys.TKey will be ignored, and will not close the dialog box).

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageKey"></a><code>function <b>MessageKey</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageKey"></a><code>function <b>MessageKey</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): <a  href="CastleKeysMouse.html#TKey">TKey</a>; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageKeyMouse"></a><code>procedure <b>MessageKeyMouse</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const S: string; out Event: <a  href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to press any key or mouse button or mouse wheel, and return it. The natural use for this is to allow user to configure keybindings of your program, like for <a class="normal" href="CastleInputs.TInputShortcut.html">TInputShortcut</a>. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageKeyMouse"></a><code>procedure <b>MessageKeyMouse</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; out Event: <a  href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>); overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageYesNo"></a><code>function <b>MessageYesNo</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageYesNo"></a><code>function <b>MessageYesNo</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const SArray: array of string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageYesNo"></a><code>function <b>MessageYesNo</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; TextList: TStringList; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputCardinal"></a><code>function <b>MessageInputCardinal</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const AnswerDefault: string; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): Cardinal; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to input an unsigned integer.

<p>Note that AnswerDefault below may be given as Cardinal or as a string. The latter is useful if you want the default answer to be '', i.e. empty string &mdash; no default answer.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputCardinal"></a><code>function <b>MessageInputCardinal</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const s: string; const AnswerDefault: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): Cardinal; overload;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQueryCardinal"></a><code>function <b>MessageInputQueryCardinal</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQueryCardinalHex"></a><code>function <b>MessageInputQueryCardinalHex</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Cardinal; const MaxWidth: Cardinal; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to input a value in hexadecimal. Give MaxWidth = 0 to say that there is no maximum width.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQuery"></a><code>function <b>MessageInputQuery</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Extended; const ValueAsString: string = ''; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Ask user to input a floating-point number.

<p>If you give non-empty ValueAsString, it will be used to show the initial value for the user. Otherwise, we will just show FloatToStr(Value), which sometimes may be too ugly. For example Value = 0.01 cannot be precisely represented as a floating point number, and FloatToStr shows that this is really something like 0.0099xxxxx.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQuery"></a><code>function <b>MessageInputQuery</b>(Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: Single; const ValueAsString: string = ''; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQueryVector3Single"></a><code>function <b>MessageInputQueryVector3Single</b>( Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MessageInputQueryVector4Single"></a><code>function <b>MessageInputQueryVector4Single</b>( Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>; const Title: string; var Value: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>; const TextAlign: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleMessages.html#DefaultAlign">DefaultAlign</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<h3 class="detail">Types</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTextAlign"></a><code><b>TTextAlign</b> = <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p><p>
Position of text in message dialogs. Deprecated, use <a class="normal" href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> instead.</p>
</td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefaultAlign"></a><code><b>DefaultAlign</b> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="taRight"></a><code><b>taRight</b> = <a  href="CastleUIControls.html#hpRight">hpRight</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="taMiddle"></a><code><b>taMiddle</b> = <a  href="CastleUIControls.html#hpMiddle">hpMiddle</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="taLeft"></a><code><b>taLeft</b> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:10</em>
</span>
</td></tr></table></body></html>