FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Clear a get date
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Clear a get date
Posted: Tue Jul 31, 2018 05:55 PM
I have a get date with datepick
Near I have a btnbmp with a Menu to select actions





Code (fw): Select all Collapse
@ 12,5 SAY "Note di :" OF  oDlg PIXEL SIZE 100,20 TRANSPARENT
 @ 10,35 DTPICKER aGet[1] VAR dDataNote SIZE 120,12 PIXEL OF oDlg  PICTURE "dddd, dd mmmm yyyy"

      @ 07,220  BTNBMP oBtnCal FILENAME ".\bitmaps\date.bmp" FLAT;
       SIZE 20,14 PIXEL OF oDlg NOBORDER

      oBtnCal:oPopUp:= { |oBtn| BtnPopCalMenu( @dDataNote,aGet ) }

....
Function BtnPopCalMenu( dDataNote,aGet )
  Local oPopupDate

     MENU oPopupDate POPUP 2015
     MENUITEM "Oggi"  ACTION ( dDataNote  :=date(),aGet[1]:refresh())
     MENUITEM "Domani"  ACTION ( dDataNote  :=date()+1,aGet[1]:refresh())
     MENUITEM "DopoDomani"  ACTION ( dDataNote  :=date()+2,aGet[1]:refresh())
      SEPARATOR
      MENUITEM "Pulisci"  ACTION ( dDataNote  :=ctod("  /  /  "),aGet[1]:refresh())
      ENDMENU

   return oPopupDate


the command MENUITEM "Pulisci" ACTION ( dDataNote :=ctod(" / / "),aGet[1]:refresh()) not run why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Clear a get date
Posted: Tue Jul 31, 2018 06:59 PM
Code (fw): Select all Collapse
   oBtnCal:oPopUp:= { |oBtn| BtnPopCalMenu( @dDataNote,aGet ), aGet[1]:Refresh() }
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Clear a get date
Posted: Wed Aug 01, 2018 12:36 AM
Error !!!

Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\pezzi_per_spiaggia\servizi_singoli\test.Exe (32 bits)
   Size: 3,830,272 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 4 secs 
   Error occurred at: 08/01/18, 02:35:32
   Error description: Error BASE/1004  No exported method: ACTIVATE
   Args:
     [   1] = A   { ... } length: 2
     [   2] = N   48
     [   3] = N   320
     [   4] = O   TDIALOG
     [   5] = L   .F.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Clear a get date
Posted: Wed Aug 01, 2018 01:24 PM
Code (fw): Select all Collapse
#include "FiveWin.ch" 

//----------------------------------------------------------------------------// 

function Main() 

   local oDlg , omenutry, oPopupDate, aGet := Array(5)

   SET _3DLOOK ON 

   // Try this, intenta asi, tente assim:
   MENU oPopupDate POPUP 2015

      MENUITEM "Oggi"       ACTION ( dDataNote := date(),   aGet[1]:refresh() )

      MENUITEM "Domani"     ACTION ( dDataNote := date()+1, aGet[1]:refresh() )

      MENUITEM "DopoDomani" ACTION ( dDataNote := date()+2, aGet[1]:refresh() )

      SEPARATOR

      MENUITEM "Pulisci"    ACTION ( dDataNote := ctod("  /  /  "), ;
                                     aGet[1]:refresh() )

   ENDMENU

   DEFINE DIALOG oDlg RESOURCE "Main" COLOR "N/B" 

   REDEFINE BTNBMP ID 110 OF oDlg ; 
      RESOURCE "Yes" NOBORDER ACTION oDlg:End() 
      
   oDlg:aControls[ 1 ]:lTransparent = .t.

   REDEFINE BTNBMP ID 120 OF oDlg ; 
      RESOURCE "No"

   oDlg:aControls[ 2 ]:oPopup := oPopupDate

   REDEFINE BTNBMP ID 130 OF oDlg ; 
      RESOURCE "Cancel" 

   ACTIVATE DIALOG oDlg CENTERED 

return nil
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Clear a get date
Posted: Thu Aug 02, 2018 06:46 PM

It may be easier to use aGet[ 1 ]:SetDate( dNewDate )
For empty date, :SetDate( CTOD( "" ) )

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Clear a get date
Posted: Fri Aug 03, 2018 09:50 PM
NOT RUN
MENUITEM "Pulisci" ACTION aGet[1]:SetDate( CTOD( "" ) )

or

MENUITEM "Pulisci" ACTION (dDataNote :=cTod(""), aGet[1]:SetDate( dDataNote ) ,aGet[1]:refresh())
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Clear a get date
Posted: Sun Aug 05, 2018 09:50 PM
is there a bug on datepicker class ?

I not understtod How resolve the error
when I set date ( "") it not run

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "dtpicker.ch"
#include "constant.ch"
//----------------------------------------------------------------------------//

function Main()

   local oDlg , aGet := Array(5), oBtnCal
    local dDataNote:=ctod("")
   SET _3DLOOK ON

     DEFINE DIALOG oDlg  SIZE 400,200


    @ 12,5 SAY "Note di :" OF  oDlg PIXEL SIZE 100,20 TRANSPARENT
    @ 10,35 DTPICKER aGet[1] VAR dDataNote SIZE 120,12 PIXEL OF oDlg  PICTURE "ddd, dd mmmm yyyy"
    @ 07,170  BTNBMP oBtnCal FILENAME ".\bitmaps\date.bmp" FLAT SIZE 20,14 PIXEL OF oDlg NOBORDER

      oBtnCal:oPopUp:= { |oBtn| BtnPopCalMenu( @dDataNote,aGet) }

   ACTIVATE DIALOG oDlg CENTERED

return nil
//---------------------------------------------------------------------//
Function BtnPopCalMenu( dDataNote,aGet)
  Local oPopupDate

     MENU oPopupDate POPUP 2015
       MENUITEM "Oggi"  ACTION  (dDataNote:=date(),aGet[1]:refresh())
       MENUITEM "Domani"  ACTION ( dDataNote:=date()+1 ,aGet[1]:refresh())
       MENUITEM "DopoDomani"  ACTION ( dDataNote:=date()+2,aGet[1]:refresh())
      SEPARATOR
       MENUITEM "Pulisci"  ACTION ( dDataNote:=ctod("  /  /  ") ,aGet[1]:refresh())
//tried also with   MENUITEM "Pulisci"  ACTION ( aGet[1]:SetDate( ctod("  /  / ") ),aGet[1]:refresh())
    
      ENDMENU

   return oPopupDate
//-------------------------------------------------------------------//
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Clear a get date
Posted: Sun Aug 05, 2018 10:51 PM
Now I found a solution
use a simply Get no datepick

@ 10,35 GET aGet[1] VAR dDataNote SIZE 80,12 PIXEL OF oDlg ; //PICTURE "ddd, dd mmmmm yyyy"
BITMAP ".\bitmaps\cal.bmp" ACTION (dDataNote:=XBrDtPicker( , "Seleziona una date",0.1, ),aGet[1]:CTEXT(cf(dDataNote)),aGet[1]:refresh())

the action call a function Of Nages to show a calendar with Xbrowse

then the menu of btnbmp run ok with

MENUITEM "Pulisci" ACTION ( dDataNote:="",aGet[1]:CTEXT((dDataNote)),aGet[1]:refresh())

this is the result





as you can see it show the bitmap bad into get, but perhaps I have an old release of fwh
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion