CLASS modification

Re: CLASS modification

Postby Jimmy » Tue May 30, 2023 5:06 pm

hi Silvio,
Silvio.Falconi wrote:I press on datepick must refresh the btnbmp

i do "see" that BTMBMP "seems disable" :?:
when "refresh" it does only "re-paint" but not "enable" it or EVAL() ACTION of BTNBMP

---

i have ask why DTPICKER and GET have "same" Position @ nRow, 70

as you need a String, not Date, you can use DTOC()
to "validate" if a String "is" a Date use CTOD()
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: CLASS modification

Postby Silvio.Falconi » Wed May 31, 2023 7:09 am

>i have ask why DTPICKER and GET have "same" Position @ nRow, 70

because DATEPICK and GET ARE NOT N THE SAME POSITION

Must I publish all my source code here ?
Code: Select all  Expand view  RUN
local nRow:= 0,nCol:= 10
   local nInterlinea := 30

 ddatacambio := oBrw:aArraydata[nRecord][1]
    cGiorno     := oBrw:aArraydata[nRecord][2]
    ncambio     := oBrw:aArraydata[nRecord][3]


  nRow+=8
   @ nRow, 10 SAY oSay[1] PROMPT  "Data " SIZE 100,25  PIXEL OF oDlgSub  TRANSPARENT  FONT oFont
   nRow-=2
 @ nRow, 70 DTPICKER  aGet[1] VAR ddatacambio OF oDlgSub SIZE 198, 25 PIXEL ;
      FONT oFont UPDATE PICTURE "ddd dd mmm yyyy"  ;
     VALID ( DoSwitch( oBtnGetExchange  ) ) STYLE DTS_SHOWNONE
   nRow+=nInterlinea
   @ nRow,10  SAY oSay[2] PROMPT  "Cambio" SIZE 100,25  PIXEL OF oDlgSub  TRANSPARENT  FONT oFont
   nRow-=2
   @ nRow, 70 GET aGet[2] VAR nCambio SIZE 200,24 PIXEL OF oDlgSub RIGHT
   @ nRow-0.2,  320 BTNBMP oBtnGetExchange ;
              PROMPT "Aggiorna on line"  OF oDlgSub;
              SIZE 120, 24 PIXEL FLAT GDIPLUS ;
              BITMAP "BTN_INTERNET"    LEFT NOROUND ;
              ACTION   .....

return nil


 STATIC FUNCTION DoSwitch( oBtnGetExchange  )
   oBtnGetExchange:Refresh()
RETURN .T.


>i do "see" that BTMBMP "seems disable" :?:
>when "refresh" it does only "re-paint" but not "enable" it or EVAL() ACTION of BTNBMP

yes the btnbmp must be disabled, only when there is a valid data the btnbmp must be enable, on init the ddatacambio is ctod('')
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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: CLASS modification

Postby Jimmy » Wed May 31, 2023 5:19 pm

hi Silvio,
Silvio.Falconi wrote:yes the btnbmp must be disabled, only when there is a valid data the btnbmp must be enable, on init the ddatacambio is ctod('')

i do not "see" CODE which "enable" or "disable" BTNBMP

as i say "Refresh" does only "paint" Control but did not "modify" it
Code: Select all  Expand view  RUN
  VALID ( DoSwitch( ddatacambio, oBtnGetExchange) )

STATIC FUNCTION DoSwitch( ddatacambio, oBtnGetExchange  )
LOCAL dDate := ddatacambio:GetDate()
LOCAL cDate := DTOC(dDate)

   IF EMPTY(cDate)
      oBtnGetExchange:Disable()
   ELSE
      oBtnGetExchange:enable()
   ENDIF
   oBtnGetExchange:Refresh()
RETURN .T.
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: CLASS modification

Postby Silvio.Falconi » Mon Jun 05, 2023 7:08 am

Error
Image

Code: Select all  Expand view  RUN
Application
===========
   Path and name: C:\Work\Prg\valute\Pvalute.Exe (32 bits)
   Size: 4,631,040 bytes
   Compiler version: Harbour 3.2.0dev (r2104281802)
   FiveWin  version: FWH 22.03
   C compiler version: Borland C++ 5.8.2 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 15 secs
   Error occurred at: 05-06-2023, 09:06:37
   Error description: Error BASE/1004  Metodo non disponibile: GETDATE
   Args:
     [   1] = D   05-06-2023

Stack Calls
===========
   Called from:  => GETDATE( 0 )
   Called from: source\Pvalute.prg => DOSWITCH( 1134 )
   Called from: source\Pvalute.prg => (b)EDIT_STORICO( 1085 )
   Called from: .\source\classes\TDTPICKE.PRG => (b)TDATEPICK_NEW( 168 )
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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests