FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Fwh 8.08 - Corrections in classes
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Fwh 8.08 - Corrections in classes
Posted: Tue Oct 21, 2008 12:30 PM

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

Oscar Ribeiro

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Fwh 8.08 - Corrections in classes
Posted: Mon Oct 27, 2008 11:42 AM

Oscar,

>
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
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Fwh 8.08 - Corrections in classes
Posted: Fri Oct 31, 2008 01:37 PM

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.

Oscar Ribeiro

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Fwh 8.08 - Corrections in classes
Posted: Fri Oct 31, 2008 05:51 PM

Oscar,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Fwh 8.08 - Corrections in classes
Posted: Mon Nov 03, 2008 01:07 PM
Antonio,

This is my VALID.

   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.
Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Fwh 8.08 - Corrections in classes
Posted: Wed Nov 05, 2008 05:09 PM

Dear Antonio,
Does you read my example?
Thanks

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 140
Joined: Tue Oct 11, 2005 02:36 AM
Fwh 8.08 - Corrections in classes
Posted: Sun Nov 09, 2008 07:18 PM
Comigo isso tambem acontece

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

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


MODIFICADO
   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
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
It´s possible to solve
Posted: Fri Nov 28, 2008 07:08 PM

Antonio,
It´s possible to solve in next version?
Thanks
Oscar

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Fwh 8.08 - Corrections in classes
Posted: Fri Nov 28, 2008 08:24 PM

Oscar,

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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Fwh 8.08 - Corrections in classes
Posted: Fri Nov 28, 2008 08:26 PM

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

Continue the discussion