Page 1 of 1

Uso de SHOWNONE

Posted: Tue Nov 19, 2013 6:05 pm
by joposadas
Grupo

Tengo dos controls DataPicker uno es con SHOWNONE .F. y uno con SHOWNONE .T.
Mi pregunta es, en el segundo (con valor .T.) ¿como puedo saber si esa fecha ha sido seleccionada?, es decir, ¿sino tiene la "palomita" como puedo hacer la verificación en mi código?

IF Frm_Customer.Dp_InitDate <--COMO LE INDICO AQUI QUE HACE FALTA SELECIONAR LA FECHA (es decir que tenga la palomita")
MsgInfo("favor de seleccionar una fecha")
Frm_Customer.Dp-InitDate.SetFocus
RETURN
ENDIF

Re: Uso de SHOWNONE

Posted: Tue Nov 19, 2013 6:20 pm
by Amarante
I think you can check with Empty (Frm_Customer.Dp_InitDate.Value)
---
Creo que se puede comprobar con Empty (Frm_Customer.Dp_InitDate.Value)

Uso de SHOWNONE

Posted: Tue Nov 19, 2013 6:40 pm
by Pablo César
Asi es Amarante, yo hé comprobado que sin el ShowNone sectado, el valor conseguido de DatePicker vá a ser vacio. Entonces basta colocar en el ON CHANGE de ese DatePicker una funcion que verifique si está setado o no, es decir si está EMPTY o no.

---

That's correct Amarante, I found that when ShowNone is not settedt, it value will be empty. Then simply place the ON CHANGE that DatePicker a function to check if setted or not, ie if it is EMPTY or not.

Re: Uso de SHOWNONE

Posted: Tue Nov 19, 2013 7:03 pm
by esgici
joposadas wrote: Tengo dos controls DataPicker uno es con SHOWNONE .F. y uno con SHOWNONE .T.
Mi pregunta es, en el segundo (con valor .T.) ¿como puedo saber si esa fecha ha sido seleccionada?, es decir, ¿sino tiene la "palomita" como puedo hacer la verificación en mi código?
Google wrote:I have two controls one is with shownone DataPicker. F. and one shownone. T.
My question is, in the second (with value. T.) how I can know if that date is selected?, Ie does it have the "pop" as I can do the check in my code?
Hola Jorge

I'm not sure that I understand correct your question :(

But what please look at here,

I hope that it will give you an idea :idea:

Happy HMG :D

Uso de SHOWNONE

Posted: Tue Nov 19, 2013 7:04 pm
by Pablo César
You can test this example:

Code: Select all

/*
 * HMG - Harbour Win32 GUI library Demo
 *
 * Copyright 2002 Roberto Lopez <mail.box.hmg@gmail.com>
 * http://www.hmgforum.com//
*/

#include "hmg.ch"

Function Main
DEFINE WINDOW Form_1 ;
    AT 0,0 ;
	WIDTH 600 HEIGHT 400 ;
	TITLE "HMG DatePicker Demo" ;
	MAIN ;
	FONT "Arial" SIZE 10

	@ 10,10 DATEPICKER Date_1 ; 
        VALUE CTOD("01/01/2001") ;
	    TOOLTIP "DatePicker Control"

	@ 10,310 DATEPICKER Date_2 ;
        VALUE CTOD("01/01/2001") ;
        TOOLTIP "DatePicker Control ShowNone RightAlign" ;
        SHOWNONE ;
        ON CHANGE VerStatus();
        RIGHTALIGN

	@ 230,10 DATEPICKER Date_3 ;
        VALUE CTOD("01/01/2001") ;
        TOOLTIP "DatePicker Control UpDown" ;
        UPDOWN

	@ 230,310 DATEPICKER Date_4 ;
        VALUE CTOD("01/01/2001") ;
        TOOLTIP "DatePicker Control ShowNone UpDown" ;
        SHOWNONE ;
        UPDOWN

END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil

Function VerStatus()
Local cValor:=GetProperty("Form_1","Date_2", "Value" )
Local hwd:=GetControlhandle("Date_2","Form_1")

If Empty(cValor)
   MsgStop("Now you can not be able to change ShowNone !"+CRLF+"Will allows to change date by only by MonthCalendar")
Else
   SETDATEPICKNULL(hwd)
   MsgInfo("It has setted ShowNone forever !!!")
Endif
Return Nil
To see at "Date_2" as as learning way, stopping normal behaviour.

Re: Uso de SHOWNONE

Posted: Tue Nov 19, 2013 11:05 pm
by joposadas
Grupo,

Muchas gracias por la ayuda, la solución fue:
IF EMPTY (Frm_Customer.Dp_InitDate.Value)

------------------------------------------------------

Thank you very much for the help, the solution was:
IF EMPTY (Frm_Customer.Dp_InitDate.Value)