Page 1 of 1

A Replacement For DateGadget

Posted: Mon Apr 16, 2012 5:50 am
by Jumbuck
I found this while searching. Need something other than PB DateGadget and this appears
to be the answer.
Can somebody show me how to GET the displayed date INTO a STRING and how to
SET a date into the display FROM a STRING.

Code: Select all

OpenWindow(0,200,200,200,200,"test",#PB_Window_SystemMenu)
  picker1=CreateWindowEx_(0,"SysDateTimePick32","",#WS_CHILD|#WS_VISIBLE|12+2,10,10,120,25,WindowID(0),0,GetModuleHandle_(0),0)
  
Repeat
  EventID=WaitWindowEvent()
   
Until EventID=#PB_Event_CloseWindow

CloseWindow(0)
Thanks Cressida

Re: A Replacement For DateGadget

Posted: Mon Apr 16, 2012 6:20 am
by RASHAD

Code: Select all

OpenWindow(0,200,200,200,200,"test",#PB_Window_SystemMenu)
  picker1=CreateWindowEx_(0,"SysDateTimePick32","",#WS_CHILD|#WS_VISIBLE|12+2,10,10,120,25,WindowID(0),0,GetModuleHandle_(0),0)
  ButtonGadget(0,10,160,60,24,"Get")
  ButtonGadget(1,80,160,60,24,"Set")
 
Repeat 
    Select WaitWindowEvent() 
        Case #PB_Event_CloseWindow 
            Quit = 1 
    
    
        Case #PB_Event_Gadget 
            Select EventGadget() 
                Case 0 
                    SendMessage_(picker1,#DTM_GETSYSTEMTIME,0,@d.SYSTEMTIME)
                    Debug "Date  : "+ Str(d\wDay)+" - "+ Str(d\wMonth) + " - " + Str(d\wYear)
                    Debug "Time  : "+ Str(d\wHour) + " - " + Str(d\wMinute) + " - "+ Str(d\wSecond)
                    
                Case 1
                    d\wDay = 10
                    d\wMonth = 2
                    d\wYear = 2010
                    ;d\wHour =
                    ;d\wMinute =
                    ;d\wSecond =
                    SendMessage_(picker1,#DTM_SETSYSTEMTIME,0,@d.SYSTEMTIME)

            EndSelect
    EndSelect 
Until Quit = 1


Re: A Replacement For DateGadget

Posted: Tue Apr 17, 2012 8:01 am
by Jumbuck
Thanks Rashad.