the user must click on chips (bottom) to select one bet
Problems
1. when I insert the bitmap on dialog ( have another bitmap) it create a shadow white ( see the red circle)
2. then ( see the GetArea function) I cannot insert many coordinates for the click , how I can resolve this ?
the test
if you wish the images I can send you
- Code: Select all Expand view
#include "fivewin.ch"
#include "constant.ch"
static oDlg21
Function test()
Local nBottom := 42
Local nRight := 99
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
oImagen = TImage():Define("PANNOBLACK", )
DEFINE DIALOG oDlg21 ;
TITLE "hh" ;
SIZE nWidth, nHeight
oDlg21:bPainted := {|hDC| PalBmpDraw( hDC, 0, 0, oImagen:hBitmap,, oDlg21:nWidth, oDlg21:nHeight,, .T.) }
ACTIVATE DIALOG oDlg21 CENTERED ;
ON INIT (BuildMenu(nHeight,nWidth))
RETURN NIL
Function Play21(nHeight,nWidth)
Local oBmp1
@ nHeight-152, nWidth-270 Bitmap oBmp1 OF oDlg21 FILENAME "chips.bmp" SIZE 260,140 PIXEL NOBORDER
oBmp1:ltransparent:=.t.
oBmp1:bLClicked = { | nRow, nCol | MsgInfo( GetArea( nRow, nCol, oBmp1 ) ) }
return nil
Function BuildMenu(nHeight,nWidth)
MENU oMenu 2015
MENUITEM "&Info"
MENU
MENUITEM "Play" ACTION Play21(nHeight,nWidth)
MENUITEM "Authors" ACTION nil
SEPARATOR
MENUITEM "&Exit" ACTION oDlg21:End()
ENDMENU
ENDMENU
oDlg21:SetMenu(oMenu)
RETURN NIL
function GetArea( nRow, nCol, oBmp )
do case
case nRow >= 92 .and. nRow<= 117
return "1"
case nRow >= 68 .and. nRow<= 91
return "5"
case nRow == 81
return "10"
case nRow == 53
return "25"
case nRow ==20 .OR. nRow == 19
return "100"
otherwise
return str(nRow)+ ",per favore centra la chip per selezionarla"
endcase
return nil