QB64.org Forum

Active Forums => Programs => Topic started by: Parkland on April 17, 2020, 01:28:57 pm

Title: Buttons for qb programs
Post by: Parkland on April 17, 2020, 01:28:57 pm
This is code I've been adding to things for years, it works alright.
It creates buttons with 1 instruction,
then 1 instruction to render the graphics, and 1 for the mouse procedure.
I've used it for 1 or 2 buttons, and even on screen keyboard it worked before.

To make button:
CALL guiaddbutton("button1", "Buttons!!!", 50, 50, 150, 70, 0)
The button name (whatever you want) , the button text (or filename if image is used),  x,y,x,y,  then 0 or 1, 0 is text button, 1 is image.

CALL guirender
CALL handlemouse

clickname$ will now = the name of the button that was clicked.

Title: Re: Buttons for qb programs
Post by: Parkland on April 17, 2020, 01:37:32 pm
Just a note, you'll have to comment out the one "guiaddbutton" command that uses and image, or change it to an image that exists on your computer
Kind of forgot to comment that out.

Also, I commented out the load font command in the beginning of the program, and I think 3 font references throughout the program for compatibility and ease of use, but it could use custom fonts if you find those and put them back in as active
Title: Re: Buttons for qb programs
Post by: Pete on April 17, 2020, 02:23:11 pm
I don't think WinButt would be a Microsoft approved name. Just sayin'.

You might want to check out Fell's InForm Sub-Forum for buttons, etc., too. Fun stuff!

Pete :D
Title: Re: Buttons for qb programs
Post by: Parkland on April 17, 2020, 05:23:54 pm
Micro who?
haha jk.

I downloaded that inform once, couldn't figure it out within 5 minutes and never looked at it again as I had no need for anything so far that elaborate.
I may check it out again soon though.
Title: Re: Buttons for qb programs
Post by: TerryRitchie on April 17, 2020, 05:56:52 pm
I don't think WinButt would be a Microsoft approved name. Just sayin'.

Haha! I LOLed at that one. Your wise ass cracks me up Pete.