FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error en folders
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Error en folders
Posted: Fri Oct 11, 2013 10:06 AM
Quiero crear dinamicamente hojas de folder segun tenga mas o menos Datos que mostrar , pero me encuentro con un error en los folders .
Dejo el codigo simplificado que genera el error :

Code (fw): Select all Collapse
#include "FiveWin.ch"

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

function Main()

   local oDlg, oFld

   DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
      FROM 5, 5 TO 20, 50 COLOR "N/G"

   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 160, 90

 
  
   ACTIVATE DIALOG oDlg CENTERED ;
   ON INIT ( ofld:delPages() ,oFld:addItem("Hola") )

return nil

//----------------------------------------------------------------------------//
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Error en folders
Posted: Fri Oct 11, 2013 12:29 PM
creo que ejista un error aqui:

Code (fw): Select all Collapse
METHOD DelPages() CLASS TFolder

   while Len( ::aPrompts ) > 0
      ::DelItem()
   end

return nil


Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: Error en folders
Posted: Fri Oct 11, 2013 02:38 PM
El error est谩 en la clase , en concreto en el Metodo SetOption cuando ::nOpci贸n tiene valor 0.

Con esto a mi me resuelve el problema , pero ser铆a bueno mirarlo detenidamente :

Code (fw): Select all Collapse
METHOD SetOption( nOption ) CLASS TFolder

   local nOldOption
     
   if nOption > 0  .and. nOption != ::nOption .and. ::aEnable[ nOption ]

      if ::nOption == 0      // a帽adido para solucionar el error cuando ::nOpcion := 0
         ::nOption  = nOption
      endif 
      if ::nOption <= Len( ::aDialogs ) .and. ::aDialogs[ ::nOption ] != nil
         ::aDialogs[ ::nOption ]:Hide()
      endif
      nOldOption = ::nOption
      ::nOption  = nOption

     ...
     
return nil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error en folders
Posted: Fri Oct 11, 2013 03:03 PM
Manuel,

Esta soluci贸n, parecida, tambien parece servir:

Code (fw): Select all Collapse
METHOD SetOption( nOption ) CLASS TFolder

   local nOldOption

   if nOption > 0 .and. nOption != ::nOption .and. ::aEnable[ nOption ]
      if ::nOption <= Len( ::aDialogs ) .and. ::nOption > 0 .and. ::aDialogs[ ::nOption ] != nil
         ::aDialogs[ ::nOption ]:Hide()
      endif
      ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: Error en folders
Posted: Fri Oct 11, 2013 03:14 PM
Antonio Linares wrote:Manuel,

Esta soluci贸n, parecida, tambien parece servir.

Ok. Esta opci贸n mucho mejor .Solucionado

Continue the discussion