Lines 186-191
Link Here
|
186 |
TCHAR lpszFormat = new TCHAR (0, buffer, true); |
186 |
TCHAR lpszFormat = new TCHAR (0, buffer, true); |
187 |
OS.SendMessage (handle, OS.DTM_SETFORMAT, 0, lpszFormat); |
187 |
OS.SendMessage (handle, OS.DTM_SETFORMAT, 0, lpszFormat); |
188 |
} |
188 |
} |
|
|
189 |
if ((this.style & SWT.CALENDAR) != 0) time.wHour = time.wMinute = time.wSecond = -1; |
189 |
} |
190 |
} |
190 |
|
191 |
|
191 |
/** |
192 |
/** |
Lines 568-577
Link Here
|
568 |
*/ |
569 |
*/ |
569 |
public int getHours () { |
570 |
public int getHours () { |
570 |
checkWidget (); |
571 |
checkWidget (); |
571 |
if ((style & SWT.CALENDAR) != 0) return time.wHour; |
572 |
if ((style & SWT.CALENDAR) != 0 && time.wHour != -1) return time.wHour; |
572 |
SYSTEMTIME systime = new SYSTEMTIME (); |
573 |
SYSTEMTIME systime = new SYSTEMTIME (); |
573 |
int msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME; |
574 |
OS.SendMessage (handle, OS.DTM_GETSYSTEMTIME, 0, systime); |
574 |
OS.SendMessage (handle, msg, 0, systime); |
|
|
575 |
return systime.wHour; |
575 |
return systime.wHour; |
576 |
} |
576 |
} |
577 |
|
577 |
|
Lines 590-599
Link Here
|
590 |
*/ |
590 |
*/ |
591 |
public int getMinutes () { |
591 |
public int getMinutes () { |
592 |
checkWidget (); |
592 |
checkWidget (); |
593 |
if ((style & SWT.CALENDAR) != 0) return time.wMinute; |
593 |
if ((style & SWT.CALENDAR) != 0 && time.wMinute != -1) return time.wMinute; |
594 |
SYSTEMTIME systime = new SYSTEMTIME (); |
594 |
SYSTEMTIME systime = new SYSTEMTIME (); |
595 |
int msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME; |
595 |
OS.SendMessage (handle, OS.DTM_GETSYSTEMTIME, 0, systime); |
596 |
OS.SendMessage (handle, msg, 0, systime); |
|
|
597 |
return systime.wMinute; |
596 |
return systime.wMinute; |
598 |
} |
597 |
} |
599 |
|
598 |
|
Lines 638-647
Link Here
|
638 |
*/ |
637 |
*/ |
639 |
public int getSeconds () { |
638 |
public int getSeconds () { |
640 |
checkWidget (); |
639 |
checkWidget (); |
641 |
if ((style & SWT.CALENDAR) != 0) return time.wSecond; |
640 |
if ((style & SWT.CALENDAR) != 0 && time.wSecond != -1) return time.wSecond; |
642 |
SYSTEMTIME systime = new SYSTEMTIME (); |
641 |
SYSTEMTIME systime = new SYSTEMTIME (); |
643 |
int msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME; |
642 |
OS.SendMessage (handle, OS.DTM_GETSYSTEMTIME, 0, systime); |
644 |
OS.SendMessage (handle, msg, 0, systime); |
|
|
645 |
return systime.wSecond; |
643 |
return systime.wSecond; |
646 |
} |
644 |
} |
647 |
|
645 |
|