mirror of
https://github.com/reactos/reactos.git
synced 2024-09-09 20:30:04 +00:00
Don't specify any specific time format for the clock.
svn path=/trunk/; revision=7693
This commit is contained in:
parent
7a72b1d1a7
commit
1c99ac5f74
|
@ -328,8 +328,13 @@ HWND ClockWindow::Create(HWND hwndParent)
|
||||||
FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
|
FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
|
||||||
|
|
||||||
RECT rect = {0, 0, 0, 0};
|
RECT rect = {0, 0, 0, 0};
|
||||||
DrawText(canvas, TEXT("00:00"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
|
TCHAR buffer[16];
|
||||||
int clockwindowWidth = rect.right-rect.left + 32;
|
|
||||||
|
if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
|
||||||
|
_tcscpy(buffer, TEXT("00:00"));
|
||||||
|
|
||||||
|
DrawText(canvas, buffer, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
|
||||||
|
int clockwindowWidth = rect.right-rect.left + 4;
|
||||||
|
|
||||||
return Window::Create(WINDOW_CREATOR(ClockWindow), 0,
|
return Window::Create(WINDOW_CREATOR(ClockWindow), 0,
|
||||||
BtnWindowClass(CLASSNAME_CLOCKWINDOW,CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE,
|
BtnWindowClass(CLASSNAME_CLOCKWINDOW,CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE,
|
||||||
|
@ -382,14 +387,12 @@ void ClockWindow::TimerTick()
|
||||||
bool ClockWindow::FormatTime()
|
bool ClockWindow::FormatTime()
|
||||||
{
|
{
|
||||||
TCHAR buffer[16];
|
TCHAR buffer[16];
|
||||||
TCHAR TimeFormat[] = TEXT("hh':'mm tt");
|
|
||||||
|
|
||||||
GetTimeFormatW(LOCALE_USER_DEFAULT,0,NULL,TimeFormat,buffer,sizeof(buffer));
|
if (GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
|
||||||
|
if (_tcscmp(buffer, _time)) {
|
||||||
if (_tcscmp(buffer, _time)) {
|
_tcscpy(_time, buffer);
|
||||||
_tcscpy(_time, buffer);
|
return true; // The text to display has changed.
|
||||||
return true; // The text to display has changed.
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false; // no change
|
return false; // no change
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue