TcxEditRepositoryDateTimeWheelPickerItem Class
A repository item that stores date/time wheel picker settings.
Declaration
TcxEditRepositoryDateTimeWheelPickerItem = class(
TcxEditRepositoryItem
)
Remarks
A date/time wheel picker is a touch-friendly editor that can display and change a TDateTime value.
The TcxEditRepositoryDateTimeWheelPickerItem
class overrides the Properties property that allows you to access and customize date/time wheel picker settings.
Edit Repository Items and Standalone Editors
Edit repository items are useful when you need to share the same settings between multiple editors of the same type. To accomplish this goal, you can assign the same edit repository item to RepositoryItem properties of all target editors.
Edit Repository Items and Container Controls
A container control item (such as a toolbar edit item or a column (or any other data item) in a Data Grid, Vertical Grid, or Tree List control) can embed an in-place editor shipped with the ExpressEditors Library. An in-place editor exists (and, therefore, has its own WinAPI handle) only when the target container control item is being edited. Otherwise, the container control item displays a static editor image for resource usage optimization.
Create a Date/Time Wheel Picker Repository Item at Design Time
To create a date/time wheel picker item at design time, double-click an edit repository component to invoke its collection editor.
The collection editor dialog allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.
Select the DateTimeWheelPicker item and click the Ok button to create a date/time wheel picker repository item.
Create a Date/Time Wheel Picker Repository Item in Code
The following code example creates a date/time wheel picker repository item, customizes editor settings, and assigns the created repository item to two existing date/time wheel pickers:
uses cxEdit, cxEditRepositoryItems;
// ...
var
ADateTimeWheelItem: TcxEditRepositoryDateTimeWheelPickerItem;
ARepositoryItem: TcxEditRepositoryItem;
begin
ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryDateTimeWheelPickerItem);
ADateTimeWheelItem := ARepositoryItem as TcxEditRepositoryDateTimeWheelPickerItem;
// Displays five wheels that specify years, months, days, hours, and minutes
ADateTimeWheelItem.Properties.Wheels := [pwYear, pwMonth, pwDay, pwHour, pwMinute];
ADateTimeWheelItem.Properties.LineCount := 5; // Displays five date items on each wheel
// Assigns the created repository item to two existing unbound date/time wheel picker editors
dxDateTimeWheelPicker1.RepositoryItem := ADateTimeWheelItem;
dxDateTimeWheelPicker2.RepositoryItem := ADateTimeWheelItem;
end;
Date/Time Wheel Picker Repository Item Deletion
To delete all date/time wheel picker repository items in a TcxEditRepository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryDateTimeWheelPickerItem
class as a parameter.
If you need to delete an individual date/time wheel picker repository item, release it directly in code (call the Free procedure in Delphi or use the delete
keyword in C++Builder).