I have a TMonthCalendar component on a form in Delphi XE5 app for date selection. I have a Chinese customer who sent me this screen shot of his form:
http://imgur.com/3icMyGO
Notice that Saturdays on the right edge are cut off and unselectable. I'm guessing this due to the width of the Chinese characters in the dow headers. Can I force TMonthCalendar to a US English locale? Otherwise, what do I do about this? I tried widening the form to stretch the component but it's not resizeable.
> {quote:title=Just JJ wrote:}{quote}
> Make sure the designed TMonthCalendar control is wider than the drawn
> calendar's width
Thanks, I'll give that a try first before messing with the locale settings per Peter's instructions.
On Tue, 9 Dec 2014 12:08:19 -0800, Kent Briggs wrote:
> I have a TMonthCalendar component on a form in Delphi XE5 app for date
> selection. I have a Chinese customer who sent me this screen shot of his
> form:
>
> http://imgur.com/3icMyGO
>
> Notice that Saturdays on the right edge are cut off and unselectable. I'm
> guessing this due to the width of the Chinese characters in the dow
> headers. Can I force TMonthCalendar to a US English locale? Otherwise,
> what do I do about this? I tried widening the form to stretch the
> component but it's not resizeable.
Make sure the designed TMonthCalendar control is wider than the drawn
calendar's width if you're developing the software using English locale.
Wide enough to allow wider calendar such as the one with Chinese locale,
when it's drawn. i.e. leave some horizontal space *in* it (in TMonthCalendar
control client area; not the spaces between other VCL controls).
Kent Briggs wrote:
> I have a TMonthCalendar component on a form in Delphi XE5 app for
> date selection. I have a Chinese customer who sent me this screen
> shot of his form:
>
> http://imgur.com/3icMyGO
>
> Notice that Saturdays on the right edge are cut off and unselectable.
> I'm guessing this due to the width of the Chinese characters in the
> dow headers. Can I force TMonthCalendar to a US English locale?
> Otherwise, what do I do about this? I tried widening the form to
> stretch the component but it's not resizeable.
The TMonthCalendar is a thin wrapper of the MS month calendar common
control (see
ms-help://embarcadero.rs_xe5/ShellCC/platform/commctls/monthcal/monthcal
..htm in the online help, or
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760917%28v=vs.85%29.aspx).
The only thing I see in the docs that may influence the day names used
is the MCS_SHORTDAYSOFWEEK style.
So try this:
setwindowlong(monthcalendar1.handle, GWL_STYLE,
getwindowlong(monthcalendar1.handle, GWL_STYLE) or
MCS_SHORTDAYSOFWEEK );
The style constant is declared in winapi.CommCtrl, which should already
be in your uses clause.
The control will use the names from the current user locale, and the
calendar display itself (drawn by Windows) does not seem to be
resizeable.
--
Peter Below (TeamB)