Fwh 8.08 - Corrections in classes

Post Reply
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Fwh 8.08 - Corrections in classes

Post by ORibeiro »

Corrections in class:

Fwh 8.08:

Class: SAY.PRG = Removes line 266 because it makes the text to disrespect the limit of the field defined in the resource
// ::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )

Class: WINDOW.PRG = Removes the line 2434 of the KeyChar method () because it makes with that keyboard key ESC in the systems using windows MDI take off the focus of the MsgYesNo ()
// ::oWnd:KeyChar( nKey, nFlags )

Thank´s

_ Ribeiro
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

_,

>
Class: SAY.PRG = Removes line 266 because it makes the text to disrespect the limit of the field defined in the resource
// ::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
>

This has been improved in FWH 8.09 and 8.10

>
Class: WINDOW.PRG = Removes the line 2434 of the KeyChar method () because it makes with that keyboard key ESC in the systems using windows MDI take off the focus of the MsgYesNo ()
// ::oWnd:KeyChar( nKey, nFlags )
>

Could you provide a small example to test it ? Do you mean to press ESC on a MsgYesNo() shown on top of a MDI frame or a MDI child ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Post by ORibeiro »

Hi Antonio,

It is a pleasure to contact you.

The problem happens with MDI Child. In my application, when I pressure ESC to close the Child Window the MsgYesNo(“Desires to leave?”) he is disoriented and not insurance the focus in it.

I tried to reproduce in a small example but I did not obtain.

All new version is necessary to disactivate this line that I mentioned in the Window.prg to correct this problem.


I wait to have helped.

Thanks a lot.

_ Ribeiro
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

_,

Do you call MsgYesNo() from the VALID of the MDI child window ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Post by ORibeiro »

Antonio,

This is my VALID.

Code: Select all


   ACTIVATE DIALOG oDlgP NOWAIT VALID oWndC:End()
   ACTIVATE WINDOW oWndC ;
            ON PAINT FnSelect(cDbf[01]);
            VALID (SysWait(0.1),tBtPrinc[09]:SetFocus(),iif(Atualizou(oDlgP),(Grava(.T.)),.T.),oScb:SetFocus(),Destroi_Campos(),;
                   Fecha_Arquivo(cDbf[1]),Fecha_Formulario(oWndC,oDlgP,,cFrm,cPrg) )


********************************************************************************************
FUNCTION Atualizou(oDlg,lGravou)
********************************************************************************************
* Verifica se houve alteracoes na get sem serem salvas *
Local f:=1
local g:=1
local h:=1
local Contador:=0
local a,b
   lGravou := iif(lGravou=nil,.F.,lGravou) // Verifica se houve a gravacao
   While f<=Len(oDlg:aControls) //acontrols é uma propriedade de todas as dialogs e é criada automaticamente
      if     oDlg:aControls[f]:ClassName()="TGET" .or. oDlg:aControls[f]:ClassName()="TMULTIGET"
         a := oDlg:aControls[f]:cCaption  // Gets Antes
         b := oDlg:aControls[f]:cText     // Gets Depois
         if a<>b
            oDlg:aControls[f]:cCaption:=b // Atualiza cCaption
            if !lGravou // Se nao gravou
               Contador++
            endif
         endif
      elseif oDlg:aControls[f]:ClassName()="TFOLDER"
         g := 1
         While g<=Len(oDlg:aControls[f]:aDialogs) // Checa todos os Dialogs da Folder
            h := 1
            While h<=Len(oDlg:aControls[f]:aDialogs[g]:aControls)
               if oDlg:aControls[f]:aDialogs[g]:aControls[h]:ClassName()="TGET" .or. oDlg:aControls[f]:aDialogs[g]:aControls[h]:ClassName()="TMULTIGET"
                  a := oDlg:aControls[f]:aDialogs[g]:aControls[h]:cCaption  // Gets Antes
                  b := oDlg:aControls[f]:aDialogs[g]:aControls[h]:cText     // Gets Depois
                  if a<>b
                     oDlg:aControls[f]:aDialogs[g]:aControls[h]:cCaption:=b // Atualiza cCaption
                     if !lGravou // Se nao gravou
                        Contador++
                     endif
                  endif
               endif
               h++
            enddo
            g++
         end
      endif
      f++
   End
   if !lGravou .and. !Empty(Contador)
      Return(.T.)
   Endif
Return(.F.)

********************************************************************************************
Static function Grava(lConf)
********************************************************************************************
   If lConf
      if !MsgYesNo("Confirma a gravação?","Confirme")
         Return(.F.)
      endif
   Endif
   // VÁLIDO //
   if !Valido()
      Return(.F.)
   endif
   Select (cDBF[01])
   // Se alterou o Nome, modifica arquivos relacionados //
   if cNovo<>"NOVO" .and. Field->Nome<>CFNome[2]
      FnAltNome( "FOR", cPrg, CFNome[2], Field->Nome )
   endif
   Select(cDbf[01])
   FnReplace(,,,cPrg,cDbf[1],cNovo,.T.)
   cNovo := "CONSULTA"
   Atualiza_Campos()
   CFAbrev[1]:Setfocus()
   CFNr_Fo[1]:SetFocus()
Return(.T.)

Thank you.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Post by ORibeiro »

Dear Antonio,
Does you read my example?
Thanks
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Post by miragerr »

Comigo isso tambem acontece

Uma coisa que percebi é que se EU comento esta linha na Window.prg funciona normal

ORIGINAL

Code: Select all


   METHOD EndPaint() INLINE ::nPaintCount--,;
                     EndPaint( ::hWnd, ::cPS ), ::cPS := nil, ::hDC := nil , 0 // keep this zero here!

MODIFICADO

Code: Select all


   METHOD EndPaint() INLINE ::nPaintCount--,;
                     EndPaint( ::hWnd, ::cPS ), ::cPS := nil, ::hDC := nil // , 0  // keep this zero here! ///// ---->>> comento o ZERO 

Desta forma funciona normal, quando tenho VALID nas dialogs

Fico no aguardo
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

It´s possible to solve

Post by ORibeiro »

Antonio,
It´s possible to solve in next version?
Thanks
_
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

_,

We need a small and self contained example to test here.

Please provide us an example that reproduces what you describe, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jackson,

You should not remove that zero. Its important to keep it here.

Please provide a small and self contained example to reproduce the problem with a dialog, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply