BUG, 1º Get + Valid do Folder...

Post Reply
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

BUG, 1º Get + Valid do Folder...

Post by Ale SB »

Ao Sair de um Get da Dialog e Caindo no Folder, se o 1º Get do Folder estiver com um valid ele eh acionado Automaticamente, veja:
TestFold.prg

Code: Select all

#include "FiveWin.ch"
#include "Folder.ch"

function Main()

   local oDlg, oFld, oGet, oGetFld1, cGetFld2
   local cGet1 := Space(10), nGetF1 := 0, cGetF2 := space(10)

   DEFINE DIALOG oDlg RESOURCE "Test"

     REDEFINE GET oGet VAR cGet1 ID 21 OF oDlg PICTURE "@!"  UPDATE  //valid !Empty(cGet1)

     REDEFINE FOLDER oFld ID 110 OF oDlg ;
              PROMPT "Test" ;
              DIALOGS "Sub1" ;
              UPDATE

      REDEFINE GET oGetFld1 VAR nGetF1 ID 21 OF oFld:aDialogs[1] PICTURE "999" valid ValidGet( nGetF1 ) UPDATE
     REDEFINE GET oGetFld2 VAR cGetF2 ID 22 OF oFld:aDialogs[1] PICTURE "@" 
     
   ACTIVATE DIALOG oDlg CENTERED
    
return nil

********************************************************************************
function ValidGet( _nGetF1 )

    if _nGetF1 == 0
       msginfo("Valid Folder Get1 Erro")
       return .f.
    endif

return .t.
 
TestFold.Rc

Code: Select all

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_PORTUGUESE,SUBLANG_PORTUGUESE_BRAZILIAN

TEST DIALOG DISCARDABLE 19, 47, 233, 157
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
CAPTION "FiveWin Folders Demo"
{
  CONTROL "Get1", 4001, "Static", SS_CENTERIMAGE|WS_GROUP, 8, 8, 32, 12, WS_EX_STATICEDGE
  CONTROL "", 21, "Edit", ES_AUTOHSCROLL|WS_TABSTOP, 44, 8, 176, 12, WS_EX_STATICEDGE
  CONTROL "", 110, "SysTabControl32", WS_TABSTOP, 4, 28, 225, 99
}

SUB1 DIALOG DISCARDABLE 18, 18, 205, 80
STYLE WS_CHILD|DS_3DLOOK
{
  CONTROL "Valid", 4001, "Static", SS_CENTERIMAGE|WS_GROUP, 4, 4, 32, 12, WS_EX_STATICEDGE
  CONTROL "", 21, "Edit", ES_AUTOHSCROLL|WS_TABSTOP, 40, 4, 136, 12, WS_EX_STATICEDGE
  CONTROL "Get", 4003, "Static", SS_CENTERIMAGE|WS_GROUP, 4, 20, 32, 12, WS_EX_STATICEDGE
  CONTROL "", 22, "Edit", ES_AUTOHSCROLL|WS_TABSTOP, 40, 20, 136, 12, WS_EX_STATICEDGE
}
 
Notei que o problema pode estar aqui :

Code: Select all

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

METHOD GotFocus( hWndLoseFocus ) CLASS TFolder

   Super:GotFocus( hWndLoseFocus )
    
   if ::nOption > 0 .and. ::nOption <= Len( ::aDialogs )
      ::aDialogs[ ::nOption ]:AEvalWhen()
      ::aDialogs[ ::nOption ]:SetFocus()
   endif

return 0
 
Se eu Colocar um MsgInfo, o problema se resolve :

Code: Select all

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

METHOD GotFocus( hWndLoseFocus ) CLASS TFolder

   Super:GotFocus( hWndLoseFocus )
    
   if ::nOption > 0 .and. ::nOption <= Len( ::aDialogs )
      ::aDialogs[ ::nOption ]:AEvalWhen()
      ::aDialogs[ ::nOption ]:SetFocus()
   endif
  
   msginfo("Pause")

return 0
 
Qual seria a soluçao Correta ?

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Re: BUG, 1º Get + Valid do Folder...

Post by Ale SB »

sin embargo, no hay solución?

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: BUG, 1º Get + Valid do Folder...

Post by karinha »

Você colocou o CANCEL UPDATE no Botão de Saida??

Experimente colocar CANCEL UPDATE em todos os botões do DIALOGO do Folder para ver.

Abs,
João Santos - São Paulo - Brasil
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Re: BUG, 1º Get + Valid do Folder...

Post by Ale SB »

Coloquei Sim Joao.

Neste exemplo Observe q nem Botao tem.

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
Post Reply