Why the execution is not.
Code: Select all
#include "FiveWin.ch"
#define CR chr(13)
Function main()
publ oWnd, oField := array(250), count := 1 , oFont
DEFINE FONT oFont NAME GetSysFont() SIZE 0, -8
DEFINE WINDOW oWnd
for i := 1 to 50
for j := 1 to 5
@ (i*26), (j*75) BITMAP oField[count] FILENAME "test.bmp" NOBORDER SIZE 70, 24 OF oWnd ADJUST PIXEL
oField[count]:bPainted := { |hDC| OnPaint( hDC, str(count, 3), oFont ) ) }
oField[count]:bLClicked := GenBlock(count)
count += 1
next
next
ACTIVATE WINDOW oWnd
oFont:End()
return nil
//------------------------------------------------
func GenBlock( n )
RETU { || test_button( n ) }
//------------------------------------------------
FUNC OnPaint( hDC, cMsg, oFont )
local hOldFont
hOldFont := SelectObject( hDC, oFont:hFont )
SetBkMode( hDC, TRANSPARENT )
TextOut( hDC, 5, 5, cMsg )
SelectObject( hDC, hOldFont )
RETU NILl
//------------------------------------------------
FUNC test_button(n)
msginfo(n)
RETU NIL