Page 1 of 2
ImageButton with an additional parameter: TEXT
Posted: Mon May 12, 2008 3:47 pm
by byo
Hi, all.
I know this was debated before and that we can use ownerdraw buttons instead but it'd be really great to have an ImageButton where you could add text natively.
Some days ago, I showed a friend of mine who is a programmer PB's IDE and execution and he was very much interested in it. Then he saw my app with uninteresting buttons (my fault

) and asked my if I could create an image button with text. I said to him that I would have to create some WinAPI code with a callback to this component and he was not so much interested anymore. Sometimes ownerdraw buttons, when disabled, release or pushed don't behave like real buttons.
To sum it up: visual components are very very important to a programming language. I know you can search a forum until you find what you want. But having a basic feature like that one would be a nice showcase. Please, no flame posts. This is just a request to improve this language I love.
Thank you, Fantaisie Software team.
Re: ImageButton with an additional parameter: TEXT
Posted: Mon May 12, 2008 9:44 pm
by UserOfPure
byo wrote:image button with text
That's just a ButtonGadget.

Or did you mean with a picture on it?
Posted: Mon May 12, 2008 11:56 pm
by byo
Hmm... not quite. Today you can (natively) create a button either with text or with an image but not combine them, set the text to appear at right from the image without having to write additional code. Owner drawn buttons lose their "&" character in front of the text (key shortcuts) and when they're disabled the whole drawn area turns dark gray because it's an image square.
Sparkie and some others have some good code to create owner drawn buttons but I just wish we had this natively within the ImageButtonGadget creation. Buttons are essential and different builtin styles help a lot.

Posted: Tue May 13, 2008 8:10 am
by Fluid Byte
Buttons are essential and different builtin styles help a lot.
True but it's the programers job to include them.
Posted: Tue May 13, 2008 12:34 pm
by byo
Sure. But that's not the point of this feature request. I know that you can insert anything into your code but gadgets are there for easy of use. Otherwise we would all be adding them ourselves like PowerBasic and that's why Purebasic is still far superior (at least from that perspective). Because it combines elements of a tidy and stable programming language with RAD elements so you don't have to write lots of code.
If you know some code that won't draw a rectangle on a button and it's easy to implement, please do post. I'm not complaining. Purebasic is great.
Posted: Thu Feb 12, 2009 6:22 am
by Rook Zimbabwe
I wouldlike to add a serious +1000 votes to this request. I can use an ICON or a PNG file as the background and then overdraw TEXT in chosen color! That would make the GUI of my apps SING!!!
As well as being able to disable it cleanly from within PB if need be!!!
I have used Spakies code and played with Jiles as well... They don't work in my app where text and button usage is dynamic.
Posted: Thu Feb 12, 2009 4:01 pm
by zikitrake
+1
Posted: Sun Feb 15, 2009 9:26 pm
by DoubleDutch
+1
Posted: Sun Feb 15, 2009 9:40 pm
by utopiomania
I agree with byo. A good looking UI is a must, and you don't need to make up a new butttton-image for each language you publish in
if this was possible.
I tend to use the webgadget to render program UI's due to restrictions like this.
Posted: Wed Feb 25, 2009 4:49 pm
by Emiliano
Agreed. +1
Posted: Wed Feb 25, 2009 11:09 pm
by RichardL
Posted: Wed Feb 25, 2009 11:41 pm
by rsts
That is a nice routine.
I use it in several of my programs. Thanks again for sharing.
cheers
Re: ImageButton with an additional parameter: TEXT
Posted: Fri Jan 08, 2010 7:19 pm
by byo
I am so sorry to have bumped this.
But Purebasic would really be a better language for the eyes with ImageTextButtons.
I'd love to see new gadgets but I think this is a priority IMHO.

Almost every serious software today has images and text in their buttons.
I'd even make a small donation again.
Thanks for all the support.
You guys are the best.
Regards,
Andre
Re: ImageButton with an additional parameter: TEXT
Posted: Fri Jan 08, 2010 9:28 pm
by Fred
What are the 'serious' software you are using ? Out of curiosity, i checked the ones i use, and strangely none of them had buttons with image in it:
* VisualC++
* VMWare
* UltraEdit
* FireFox
* VLC
* OpenOffice
* Putty
* Thunderbird
* MediaMonkey
* Windows 7
* PureBasic

Re: ImageButton with an additional parameter: TEXT
Posted: Fri Jan 08, 2010 9:51 pm
by Foz
I refute the Windows 7 that you mention - as of Vista, the file dialogs (copy - "rename, overwrite or cancel", delete) not only have an image, but they have a title and a caption per button for the confirming of the action.