Silverfrost Forums

Welcome to our forums

Property sheets - captions

14 Oct 2020 5:13 #26468

There is a difference in how the captions are displayed on Property Sheet tabs when they are provided explicitly, or supplied as a character string. The following code demonstrates this

	winapp
        program main
	integer propsheet(3) ! handle to the property sheet
        integer ii
        character*13:: caption='   caption   '
        ii = winio@('%sh%ca[   caption   ]sheet 1',propsheet(1))
        ii = winio@('%sh%ca@Sheet 2',propsheet(2),caption)
        ii = winio@('%2ps[ms_style,hot_track]',propsheet(1),propsheet(2))
        end

The first sheet will have the caption displayed with all the characters; that is, the spaces present before and after the text are displayed. The second sheet using a character variable does not have the trailing spaces displayed.

While this is perhaps a minor issue, because captions are used to identify the tabs, it is not possible to do an equivalent of 'centering' by supplying spaces before and after the caption. I could dynamically build the caption in a local character string, then have winio@() execute it, but now brackets that I use in captions cannot be displayed. So, I am stuck...

Bill

14 Oct 2020 8:51 #26469

John, I may be mistaken about this, but it is likely that when winio@() processes the variable, it trims the spaces off of the back. That is why they are different. When I set a caption for a window, this does not happen. How can I tell? Because if I make the variable 250 characters in length, I'll get a really wide window displayed.

A property sheet, while having some windows properties, is a different animal.

Bill

14 Oct 2020 9:10 #26470

Bill,

Sometimes you can get the trailing space characters to show if you replace n blanks with n-1 and a full stop (period to you). It's not all that obvious to most users. Eventually you may find out the real way to do it, but in the meantime you have a workaround!

Eddie

15 Oct 2020 7:19 #26471

When using the @ system, trailing spaces are indeed removed.

Character number 127 in the ASCII table (named DEL) can be used as an alternative to a space (32). In the Microsoft 'Character Map' dialog this is call a 'no-break space'.

You can copy and paste this in Plato. It's not UNICODE and you don't need UTF8.

You only need to change the final character to a no-break space.

18 Oct 2020 5:47 #26479

Paul, great news that there is a workaround that I can also make 'transparent'.

Thanks very much for your detective work.

Bill

19 Oct 2020 11:48 #26492

This leaves a vertical bar on the right hand side of my captions.

However, using char(128+32) (basically a 'space' with the high order bit set) does the job!

Bill

.

20 Oct 2020 7:47 #26494

Bill

The outcome will depend on the font being used.

20 Oct 2020 2:51 #26499

Noted. Thanks for this comment.

Bill

Please login to reply.