SysList control: changing font does not work (C10)

Hi all.

Using a SysList control on a window in my C10 application. I try to change the font of this SysList control so that it looks like the rest of my other controls. Please see the screenshot.
I tried for example:
SysList1.SetFont('Microsoft Sans Serif',12)
But no change of the font and size.
In C6 this works ok btw.

I use this version of SysList in my C10 application:

There you can see the source of SysListClass.SetFont in syslist.clw.
So in my C6 application I can change the font, but in C10 it does nothing at all.

EDIT: I made a small example, which als use SysTree:

I have attached SysListTree-example.zip. Please run VIEWDOCS and select a folder. You can see that the files of the SysList control aren’t displayed in the Consolas font.
SysListTree-example.zip (866,1 KB)

I hope somebody can help me with this.

Thanks and best regards
Jeffrey

Hi Jeffrey,
In one of my applications, I have :

OF EVENT:OpenWindow
  ! Autosize columns for SysList control: SysList1
  SysList1.SetColumnWidth(0, SYSLISTCOLUMNWIDTH:AUTOSIZE)
  ! [Priority 8500]
  SysList1.SetFont('Consolas',14)
  ! End of “Window Event Handling”

And it works perfectly.

Hi Eric,

Thanks. I tried your code here, but there’s no change in the font and size.
When I also pass a color, then I only see the color change.

Have you tried my example in C10?
(In C6 all is working ok.)

Best regards
Jeffrey

Hi Jeffrey,

No, I hadn’t tested your example but I just did (C11) and compared the properties of the 2 SysList1 (mine and yours) and didn’t find any noticeable difference that would explain why it works in my application and not in yours:

Image1 Image2

Image 1: SysList1.SetFont('Consolas', 12 ,COLOR:Red,,)
Image 2: SysList1.SetFont('Consolas', 8 ,COLOR:Red,,)

I’ll take a closer look another day.

Best regards,
Eric

Hi Eric,

Thank you.
I use C10 and a List view with SysList.
I see that you use Large Icons with SysList?

Again, thank you very much for testing!

Best regards
Jeffrey

Hi Jeffrey,

I have just tested the example program supplied with SysList and found that
1/ SysList1.SetFont('Consolas',24,COLOR:Red,) gives :

2/ SysList1.SetFont('Consolas',12,COLOR:Green,) gives :
Image2

So there’s a problem with your program and not with the SysList control.

Best regards,
Eric

Hi Jeffrey,

I’ve just modified your program by adding a new SysList control (Name only) below yours:

And the font size does change. I think you should delete your SysList1 control and recreate another one instead.
Have a nice evening!

Best regards,
Eric

Thanks a lot Eric!

I will investigate further.
Have a nice weekend!

Best regards
Jeffrey

With pleasure, good weekend to you too Jeffrey.

Best regards,
Eric

Hello Jeffrey,

I had a little time at the end of the day and I may have found the reason for the problem you’re having. The SysList control you inserted is embedded as IMAGE whereas when I insert a new SysList control mine is embedded as TEXT.

and the font change (color, size) is done correctly with you code:

Best regards,
Eric

1 Like

Hi Eric,

Wow, thank you very much, you made my weekend!!

Awesome!

Best regards
Jeffrey

Prop:buffer?
Transparent property? That affects some clarion controls during a resize which might have an effect.

Theres another prop: which affects screen draws but I cant think what it is at the moment but it can be used in combo with prop:buffer, but it sounds like an event/msg isnt happening when the font resize takes place hence the difference between image and text thats seen.

You are most welcome Jeffrey.

Best regards,
Eric

It’s possible Richard, but I’m just an amateur who knows how to use Clarion to make the programs I need or for the pleasure of learning.

Best regards,
Eric

1 Like

We are all amatuers. :grinning:

That makes sense why it doesn’t work. An Image control does not have Font attributes.

If you look inside SysList.clw code .Init() the Font specs come from the container control. The .SetFont() method first changes the container control Prop:Fontxxxx’s which won’t work with an Image.

1 Like

Thank you Carl for these explanations which make sense. I had found that by replacing IMAGE with TEXT Jeffrey’s code worked well and now I know why. Have a nice Sunday.

Best regards,
Eric

Thank you Carl, that makes sense!

Best regards
Jeffrey