Author Topic: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions  (Read 16689 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« 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)

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #1 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.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #2 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) 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.
« Last Edit: September 06, 2018, 09:32:41 am by FellippeHeitor »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #3 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,  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

Wingdings3.png
* Wingdings3.png (Filesize: 21.41 KB, Dimensions: 756x465, Views: 456)
Programming isn't difficult, only it's  consuming time and coffee

FellippeHeitor

  • Guest
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #4 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.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #5 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?
Programming isn't difficult, only it's  consuming time and coffee

FellippeHeitor

  • Guest
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #6 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.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #7 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

FellippeHeitor

  • Guest
Re: Mastering InForm: Non-AlphaNumeric Charcters in Control Captions
« Reply #8 on: September 06, 2018, 12:02:07 pm »