by mastintin » Thu Jun 13, 2013 7:26 am
Es una mejora menor para el metodo
cGenprg():
- Code: Select all Expand view
METHOD New( )
.......
// DEFAULT cVarName := "oBtnBmp" + ::GetCtrlIndex()
::cVarName = "oBtnBmp" + ::GetCtrlIndex() //cVarName ----- por añadir como parametro
if lDesign
......
METHOD cGenPRG( lDlgUnits ) CLASS TBtnBmp
local nFactorX, nFactorY
local cTop, cLeft, cWidth, cHeight
local cPrg := ""
DEFAULT lDlgUnits := .F.
IF ::oWnd:IsKindOf( "TBAR" )
cPrg += CRLF + CRLF + " DEFINE BTNBMP OF oBar " + ;
'ACTION MsgInfo( "Not defined yet" )'
ELSE
nFactorX = If( lDlgUnits, 4 / nLoWord( GetDlgBaseUnits() ), 1 )
nFactorY = If( lDlgUnits, 8 / nHiWord( GetDlgBaseUnits() ), 1 )
::CoorsUpdate()
cTop = LTrim( Str( Int( ::nTop * nFactorX ) ) )
cLeft = LTrim( Str( Int( ::nLeft * nFactorY ) ) )
cWidth = LTrim( Str( Int( ::nWidth * nFactorY ) ) )
cHeight = LTrim( Str( Int( ::nHeight * nFactorX ) ) )
cPrg += CRLF + " @ " + cTop + ", " + cLeft + ;
' BTNBMP '+ ::cVarName + ' PROMPT "' + ::cCaption + '" SIZE ' + ;
cWidth + ", " + cHeight + ;
" 2007 RESOURCE 'okon' PIXEL OF oWnd ;" + CRLF + ;
' ACTION MsgInfo( "Not defined yet!" )' + CRLF
endif
return cPrg