Clear a get date

Clear a get date

Postby Silvio.Falconi » Tue Jul 31, 2018 5:55 pm

I have a get date with datepick
Near I have a btnbmp with a Menu to select actions


Image


Code: Select all  Expand view
@ 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clear a get date

Postby karinha » Tue Jul 31, 2018 6:59 pm

Code: Select all  Expand view

   oBtnCal:oPopUp:= { |oBtn| BtnPopCalMenu( @dDataNote,aGet ), aGet[1]:Refresh() }
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7813
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Clear a get date

Postby Silvio.Falconi » Wed Aug 01, 2018 12:36 am

Error !!!

Code: Select all  Expand view
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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clear a get date

Postby karinha » Wed Aug 01, 2018 1:24 pm

Code: Select all  Expand view

#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
User avatar
karinha
 
Posts: 7813
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Clear a get date

Postby nageswaragunupudi » Thu Aug 02, 2018 6:46 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Clear a get date

Postby Silvio.Falconi » Fri Aug 03, 2018 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clear a get date

Postby Silvio.Falconi » Sun Aug 05, 2018 9:50 pm

is there a bug on datepicker class ?

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

Code: Select all  Expand view
#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clear a get date

Postby Silvio.Falconi » 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

Image



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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 112 guests