Posible cambio en la clase btnBmp

Posible cambio en la clase btnBmp

Postby mastintin » Fri Aug 06, 2010 9:16 am

Yo creo que sería mas correcto que btnbmp derive de la clase button que de control ¿ No ? .
No estoy muy ducho en esto de las clases de fivewin aún , pero creo que la cosa quedaria algo asi ( ojo sin probar aún ).
Code: Select all  Expand view

#include "FiveMac.ch"

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

CLASS TBtnBmp FROM TButton
 
   METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, bAction, cFileName )
   METHOD SetFileName( cFileName ) INLINE If( File( cFileName ), BtnBmpFile( ::hWnd, cFileName ),)
   
ENDCLASS  

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

METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, bAction, cFileName ) CLASS TBtnBmp

   DEFAULT nWidth := 50, nHeight := 50, oWnd := GetWndDefault()

   ::hWnd = BtnBmpCreate( nTop, nLeft, nWidth, nHeight, oWnd:hWnd )
   ::oWnd  = oWnd
   ::bAction = bAction

   if ! Empty( cFileName )
      ::SetFileName( cFileName )
   endif  
   
   oWnd:AddControl( Self )
   
return Self  

//----------------------------------------------------------------------------//
 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Return to FiveMac / FivePhone (iPhone, iPad)

Who is online

Users browsing this forum: No registered users and 6 guests