Uso de SHOWNONE

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
joposadas

Uso de SHOWNONE

Post 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
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: Uso de SHOWNONE

Post 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)
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Uso de SHOWNONE

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Uso de SHOWNONE

Post 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
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Uso de SHOWNONE

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
joposadas

Re: Uso de SHOWNONE

Post 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)
Post Reply