ImageButton with an additional parameter: TEXT

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

ImageButton with an additional parameter: TEXT

Post 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 :D ) 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.
Proud registered Purebasic user.
Because programming should be fun.
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: ImageButton with an additional parameter: TEXT

Post by UserOfPure »

byo wrote:image button with text
That's just a ButtonGadget. ;) Or did you mean with a picture on it?
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post 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. :)
Proud registered Purebasic user.
Because programming should be fun.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Buttons are essential and different builtin styles help a lot.
True but it's the programers job to include them.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post 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.
Proud registered Purebasic user.
Because programming should be fun.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post 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!!!

:D

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.
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
zikitrake
Addict
Addict
Posts: 868
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Post by zikitrake »

+1
PB 6.21 beta, PureVision User
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

+1
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post 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.
Emiliano
User
User
Posts: 13
Joined: Fri Sep 26, 2008 10:40 am
Location: Italy

Post by Emiliano »

Agreed. +1
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

That is a nice routine.

I use it in several of my programs. Thanks again for sharing.

cheers
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Re: ImageButton with an additional parameter: TEXT

Post 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
Proud registered Purebasic user.
Because programming should be fun.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ImageButton with an additional parameter: TEXT

Post 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 ;)
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: ImageButton with an additional parameter: TEXT

Post 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.
Post Reply