Page 1 of 2

DatePicker

Posted: Mon Apr 29, 2013 7:55 am
by Agustin
Es posible presentar un control DatePicker vacio, sin ninguna fecha hasta que la introduzca el operador ?

saludos

Re: DatePicker

Posted: Mon Apr 29, 2013 12:41 pm
by Pablo César
Creo que esto no sea posible, ya que DatePicker utiliza um campo FECHA. Talvez conseguirias si al invés de utilizar directamente un DatePicker, pases a utilizar um TextBox com campo caracter, hacerle un funcion donde llame un DatePicker y luego lo transforme em STRING.

Este "problema" no es solo en HMG, en várias lenguajes de programacion tienen esta misma característica.

Re: DatePicker

Posted: Mon Apr 29, 2013 1:04 pm
by Agustin
Lo imaginaba.

Gracias Pablo

Re: DatePicker

Posted: Mon Apr 29, 2013 6:01 pm
by srvet_claudio
Agustin wrote:Es posible presentar un control DatePicker vacio, sin ninguna fecha hasta que la introduzca el operador ?

saludos
DatePicker y TimePicker son controles nativos de Windows que siempre tienen que tener una fecha y una hora válida.

PD: El control TimePicker estará disponible en la nueva versión de HMG.

Re: DatePicker

Posted: Mon Apr 29, 2013 8:13 pm
by Mario Mansilla
Hola Claudio :
Que buena noticia , espero que Roberto y Rathi lo puedan incorporar al ide como un nuevo control .
Saludos .
Mario Mansilla

Re: DatePicker

Posted: Mon Apr 29, 2013 8:36 pm
by Leopoldo Blancas
Excelente Claudio!!!... Como siempre.

Saludos
Polo

Re: DatePicker

Posted: Tue Apr 30, 2013 12:24 am
by CalScot
I wondered whether it would be possible to enter a date of 00/00/00 (not blank, but it might work as a compromise?), so I used CTOD("00/00/00") as the value for a DatePicker field.

It didn't like 00 as either the month or the day, so it didn't work, but maybe you could try using
01/01/00 (or 01/01/2000) as a "blank" date.

On a lighter note: Playing around with DatePicker, I discovered that

The earliest date it accepts is 14-Sep-1752
& the latest date it accepts is 31-Dec-9999

I can understand 12/31/9999, but 09/14/1752? Somebody must have had a reason!!
CalScot

Re: DatePicker

Posted: Tue Apr 30, 2013 2:04 pm
by Amarante
CalScot wrote: On a lighter note: Playing around with DatePicker, I discovered that

The earliest date it accepts is 14-Sep-1752
& the latest date it accepts is 31-Dec-9999

I can understand 12/31/9999, but 09/14/1752? Somebody must have had a reason!!
CalScot
Historical Events for 14th September 1752:
US & England adopts Gregorian calender (no Sept 3-Sept 13th)

Re: DatePicker

Posted: Tue Apr 30, 2013 3:27 pm
by CalScot
Thank you, Amarante. That explains it!

Not only do we get amazing technical and programming support here, but we get history lessons, too! I love it!

Thanks again.
CalScot

Re: DatePicker

Posted: Tue Apr 30, 2013 11:18 pm
by Carlos Britos
Hi
In HMG Extended exist something like this

Code: Select all

HB_FUNC( SETDATEPICKNULL )
{
   SendMessage( ( HWND ) hb_parnl( 1 ), DTM_SETSYSTEMTIME, GDT_NONE, ( LPARAM ) 0 );
}


      IF Empty ( Value )
         SetDatePickNull ( ControlHandle )
      ELSE
         SetDatePick( ControlHandle, Year( value ), Month( value ), Day( value ) )
      ENDIF
Maybe someone can test it.