Could get date call the datepicker calendar screen ?

Post Reply
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Could get date call the datepicker calendar screen ?

Post by ShumingWang »

Hi,
For the datepiker class not easily use as normal get,could get /button /btnget call a datepicker calendar like function for choose?
Regards!
Shuming Wang
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Code: Select all


 STAT FUNC Set_Date()        

   LOCAL oDlg, oGet, lChg:=.F.
   LOCAL aRec, dDate:=Date()

   DEFINE DIALOG oDlg RESOURCE "SET_DATE" FONT oApp:oFont

 
       REDEFINE  DTPICKER  oGet VAR dDate ID 10 OF oDlg ;
                    ON CHANGE oGet:Refresh()


   REDEFINE BUTTON ID 20 OF oDlg ACTION (lChg:=.T.,oDlg:End())
   REDEFINE BUTTON ID 30 OF oDlg ACTION (lChg:=.F.,oDlg:End()) CANCEL
   ACTIVATE DIALOG oDlg

   IF lChg
          SetDate(Day(dDate),Month(dDate),Year(dDate))
   ENDIF
   RETURN (NIL)


Code: Select all


SET_DATE DIALOG 18, 37, 201, 108
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Data di lavoro"
FONT 8, "MS Sans Serif"
{
 PUSHBUTTON "&Conferma", 20, 89, 87, 48, 13
 PUSHBUTTON "&Annulla", 30, 152, 87, 46, 13
 GROUPBOX "", 105, 3, 0, 195, 79, BS_GROUPBOX
 LTEXT "Il cambio della data di lavoro può semplificarle alcuni ", -1, 11, 10, 179, 8
 LTEXT "processi, registrazione dei dati o stampe dei tabulati.", -1, 11, 18, 179, 8
 LTEXT "La nuova data rimarrà attiva fino a che non la si cambierà dal sistema.", -1, 11, 30, 179, 23
 CONTROL "", 10, "SysDateTimePick32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 13, 55, 81, 14
}







I hope I can help you
Best Regards, Saludos

Falconi Silvio
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

No, this is not what I wanted, for the datepicker 'get' class not works as well as normal tget class.
I want use normal tget to get a date var, and could call a calendar browser.

Redefine get date1 id 101 of odlg valid ( date1:=browse-canlendar(date1),.t.)
redefine btnget obtnget102 var date2 id 102 of odlg action (date2:=browse-canlendar(date1))

Thank you!
Shuming Wang
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post by dutch »

Shuming Wang,

I've used as you said. I've got the TCalen classes from our forum and modify to fit it need. You may try it or download original at

http://www.pflegeplus.com/fivewin

Image

Code: Select all

*-----------------*
Procedure ViewTrns
local oDlg, oBtn, oGet, oSay
local dDate

DEFINE DIALOG oDlg RESOURCE 'VIEWTRN' TITLE TE('àÃÕ¡´ÙÃÒ¡Òúѹ·Ö¡','View Transaction') ;
          FONT MEMVAR->oFont

          oDlg:lHelpIcon := .F.
          
  dDate   := date()

  REDEFINE SAY oSay PROMPT 'Date' ID 201 OF oDlg COLORS 'W+/RB'

  REDEFINE BTNGET oGet VAR dDate  OF oDlg ID 101 ACTION MsgDate2(oGet[5],dDate)

  REDEFINE SBUTTON oBtn ID 11 ;
           RESOURCE 'FIND1', 'FIND1', 'FIND3', 'FIND4' ;
           PROMPT  TE('¤é¹ËÒ','&Find') ;
           ACTION  (TrnList(oGet, oDlg,rtrim(cTrn),rtrim(cRefer),nAmt,nCash,dDate), oGet[1]:SetFocus()) ;
           COLOR {|oBtn| If( oBtn:lMouseOver, CLR_YELLOW, CLR_BLACK ) } ;
           TEXT ON_BOTTOM

ACTIVATE DIALOG oDlg ON INIT (oDlg:Move( MEMVAR->TopWin,MEMVAR->LeftWin)) RESIZE16
return
Download-Link #1: http://rapidshare.com/files/97121348/ka ... e.zip.html
Delete-Link #1: http://rapidshare.com/files/97121348/ka ... 1155969800[/url]
Post Reply