Acorn Arcade forums: Programming: Title bar validation strings
|
Title bar validation strings |
|
Chris (16:29 30/12/2012) apdl (09:51 31/12/2012) Chris (17:59 2/1/2013)
|
|
Chris |
Message #121720, posted by Chris at 16:29, 30/12/2012 |
Member
Posts: 283
|
Recently noticed that an app I'm working on would cause some nasty errors when run alongside certain others (Edit and Draw would both crash and exit with Internal Error messages). I narrowed the problem down to my app loading a template with a validation string ('///C445566') in the title bar. Remove this, and everything seems to work fine.
I'm not sure what I'm doing wrong here. My code is, I think, fairly straightforward: use Wimp_LoadTemplate to find the window and indirected data size, and then reserve enough space for both. Checking against the stats in WinEd, I seem to be reserving the right amounts for the templates I'm loading. If the window title is indirected it doesn't cause a problem, only if it also has a validation string. There are plenty of other icons in my app's various windows with validation strings, and they cause no problems.
Do I need to do anything specific to cope with validation strings in indirected title bars when using Wimp_LoadTemplate? I've had a look at the PRMs and StrongHelp manuals, and can't see anything. Using RO5.19 on RPCEmu. |
|
[ Log in to reply ] |
|
David Holden |
Message #121722, posted by apdl at 09:51, 31/12/2012, in reply to message #121720 |
Member
Posts: 138
|
The title bar is not an icon; it's part of the window definition. It can have the usual icon flags (although some of these are ignored, eg. border, colour, drag type, etc.) and it can be indirected and can have a validation string (in theory) but why on earth would you want one?
The main purpose of a validation string is to set what characters are valid and the action of the Return and Tab key in a writable icon, and the title bar can't be writable. I would suggest that you're trying to do something that can't be done with a title bar in your validation string. |
|
[ Log in to reply ] |
|
Chris |
Message #121724, posted by Chris at 17:59, 2/1/2013, in reply to message #121722 |
Member
Posts: 283
|
I was playing around with giving the window work area a 24-bit colour value. As far as I know, the only way to do this is to use the 'C' validation string in the title bar's icon definition. Seems to work fine, in terms of how the window looks, but it did lead to the errors I mentioned. |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: Title bar validation strings |