Page 1 of 1

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

Posted: Thu Jun 21, 2012 1:36 pm
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

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

Posted: Wed Jun 27, 2012 12:30 pm
by Ale SB
sin embargo, no hay solución?

Saluds, Ale

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

Posted: Wed Jun 27, 2012 3:57 pm
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,

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

Posted: Thu Jun 28, 2012 1:29 pm
by Ale SB
Coloquei Sim Joao.

Neste exemplo Observe q nem Botao tem.

Saluds, Ale