diff --git a/docs/xml/lcl/editbtn.xml b/docs/xml/lcl/editbtn.xml index 57865b06eb..6b59a7c935 100644 --- a/docs/xml/lcl/editbtn.xml +++ b/docs/xml/lcl/editbtn.xml @@ -4336,33 +4336,52 @@ implement the OnCustomTime property in TTimeEdit. -Implements a control used to edit time values. + +Implements a control used to edit time values. +

TTimeEdit is a TCustomEditButton descendant which implements a control used to edit a time value. TTimeEdit provides the Edit and Button properties defined in the ancestor class, and a dialog that is executed to select a time value when the Button -is clicked. +is clicked. The dialog allows selection of Hour and Minute values from a +drop-down list. Enable DirectInput to enter a time value that includes +additional time parts (like Seconds and Milliseconds).

-The time value in the control is represented using the TDateTime -type; only the time portion of the value is significant. +The Time value in the control is represented using the TDateTime +type; only the time portion of the value is significant. +

+

+Use TimeFormat and TimeSeparator to override the default format settings used +to generate the display Text for the time edit control.

+ +Modified in LCL version 4.0 to include additional properties and methods. + + + + +
+ + + + Gets the value for the Time property. @@ -4431,6 +4450,42 @@ method, and in the constructor for the class instance. New value for the property. + + +Sets the value for the TimeFormat property. + + + +Added in LCL version 4.0. + + + + + + + +New value for the property. + + + + + +Sets the value for the TimeSeparator property. + + + +Added in LCL version 4.0. + + + + + + + +New value for the property. + + + Implements the event handler used to display the popup dialog for the @@ -4532,6 +4587,124 @@ Default resource name for the glyph used on the button in the control. + + +Gets the effective format settings used to format the value for the time edit +control. + + +

+The return value contains the DefaultFormatSettings for the platform combined +with the values assigned to the TimeFormat and TimeSeparator properties. +UsedFormatSettings is called when a new value is stored in the Time property, +and is used to format the Text displayed on the control. +

+

+Use TimeFormat to specify the short time format settings applied to the Time +property. Use TimeSeparator to specify the time separator character used in the +short time settings applied to the Time property. +

+
+ +Added in LCL version 4.0. + + + + + + + + +DefaultFormatSettings +TFormatSettings + +
+ + +Format settings after the values in TimeFormat and TimeSeparator have been +applied. + + + + + +Gets the effective short time format used for the Time value in the control. + + +

+The return value contains the short time format used to format the value in the +Text property. It defaults to the short time setting in the +DefaultFormatSettings for the platform. The value in TimeFormat is substituted +when an explicit value has been assigned to the property. +

+

+UsedTimeFormat is called from the UsedFormatSettings method, which occurs when +a new value has been assigned to the Time property. +

+

+See TimeSeparator and UsedTimeSeparator for the separator character used in the +short time format settings. +

+
+ +Added in LCL version 4.0. + + + + + + + + +DefaultFormatSettings +TFormatSettings + +
+ + +Short time format used in the class instance. + + + + + +Gets the effective time separator character used in the short time format +settings. + + +

+The return value contains the time separator character in the short time format +used in the class instance. It defaults to the time separator character found +in the DefaultFormatSettings for the platform. The first character found in +TimeSeparator is substituted when an explicit value has been assigned to the +property. Other characters in TimeSeparator are ignored. +

+

+UsedTimeSeparator is called from the UsedFormatSettings method, which occurs +when a new value has been assigned to the Time property. +

+
+ +Added in LCL version 4.0. + + + + + + + + +DefaultFormatSettings +TFormatSettings + +
+ + +Time separator character used in the short time format settings for the class +instance. + + + Performs actions needed when the Button for the control is clicked. @@ -4568,6 +4741,120 @@ Implements the OnEditingDone event handler for the Edit in the control. Owner of the class instance. + + +Indicates whether the specified value is a valid time format for the TTimeEdit +control. + + +

+TTimeEdit requires a time format string that does not include date (or other) +parts which are not used/allowed in the class instance. ValidTimeFormat +examines the characters in AFormat to determine which parts are used. +

+

+The return value is False if AFormat contains any format specifier(s) or +combination of specifier(s) which are not allowed in the control. +

+

+The return value is True if AFormat is a valid time format setting for +use in the TimeFormat property. +

+

+ValidTimeFormat is called when a new value is assigned to the TimeFormat +property, and prevents updates to both TimeFormat and Time if the method +returns False. +

+

+Valid format specifiers include: +

