May 10, 2024, 09:00:03 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Is there a picture control?

Started by aronoffs, May 03, 2008, 12:39:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aronoffs

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.

Barney

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

aronoffs

Thanks Barney!! I'll give it a try.