Up and down keys can always serve for same purpose, so can mouse wheel. In my opinion the UpDown buttons aren't really useful in this control, they are provided for compatibility with Delphi's TDateTimePicker. When set to dmUpDown, then UpDown buttons are shown. When user clicks the button, the calendar control is shown, allowing the user to pick the date. DateMode: TDTDateMode type TDTDateMode = (dmComboBox, dmUpDown, dmNone) When DateMode is set to dmComboBox, there is a button on the right side of the control. Kind: TDateTimeKind type TDateTimeKind = (dtkDate, dtkTime, dtkDateTime) The control displays only date, only time or both. 2010, if user enters year 23, it will be set to 1923, because it can’t be 2033, due to MaxDate limit. Note that MinDate and MaxDate properties can also have influence on the decision – for example, if the CenturyFrom is set to 1941 and MaxDate to 31. The default is 1941, which means that when two digit year is entered, it falls in interval 1941 – 2040. CenturyFrom: Word When user enters the year in two-digit format, then the CenturyFrom property is used to determine which century the year belongs to. NullInputAllowed: Boolean When True, the user can set the date to NullDate constant by pressing N key. MaxDate: TDate The maximal date user can enter. MinDate: TDate The minimal date user can enter. Time: TTime The time displayed on the control which the user can edit. Date: TDate The date displayed on the control which the user can edit. There is also component editor which provides easy way of setting this property in design time. In design time, Date and Time can be set in object inspector. This property is provided to allow setting or reading of both date and time value at once in program code. This property is not published in object inspector, but its value is actually the same as Date and Time properties composed in one value. I'll explain some properties of TDateTimePicker control:ĭateTime: TDateTime (public) The DateTime value displayed on the control. This separation of designtime code to different package is done to prevent the code which is needed only in design time to be linked in final executable. Normally, you should not care about this, but only if you are installing the controls in the IDE manually, you should know that it is actually the designtime package DateTimeCtrlsDsgn which is installed in the IDE. Since Lazarus 1.8 the designtime code is separated to another package DateTimeCtrlsDsgn. The components TDateTimePicker and TDBDateTimePicker are located in Common Controls and Data Controls palette pages, respectively. The components are installed on Component palette by default (if you build the IDE yourself, they are installed with "make bigide"). You can find it in /components/datetimectrls. This package is part of Lazarus distribution (since Lazarus 1.4). Modified LGPL (same as the FPC RTL and the Lazarus LCL). The VCL's control doesn't have caret either. Note that the TDateTimePicker control does not descend from TEdit, so it does not have unnecessary caret. It has been tested on Windows with Win32/64 and qt widgetsets and on Linux with gtk2 and qt widgetsets. It descends from LCL-s TCustomControl to be cross-platform. The TDateTimePicker does not use native Win control. Therefore, I tried to create a cross-platform Lazarus control which would resemble VCL's TDateTimePicker as much as possible. LCL, however, does not have this control. The DateTimeCtrls package contains two controls:ĭelphi's VCL has a control named TDateTimePicker, which I find very useful for editing dates.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |