QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: Qwerkey on September 06, 2018, 07:46:07 am

Title: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: Qwerkey on September 06, 2018, 07:46:07 am
Can characters which are not standard text be used in Label captions?  I am wanting to create a label with an Up Arrow or a Down Arrow and I used the code:

Caption(Label1) = "A Bit of text" + CHR$(24)

In screen 0, PRINT CHR$(24) produces an Up Arrow character (is that region setting dependent?), but this has not produced an Up arrow after the text  in the above code - which is no great surprise: using CHR$(N%) with N% less than32 is always dangerous.

Would there be a way to produce such a character?  Or a ready-made label with an arrow in it?

Richard (getting more quirky by the minute)
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: SMcNeill on September 06, 2018, 08:15:36 am
Does setting _CONTROLCHR OFF have any affect?  It's sometimes needed to display various CHR$ codes on screen.
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: FellippeHeitor on September 06, 2018, 09:09:11 am
@Steve: _CONTROLCHR is set to OFF by default with InForm.

@Richard: Low ASCII characters will display fine if the font you're using has support for the specific codes you want to use.

In beta 8 (actually still Alpha 8 (https://github.com/FellippeHeitor/InForm/archive/Beta8.zip)) you can add special ascii by using an escape code like \24; for CHR$(24). In beta 7, CHR$() will work just fine if you set it in your program.

I've had to use arrows in an InForm database program I wrote for  work and used CHR$(17) and CHR$(16). But then I set the buttons font to the builtin emulated _FONT 16. Do so by specifying no font file and size 16 (that is, by just entering a comma and the number 16 in the font field).

Another thing: buttons can have icons. If you want to use a custom image, just specify an image file in the editor. Works for buttons as well as for menu items. If you remove a button's caption and use an image you'll end up with a fine looking graphic control.
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: TempodiBasic on September 06, 2018, 10:06:49 am
Hi guys

Hey Richard what do you think about using special font like Webding http://fay.iniminimo.com/webdings.html (http://fay.iniminimo.com/webdings.html),  Wingdings https://en.wikipedia.org/wiki/Wingdings (https://en.wikipedia.org/wiki/Wingdings). these fonts seem to have more fun symbols to use as character.
Maybe that wingdings3 has more suitable symbols for your arrows... see link or attachment

Quote
buttons can have icons. If you want to use a custom image, just specify an image file in the editor. Works for buttons as well as for menu items. If you remove a button's caption and use an image you'll end up with a fine looking graphic control

Good Coding

Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: FellippeHeitor on September 06, 2018, 10:15:29 am
The thing with using those fonts is that they are all unicode fonts and it'd be a tad trickier to get them working with InForm.
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: TempodiBasic on September 06, 2018, 10:48:04 am
Hi Fellippe
Ok

About image/icon for button and menu... what is the dimensions of the image to be used with?
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: FellippeHeitor on September 06, 2018, 11:41:06 am
Whatever the dimensions of the image are, it will be resized to fit the area of the button. If you resize the button it'll be resized as well.

For MenuItem controls, the image will be resized to be 16 pixels tall, so it's a good idea to provide one that's already downsampled to 16x16 to avoid the artifacts that resizing an image at runtime can cause.
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: Qwerkey on September 06, 2018, 11:53:16 am
Fellippe, I was just about to thank Tempo for his good suggestion - looks just like what I want, but not easy with InForm?  Never mind, I have made an arrow image instead which works pretty well.

Like the new avatar, Richard
Title: Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
Post by: FellippeHeitor on September 06, 2018, 12:02:07 pm
Like the new avatar, Richard

Thanks!