I am writing a windows-based game and want to place a number of small pictures on the screen. The user will be clicking on any of these screen objects and I want to know which one was clicked.
I know I can test the @mousex and @mousey locations in a message to determine which object was clicked but I'd rather create a control for each and use the control's message to identify it. However, the documentation doesn't seem to have any control that can contain a picture file. Am I missing something?
Thanks.
This is from the help manual:
Bitmap buttons and static controls
Buttons and static controls have the capability of displaying a bitmap instead of text. To define a bitmap button use the flag @CTLBTNBITMAP for a button or @CTLSTCBITMAP for static controls To specify the bitmap to display set the buttons text to the complete pathname to the bitmap file with the SETCONTROLTEXT statement. If your button is contained in a dialog use SETCONTROLTEXT in response to the @IDINITDIALOG message.
DEF d1 as DIALOG
CREATEDIALOG d1,0,0,295,168,0x80C80080, 0, "Bitmap Test", &dialog_main
CONTROL d1,@STATIC,"",13,14,102,102,@CTLSTCBITMAP, 1
DOMODAL d1
END
SUB dialog_main
SELECT @MESSAGE
CASE @IDINITDIALOG
SETCONTROLTEXT d1,1,GETSTARTPATH + "bug.bmp"
CENTERWINDOW d1
ENDSELECT
RETURN
ENDSUB
Barney
Thanks Barney!! I'll give it a try.