+
+
'h', 'H'
+
+Represents hours. +
+
'm', 'M'
+
+Represents minutes, but not when used in conjunction with 'n' or 'N' or when +'h' or 'H' has not been included. +
+
'n', 'N'
+
+Represents minutes, but not when used in conjunction with 'm' or 'M'. +
+
's', 'S'
+
+Represents seconds, but not allowed when only 'm' or 'M' has been included. +
+
'z', 'Z'
+
+Represents milliseconds, but not allowed when only 'm' or 'M' has been included. +
+
'ampm', 'am/pm', 'a/p'
+
+Enables lowercase am/pm indicators using 12-hour format. +
+
'AMPM', 'AM/PM', 'A/P'
+
+Enables uppercase AM/PM indicators using 12-hour format. +
+
+

+Invalid format specifiers include: +

+
+
'd', 'D', 'y', 'Y'
+
+Date parts are not allowed in the time format. +
+
'[', ']'
+
+Interval specifiers are not supported in the time format. +
+
'''', '"'
+
+Any literals in quoted parts (Single Quote or Double Quote) are ignored. +
+
'ampm', 'am/pm', 'a/p'
+
+Enables lowercase am/pm indicators using 12-hour format. +
+
'AMPM', 'AM/PM', 'A/P'
+
+Enables uppercase AM/PM indicators using 12-hour format. +
+
+

+See TimeFormat and +FormatChars for more information. +

+

+Use TimeSeparator to specify the separator character used to delimit time +parts in the format setting. +

+
+ +Added in LCL version 4.0. + + + + + +FormatDateTime +FormatChars + +
+ + +Time format examined in the method. + + + + +Returns True if the specified time format is valid for the control. + + + Represents the time value in the control. @@ -4677,8 +4964,176 @@ by 5 columns using 5 minute time intervals is used. + + + + +Specifies the time format used to generate the display Text for the time edit +control. + + +

+TimeFormat is a String property which contains +FormatDateTime-compatible specifiers used to generate the Text displayed on the +time edit control. It can be used to override the default time format settings +for a given platform. TimeFormat is used in the UsedTimeFormat method called +when a new value is assigned to the Time property. +

+

+TimeFormat must contain only format specifiers which are valid for a time value +- and does not use format specifiers which apply to date or interval parts. +Valid format specifiers include: +

+
+
'h', 'H'
+
+Represents hours. +
+
'm', 'M'
+
+Represents minutes, but not when used in conjunction with 'n' or 'N' or when +'h' or 'H' has not been included. +
+
'n', 'N'
+
+Represents minutes, but not when used in conjunction with 'm' or 'M'. +
+
's', 'S'
+
+Represents seconds, but not allowed when only 'm' or 'M' has been included. +
+
'z', 'Z'
+
+Represents milliseconds, but not allowed when only 'm' or 'M' has been included. +
+
'ampm', 'am/pm', 'a/p'
+
+Enables lowercase am/pm indicators using 12-hour format. +
+
'AMPM', 'AM/PM', 'A/P'
+
+Enables uppercase AM/PM indicators using 12-hour format. +
+
+

+Invalid format specifiers include: +

+
+
'd', 'D', 'y', 'Y'
+
+Date parts are not allowed in the time format. +
+
'[', ']'
+
+Interval specifiers are not supported in the time format. +
+
'''', '"'
+
+Any literals in quoted parts (Single Quote or Double Quote) are ignored. +
+
+

+See ValidTimeFormat and +FormatChars for more information. +

+

+Changing the value in TimeFormat causes the new property value to be validated +and either accepted or rejected using the ValidTimeFormat method. When +accepted, the Text property is updated using the new format settings. +

+

+Use TimeSeparator to specify the separator character used to delimit time +parts in the format settings. +

+
+ +Added in LCL version 4.0. + + + + + + +FormatDateTime +FormatChars + +
+ + + +Specifies the separator character used to delimit time parts in the format +settings applied to the control. + + +

+TimeSeparator is a String property which contains the +separator used to delimit time parts specified in the TimeFormat property. It +allows the default time separator from the system format settings to be +overridden in the class instance. +

+

+Changing the value for the property causes the Text property to be updated +using the new separator. +

+

+TimeSeparator is used in the UsedTimeSeparator method called when a new value +is assigned to the Time property. When omitted, the default time separator in +DefaultFormatSettings is used instead. +

+

+Please note: While TimeSeparator is a String type, only the first character +specified in the property is actually used. The other characters in the +property are ignored. +

+

+Use TimeFormat to specify the time format settings used in the class instance. +

+
+ +Added in LCL version 4.0. + + + + + + + +FormatDateTime +FormatChars + +
+ - + + + +Contains the formatted text used to represent the Time value for the control. + + +

+Text is a published property in TTimeEdit. It contains the formatted +text displayed for the Time value in the control. It is automatically updated +when a new value is assigned to the Time, TimeFormat, or TimeSeparator +properties. It contains the result from the FormatDateTime routine called using +the Time value and format settings for the control. +

+

+Use TimeFormat to specify a FormatDateTime-compatible string used to generate +the value for the Text property. +

+

+Use TimeSeparator to specify the delimiter character used between time parts in +the TimeFormat. +

+
+ + + + +TCustomAbstractGroupedEdit.Text + +
+