Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SysDateTimePick32 in standard English language
#2
From quickly trying a few things i wasn't able to change the actual calendar to english but i was able to change the editable part to english 
if your worried about language just convert the date to english couple examples below

Function Dialogdatepick1 
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 SysDateTimePick32 0x56030010 0x0 28 28 96 13 ""
;4 Static 0x54000001 0x0 28 12 94 14 "Date in English"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SendMessage(id(3 hDlg) DTM_SETFORMAT 0 "dd-MMM-yy")
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
;sel nh.idFrom
,;case 3
sel nh.code
,case DTN_DATETIMECHANGE
,NMDATETIMECHANGE* p=+nh
,if p.dwFlags=GDT_VALID
,,DateTime dt
,,dt.FromSYSTEMTIME(p.st)
,,_s.timeformat("{dd-MMM-yy}" dt  WINAPI.LANG_ENGLISH|WINAPI.SUBLANG_ENGLISH_US)
,,_s.setwintext(id(4 hDlg))
,else out "empty"
 and changing editable part of datepicker
Function Dialogdatepick2 
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 SysDateTimePick32 0x56030010 0x0 28 28 96 13 ""
;4 Static 0x54000001 0x0 28 12 94 14 "Date in English"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,_s.timeformat("{dd-MMM-yy}" 0  WINAPI.LANG_ENGLISH|WINAPI.SUBLANG_ENGLISH_US)
,SendMessage(id(3 hDlg) DTM_SETFORMAT 0 _s)
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
;sel nh.idFrom
,;case 3
sel nh.code
,case DTN_DATETIMECHANGE
,NMDATETIMECHANGE* p=+nh
,if p.dwFlags=GDT_VALID
,,DateTime dt
,,dt.FromSYSTEMTIME(p.st)
,,_s.timeformat("{dd-MMM-yy}" dt  WINAPI.LANG_ENGLISH|WINAPI.SUBLANG_ENGLISH_US)
,,_s.setwintext(id(4 hDlg))
,,SendMessage(id(3 hDlg) DTM_SETFORMAT 0 _s)
,else out "empty"

or can just convert it and not display the conversion

Code:
Copy      Help
NMHDR* nh=+lParam
sel nh.idFrom
,case 3
,sel nh.code
,,case DTN_DATETIMECHANGE
,,NMDATETIMECHANGE* p=+nh
,,if p.dwFlags=GDT_VALID
,,,DateTime dt
,,,dt.FromSYSTEMTIME(p.st)
,,,_s.timeformat("{dd-MMM-yy}" dt  WINAPI.LANG_ENGLISH|WINAPI.SUBLANG_ENGLISH_US)
,,else out "empty"


Messages In This Thread
RE: SysDateTimePick32 in standard English language - by Kevin - 07-11-2018, 08:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)