开发者

Customizing the Format Settings on a TcxCustomDateEdit

I'm looking to write a Date edit control preferably with a Date/Time picker that stores it's format settings on the control itself so they can be defined at run time independently from other controls.

I've TcxCustomDateEdit as a base and overridden various methods to handle the input and output but now I've hit a snag with the Popup Calendar, which shows all the month and Day Names using the variables in SysUtils.

I need to be able to use specific format settings (including the month and day names) instead of the system locale

Any idea's how I can get around this?

EDIT

I've included the 2 ima开发者_如何学Cges below from the popup window from the TcxDateEdit.

ShortDateFormat: Date in the Top bar

ShortDayNames: First letter of each day in the calendar

LongMonthNames: The Month name between the Arrows for the current month, The list of month names in the MonthListPopup.

TimeSeparator: Should control the : in the TimeEdit but doesn't.

These are all part of TFormatSettings and I would like to control these at the individual control level.

Customizing the Format Settings on a TcxCustomDateEdit

Customizing the Format Settings on a TcxCustomDateEdit


Aha, I now understand what you want to achieve. Delphi's dateEdit uses the standard Delphi's ShortDateFormat to format a value. I would start from overriding the TcxCustomDateEditProperties.PrepareDisplayValue, TcxCustomDateEditProperties.InternalPrepareEditValue and TcxCustomDateEditProperties.ValidateDisplayValue methods.


Wrote a new Popup Calendar

TMyPopupCalendar = class(TcxPopupCalendar);

and a new list box

TRegionalPopupListBox = class(TcxMonthListBox)

and in the date edit control overrode CreateCalendar and GetCalendarClass

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