Wrapping labels
Garry (87) 184 posts |
Hello, It would seem the Toolbox ‘Label’ cannot do this, but of course TextArea can. I see there are functions to change the from Corpus to a proportional font, but I don’t see any to take away the grey background to make it transparent and have the RISC OS ‘granite’ show through (seriously, I like the granite). Is this possible? I don’t need to be able to edit the text, just display. Thanks Garry |
Rick Murray (539) 13840 posts |
Don’t know about toolbox, but the Wimp can do this. For invisible background, set the background colour to “none”. Remember, there are additional “complications” when using a multitasking error prompt. You need to lock out certain parts of your application as you will be waiting for a response from the user, while permitting other parts of the application (redraws etc) to continue. You will need to make sure that the user can’t do anything elsewhere that contravenes what the question is asking… |
Chris Johnson (125) 825 posts |
Using the toolbox, the simplest is probably to use a ‘Button’ gadget, and customise its flags in the validation string to give a multiline capability (is it L? – can’t remember offhand) and border appearance. The button gadget is little more than an icon so can be tailored as any icon can be. This is ok for strings of length 200 chars or so. For much more text, then the textarea is probably the easiest. You are using oslib, so that has all the textarea calls and button calls. |
Garry (87) 184 posts |
OK, sounds good to me, I think TextArea might be best for me, as it’s possible (not likely) that I’ll need to put in more than 200 chars. Many thanks Garry |
Steve Drain (222) 1620 posts |
Do not forget what Rick mentioned, the text in a multiline Button gadget will be centred both horizontally and vertically. Also, you cannot introduce newlines1 which looks odd for long messages. I do not think there is necessarily a limit on the size if you make the buffer large enough, and I have just checked with one 500 bytes long. 1 I seem to remember an earlier dicussion about how to simulate this and the possibility of making it available. |
Chris Johnson (125) 825 posts |
I was not suggesting that there was a limit of 200 chars in an icon, simply that once the text gets to this sort of length it is not so easy to read, and the icon has to be of a size to cope with the largest expected text. With a textarea, you can give it scroll bars, so text of tens of K characters can be dealt with just as easily. You do not have to provide permanent storage for the text, since the textarea gadget takes its own copy of the text. Indeed, you can edit, save, etc text in a textarea fairly easily (although ROL’s version of the textarea gadget has more built-in features than does the RISC OS 5 version). |
nemo (145) 2546 posts |
L-validation icons were always half-arsed, inefficient, inflexible and restricted, and ought to be spurned. |
Rick Murray (539) 13840 posts |
Chris:
256 (inc. terminator). That’s more than you can legitimately provide as an OS error message. Myself:
Must have been thinking of something else (VisualBasic maybe?). It’s the “Filled” option that does this. nemo:
Yes, dunno about inefficient, yes and yes (turn off H and V centred and, oh look, it still IS), and we probably would if there was a better option. One that handles newlines and lets you select centred or left aligned. |