toolbox-programming with oslib
Tony van der Hoff
OSLib at mk-net.demon.co.uk
Tue Oct 17 11:45:53 BST 2000
On Fri, 13 Oct 2000, at 11:38:42, Jonathan Coxhead
<jonathan at doves.demon.co.uk> wrote on the subject "toolbox-programming
with oslib":
> The reason it doesn't is precisely the same reason that we discussed a
>while ago regarding the same situation for message types: it's better
>design if the "base part" is included in only 1 place (wimp.h for messages,
>toolbox.h for templates), and everything else extends it.
>
Yes, it was back in February this year. I can't recall why we decided it
was preferable to use the MEMBERS macro instead of defining a standard
object header, and using that as part of a structure; something to do
with offsets or packing maybe? Can you refresh my memory, please?
> | I shall try to include the full template structure for each object in
> | the next release.
>
> Could you investigate whether the same solution that we used for
>messages also applies here?
>
That's certainly what I had intended to do, and what I think I used in
the example for Uwe:
struct
{
toolbox_RESOURCE_FILE_OBJECT_MEMBERS
colourdbox_object obj;
} colourdbox_template;
The DefMod source would be:
ColourDbox_Template = .Struct
(
Toolbox_ResourceFileObject,
ColourDbox_Object: obj
);
Both the component structs already exist in OSLib. Is that not what you
meant?
There is also a need to declare object action structures, which are
specialised wimp events. I intend to do that at the same time; e.g.
Toolbox_ActionHeader = .Struct
(
.Int: size,
.Int: ref_no,
.Bits: action_no,
.Bits: flags
);
Menu_ActionAboutToBeShownBlock = .Struct
(
Toolbox_ActionHeader: hdr,
Toolbox_PositionTag: tag,
.Union
(
OS_Coord: top_left,
Menu_Full: full
): position
);
Any comments?
--
Tony van der Hoff | mailto:OSLib at mk-net.demon.co.uk
Buckinghamshire, England | http://www.mk-net.demon.co.uk/oslib/
----------------------------------------------------------------
More information about the oslib-user
mailing list