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
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Documentation for LCL (Lazarus Component Library) and LazUtils (Lazarus
Utilities) are published under the Creative Commons Attribution-ShareAlike 4.0
International public license.
https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/docs/cc-by-sa-4-0.txt
Copyright (c) 1997-2025, by the Lazarus Development Team.
-->
<fpdoc-descriptions>
<package name="LCL">
<!--
====================================================================
TimePopup
====================================================================
-->
<module name="TimePopup">
<short>
Contains forms, types, and routines used to display a pop-up for TTimeEdit.
</short>
<descr>
<p>
<file>timepopup.pas</file> contains the <var>TTimePopupForm</var> form and
the <var>ShowTimePopup</var> routine used to create, configure, and display
the pop-up form.
</p>
<p>
Author: Michael Fuchs
</p>
</descr>
<!-- used untis -->
<element name="System"/>
<element name="Classes"/>
<element name="SysUtils"/>
<element name="DateUtils"/>
<element name="FileUtil"/>
<element name="LCLType"/>
<element name="Forms"/>
<element name="Controls"/>
<element name="Graphics"/>
<element name="Dialogs"/>
<element name="Grids"/>
<element name="ExtCtrls"/>
<element name="Buttons"/>
<element name="StdCtrls"/>
<element name="ActnList"/>
<element name="WSForms"/>
<element name="TReturnTimeEvent">
<short>
Specifies an event handler signalled to get a time return value.
</short>
<descr>
<p>
<var>TReturnTimeEvent</var> specifies an event handler signalled to validate
or assign a time value. It is an object procedure which must be implemented
in an application to respond to the event notification.
</p>
<p>
<var>Sender</var> is the object generating the event notification.
</p>
<p>
<var>ATime</var> is a <var>TDateTime</var> value which contains the time
value used in the event handler. Only the time portion of the type is
significant.
</p>
<p>
<var>TReturnTimeEvent</var> is the type passed as an argument to the
<var>ShowTimePopup</var> routine, and implemented as a private member in
<var> TTimePopupForm</var>.
</p>
</descr>
<seealso>
<link id="TTimePopupForm"/>
<link id="ShowTimePopup"/>
</seealso>
</element>
<element name="TReturnTimeEvent.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TReturnTimeEvent.ATime">
<short>Time value examined or updated in the event handler.</short>
</element>
<element name="TTimePopupForm">
<short>Implements a form displayed to capture a time value.</short>
<descr>
<p>
<var>TTimePopupForm</var> implements a form displayed to capture and return a
time value.
</p>
<p>
The form contains grids with Hour and Minute values which can be selected to
form the time value. The Minutes displayed in the grid are in either 5 minute
or 30 minute intervals, depending on the layout selected using the
<var>SetLayout</var> method; Simple layout uses a 5 minute interval and is
the default layout for the form.
</p>
<p>
It uses an internal <var>TReturnTimeEvent</var> handler to validate or update
the time value. There are also internal members used to track the control
associated with the form, and the coordinates where the form is displayed.
These internals are assigned using values passed as arguments to the
<var>ShowTimePopup</var> routine.
</p>
</descr>
<seealso>
<link id="ShowTimePopup"/>
<link id="TReturnTimeEvent"/>
<link id="#lcl.editbtn.TTimeEdit">TTimeEdit</link>
</seealso>
</element>
<element name="TTimePopupForm.Bevel1"/>
<element name="TTimePopupForm.MainPanel"/>
<element name="TTimePopupForm.HoursGrid"/>
<element name="TTimePopupForm.MinutesGrid"/>
<element name="TTimePopupForm.MoreLessBtn"/>
<element name="TTimePopupForm.GridsDblClick">
<short>
Implements the OnDblClick event handler for grids controls on the form.
</short>
<descr>
<p>
Calls <var>ReturnTime</var> to signal the <var>OnReturnTime</var> event
handler (when assigned) and close the form.
</p>
</descr>
<seealso>
<link id="TTimePopupForm"/>
<link id="TCustomForm.Close"/>
<link id="TReturnTimeEvent"/>
</seealso>
</element>
<element name="TTimePopupForm.GridsDblClick.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TTimePopupForm.GridsKeyDown">
<short>
Implements the OnKeyDown event handler for grid controls on the form.
</short>
<descr>
<p>
<var>GridsKeyDown</var> ensures that the virtual key in <var>Key</var> and
<var>Shift</var> is applied, when required. GridsKeyDown calls for form
methods for the following:
</p>
<dl>
<dt>VK_ESC</dt>
<dd>Calls the close method to close the Form.</dd>
<dt>VK_RETURN, VK_SPACE</dt>
<dd>Call ReturnTime to validate/update the time value, and close the
Form.</dd>
</dl>
<p>
When <var>Key</var> is handled in the method, it is set to zero (0).
Otherwise, it is retained for use in Form or Application key events.
</p>
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.GridsKeyDown.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TTimePopupForm.GridsKeyDown.Key">
<short>Virtual key code examined in the method.</short>
</element>
<element name="TTimePopupForm.GridsKeyDown.Shift">
<short>Key Modifier examined in the method.</short>
</element>
<element name="TTimePopupForm.GridPrepareCanvas">
<short>
Sets the canvas text style for a grid on the form.
</short>
<descr>
<p>
<var>GridPrepareCanvas</var> ensures that the Canvas used to draw grid
controls (<var>TStringGrid</var>) on the form has been initialized.
GridPrepareCanvas sets the text layout and alignment needed for the Canvas
property in the control.
</p>
<p>
<var>Sender</var> contains the grid control updated in the method. All other
parameters are ignored in the current implementation.
</p>
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.GridPrepareCanvas.sender">
<short>Control updated in the method.</short>
</element>
<element name="TTimePopupForm.GridPrepareCanvas.aCol">
<short>Ignored.</short>
</element>
<element name="TTimePopupForm.GridPrepareCanvas.aRow">
<short>Ignored.</short>
</element>
<element name="TTimePopupForm.GridPrepareCanvas.aState">
<short>Ignored.</short>
</element>
<element name="TTimePopupForm.MoreLessBtnClick">
<short>
Implements the OnClick event handler for the MoreLessBtn button on the form.
</short>
<descr>
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.MoreLessBtnClick.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TTimePopupForm.FClosed"/>
<element name="TTimePopupForm.FOnReturnTime"/>
<element name="TTimePopupForm.FSimpleLayout"/>
<element name="TTimePopupForm.FPopupOrigin"/>
<element name="TTimePopupForm.FCaller"/>
<element name="TTimePopupForm.ActivateDoubleBuffered">
<short>
Ensures that the DoubleBuffered property is updated with the current value
from the widget set class.
</short>
<descr/>
<seealso/>
</element>
<element name="TTimePopupForm.CalcGridHeights">
<short>
Calculates the total height for the Hours and Minutes grids on the form.
</short>
<descr/>
</element>
<element name="TTimePopupForm.GetTime">
<short>
Gets a TDateTime value for the selected cells in Hours and Minutes grids.
</short>
<descr>
Calls EncodeTime to get the return value for the selected cells.
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.GetTime.Result">
<short>
TDateTime value for the selected cells; only the time portion of the value is
relevant.
</short>
</element>
<element name="TTimePopupForm.Initialize">
<short>
Initializes the form using the origin and time values specified.
</short>
<descr>
Calls KeepInView to ensure that the form origin remains visible on the
current monitor. Called from the ShowTimePopup routine.
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.Initialize.PopupOrigin">
<short>Upper left coordinates for the form.</short>
</element>
<element name="TTimePopupForm.Initialize.ATime">
<short>Initial time value displayed on the form.</short>
</element>
<element name="TTimePopupForm.KeepInView">
<short>Ensures that form remains visible on the current monitor.</short>
<descr>
<p>
KeepInView ensures that form remains visible on the current monitor.
KeepInView tries to put the form on a "nice" place on the screen and make
sure the entire form is visible. TheCaller typically will be a TTimeEdit
control, and uses the following logic:
</p>
<ul>
<li>Places the form right under Caller control. If it does not fit...</li>
<li>Place the form above the Caller control. If it does not fit...</li>
<li>Sets the top coordinate to 0 and allows covering the Caller control.</li>
</ul>
</descr>
<seealso/>
</element>
<element name="TTimePopupForm.KeepInView.PopupOrigin">
<short>Upper left coordinates where the form is displayed.</short>
</element>
<element name="TTimePopupForm.ReturnTime">
<short>Validates the current time value for the form.</short>
<descr>
<p>
<var>ReturnTime</var> is a procedure used to validate and possibly update the
current time value for the form. <var>GetTime</var> is called to get the time
value using the selected cells in the Hour and Minute grids.
</p>
<p>
ReturnTime signals the internal <var>TReturnTimeEvent</var> event handler
(when assigned) to validate/update the time value. The TReturnTimeEvent event
handler is passed as an argument to the <var>ShowTimePopup</var> routine.
</p>
<p>
The <var>Close</var> method is called to close the form if it has not already
been hidden.
</p>
</descr>
<seealso>
<link id="TTimePopupForm.GetTime"/>
<link id="ShowTimePopup"/>
<link id="#lcl.forms.TCustomForm.Close">TCustomForm.Close</link>
</seealso>
</element>
<element name="TTimePopupForm.SetLayout">
<short>Sets the layout used in Minute grid for the form.</short>
<descr>
<p>
<var>SimpleLayout</var> indicates whether the Minutes grid on the form use
the simple layout. Simple layout uses a 30 minute interval between cells in
the grid, and offers a more compact appearance. When SimpleLayout is False, a
5 minute interval is used between cells in the Minute grid.
</p>
</descr>
<seealso>
</seealso>
</element>
<element name="TTimePopupForm.SetLayout.SimpleLayout">
<short>Uses the compact 30 minute interval when True.</short>
</element>
<element name="TTimePopupForm.SetTime">
<short>Sets the time value displayed on the form.</short>
<descr/>
<seealso/>
</element>
<element name="TTimePopupForm.SetTime.ATime">
<short>Time value applied to the Hour and Minute grid.</short>
</element>
<element name="TTimePopupForm.FormClose">
<short>Performs actions needed when the form is closed.</short>
<descr>
<p>
<var>FormClose</var> reimplements the FormClose event handler for the form to
ensure that the <var>FormDeactivate</var> method is removed from the
registered deactivate handlers in the global <var>Application</var> instance.
FormClose sets the value in <var>CloseAction</var> to <var>caFree</var> to
free the form instance.
</p>
</descr>
<seealso>
<link id="TTimePopupForm.FormDeactivate"/>
<link id="#lcl.forms.Application">Application</link>
<link id="#lcl.forms.TApplication.RemoveOnDeactivateHandler">TApplication.RemoveOnDeactivateHandler</link>
</seealso>
</element>
<element name="TTimePopupForm.FormClose.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TTimePopupForm.FormClose.CloseAction">
<short>Close action to perform on exit form the method.</short>
</element>
<element name="TTimePopupForm.FormCreate">
<short>Performs actions needed when the form instance is created.</short>
<descr>
<p>
<var>FormCreate</var> reimplements the FormCreate method to initialize the
form instance, and register its deactivation handler. FormCreate sets the
form to us the Simple layout, calls <var>SetLayout</var>, and registers the
<var>FormDeactivate</var> method as a deactivation handler in the global
<var>Application</var> instance.
</p>
</descr>
<seealso>
<link id="TTimePopupForm"/>
<link id="#lcl.forms.Application">Application</link>
<link id="#lcl.forms.TApplication.AddOnDeactivateHandler">TApplication.AddOnDeactivateHandler</link>
</seealso>
</element>
<element name="TTimePopupForm.FormCreate.Sender">
<short>Object for the event notification.</short>
</element>
<element name="TTimePopupForm.FormDeactivate">
<short>Performs action needed when the form is deactivated.</short>
<descr>
<p>
<var>FormDeactivate</var> reimplements the FormDeactivate event handler for
the form. FormDeactivate call the <var>Hide</var> method to immediately hide
the form. Otherwise, it would remain visible while in a Drag operation, for
example. If not already active, the <var>Close</var> method is called prior
to exiting from the method.
</p>
</descr>
<seealso>
<link id="TCustomForm.Close"/>
<link id="TCustomForm.Hide"/>
</seealso>
</element>
<element name="TTimePopupForm.FormDeactivate.Sender">
<short>Object for the event notification.</short>
</element>
<element name="ShowTimePopup">
<short>
Creates, initializes, and displays a TTimePopupForm instance.
</short>
<descr>
<p>
<var>ShowTimePopup</var> is a routine used to create, initialize, and display
a <var>TTimePopupForm</var> instance. Arguments passed to the routine
identify the time value and the control associated with the pop-up, event
handlers assigned to the form instance, and the layout and position for the
form.
</p>
</descr>
<seealso>
<link id="TTimePopupForm"/>
<link id="TReturnTimeEvent"/>
</seealso>
</element>
<element name="ShowTimePopup.Position">
<short>Coordinates where the form is displayed.</short>
</element>
<element name="ShowTimePopup.ATime">
<short>Initial time value for the form.</short>
</element>
<element name="ShowTimePopup.DoubleBufferedForm">
<short>Indicates if DoubleBuffered is enabled in the form instance.</short>
</element>
<element name="ShowTimePopup.OnReturnTime">
<short>Event handler signalled when the time value is changed.</short>
</element>
<element name="ShowTimePopup.OnShowHide">
<short>Event handler signalled when the form is show or hidden.</short>
</element>
<element name="ShowTimePopup.SimpleLayout">
<short>
<b>True</b> indicates the simple (compact) layout is used for the Minute grid
on the form.
</short>
</element>
<element name="ShowTimePopup.ACaller">
<short>Control with the time value updated using the pop-up form.</short>
</element>
</module>
<!-- TimePopup -->
</package>
</fpdoc-descriptions>
|