IonicWind Software

Creative Basic => GUI Programs => Topic started by: GWS on November 01, 2018, 05:03:38 AM

Title: Revised Ascii Table
Post by: GWS on November 01, 2018, 05:03:38 AM
Hi,

Here's another little program I use quite a bit, to select Ascii characters.

It uses a Listview control - which I'm not very impressed with - it's a bit clunky in it's basic form.

I've amended the Listview in this program, to draw lines for row and columns, and highlight the whole line if you click anywhere on a multi-column control.  It looks much better now.

I had to use some 'magic' constants to achieve this - which I don't like doing.  Still, as long as it does the job.

The extended Ascii characters vary, so I used the set most often found.

The program is attached.

all the best, :)

Graham






Title: Re: Revised Ascii Table
Post by: Brian on November 03, 2018, 11:15:43 AM
Graham,

Hope you don't mind, but I converted your program to IWB, moved the buttons around, and put in the code to show the selected character when you move up or down the listview with the cursor keys

Brian
Title: Re: Revised Ascii Table
Post by: GWS on November 07, 2018, 05:02:03 AM
That sounds interesting Brian ..

Thanks also for pointing out the Ascii 38 & problem.

That was a weird one ..  ::)

It turns out that you can't display an & sign in a textbox ..  Never came across that before.

For instance, if you try to display A&B  - you will get the A followed by an underscored B - very odd.

I tried several tricky workarounds with no success.

In fact the Ampersand character was there, you just can't see it.

So the easiest way was to replace the upper right hand text box, with an Edit box.

The Ampersand is now there, but of course the Edit box brings problems of it's own.
So I made it Read-only so that the text can't be changed.
I also put in a bit of code so that if you click on the Edit box, the cursor does not appear.
In practice, it's just a classy Text box ..  :)

Hope it will be OK now.  I'll check out your IW mods ..

The new version is attached ..

All the best, :)

Graham

Title: Re: Revised Ascii Table
Post by: Brian on November 07, 2018, 05:13:18 AM
Graham,

Well worked out. I will take a look at your mods and apply it to the IWB version

Brian
Title: Re: Revised Ascii Table
Post by: Brian on November 07, 2018, 05:26:11 AM
Hi,

Just modified my IWB version of Graham's Ascii chart, and put in his modifications. Looks OK to me

Brian
Title: Re: Revised Ascii Table
Post by: fasecero on November 07, 2018, 05:51:33 AM
Create the static with SS_NOPREFIX to display an & sign in a textbox

CONST SS_NOPREFIX = 0x00000080

https://docs.microsoft.com/en-us/windows/desktop/controls/static-control-styles

QuoteSS_NOPREFIX

Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls. You can combine SS_NOPREFIX with other styles. This can be useful when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box.
Title: Re: Revised Ascii Table
Post by: Brian on November 07, 2018, 06:14:41 AM
Well spotted. I was sat in the little room, when I realised it was thinking that the & was being interpreted as an accelerator

Brian
Title: Re: Revised Ascii Table
Post by: Andy on November 07, 2018, 06:23:43 AM
And if you want an ampersand in a button, you double it like this....

CONTROL win4,@SYSBUTTON,"Save && Restart program",20,440,200,30,@TABSTOP,FileOk

Andy.
Title: Re: Revised Ascii Table
Post by: GWS on November 08, 2018, 08:54:19 AM
I've incorporated Brian's idea to scroll the Listview
- it behaves pretty well now.

All it needed, was to OR the (@NOTIFYCODE = @LVNITEMCHANGED), with the (@NOTIFYCODE = @NMCLICK) in the messages subroutine ..

case 10
' Listview clicked or scrolled - Read the data from @QUAL into mem
   if(@NOTIFYCODE = @NMCLICK) | (@NOTIFYCODE = @LVNITEMCHANGED)
   mem = @QUAL
   READMEM mem,1,lv

.... etc ....


All the best, :)

Graham