Page 2 of 2

Re: Aplicación se "congela"

PostPosted: Mon Jul 11, 2016 1:44 pm
by karinha
Code: Select all  Expand view

#include "FiveWin.ch"
#include "Ribbon.ch"

function Main()

   local oDlg, oPopup, oBtn

   DEFINE DIALOG oDlg RESOURCE "Test"

   REDEFINE RBBTN oBtn ID 100 OF oDlg POPUP ;
      MENU BuildPopup() ROUND ACTION MsgInfo( "click" ) ;
      PROMPT "Class TRBtn" BITMAP "..\bitmaps\16x16\fivetech.bmp" LEFT

   ACTIVATE DIALOG oDlg CENTERED

   FreeResources()

   SysRefresh()

   DbCloseAll()

   RELEASE All

   Hb_GCAll( .T. )

   CLEAR MEMORY

   CheckRes()

   PostQuitMessage( 0 )

   __QUIT()


return nil

function BuildPopup()

   local oPopup
   
   MENU oPopup POPUP 2007
      MENUITEM "One" ACTION MsgInfo( "One" ) FILE "..\bitmaps\16x16\fivetech.bmp"
      MENUITEM "Two" ACTION MsgInfo( "Two" ) FILE "..\bitmaps\16x16\fivetech.bmp"
      SEPARATOR
      MENUITEM "Three" ACTION MsgInfo( "Three" ) FILE "..\bitmaps\16x16\fivetech.bmp"
   ENDMENU
   
return oPopup
 



Re: Aplicación se "congela"

PostPosted: Mon Jul 11, 2016 4:25 pm
by cnavarro
Si, eso está incluído en versiones posteriores a la que indicas

Re: Aplicación se "congela"

PostPosted: Mon Jul 11, 2016 5:33 pm
by Antonio Linares
Angel,

Asi tambien debería funcionar bien:
Code: Select all  Expand view
METHOD Destroy() CLASS TRBtn

   DeleteObject( ::hArrow )
   
   if ::hBack != ::oWnd:hBack
      DeleteObject( ::hBack )
   endif
   
   DeleteObject( ::hRgn )

   ::FreeBitmaps()
   if ::oPopup != nil
      ::oPopup:End()
   endif
   
   Super:Destroy()

return 0

Re: Aplicación se "congela"

PostPosted: Mon Jul 11, 2016 6:48 pm
by AngelSalom
Antonio Linares wrote:Angel,

Asi tambien debería funcionar bien:
Code: Select all  Expand view
METHOD Destroy() CLASS TRBtn

   DeleteObject( ::hArrow )
   
   if ::hBack != ::oWnd:hBack
      DeleteObject( ::hBack )
   endif
   
   DeleteObject( ::hRgn )

   ::FreeBitmaps()
   if ::oPopup != nil
      ::oPopup:End()
   endif
   
   Super:Destroy()

return 0


En efecto, así también libera correctamente los recursos.