MODULE WMVisualComponentSkeleton;
IMPORT
Strings, XML, WMGraphics, WMProperties, WMComponents;
TYPE
YourComponent* = OBJECT(WMComponents.VisualComponent)
VAR
property- : WMProperties.Int32Property;
propertyCached- : WMProperties.Int32Property;
propertyCachedI : LONGINT;
PROCEDURE &Init;
BEGIN
Init^;
SetNameAsString(StrYourComponent);
NEW(property, NIL, StrProperty, StrPropertyDescription); properties.Add(property);
NEW(propertyCached, NIL, StrPropertyCached, StrPropertyCachedDescription); properties.Add(propertyCached);
END Init;
PROCEDURE Initialize;
BEGIN
Initialize^;
END Initialize;
PROCEDURE PropertyChanged(sender, property : ANY);
BEGIN
IF (property = property) THEN
ELSIF (property = propertyCached) THEN
propertyCachedI := propertyCached.Get();
ELSE
PropertyChanged^(sender, property);
END;
END PropertyChanged;
PROCEDURE RecacheProperties;
BEGIN
RecacheProperties^;
propertyCachedI := propertyCached.Get();
END RecacheProperties;
PROCEDURE DrawBackground(canvas : WMGraphics.Canvas);
BEGIN
DrawBackground^(canvas);
END DrawBackground;
END YourComponent;
VAR
StrYourComponent,
StrProperty, StrPropertyDescription,
StrPropertyCached, StrPropertyCachedDescription : Strings.String;
PROCEDURE GenYourComponent*() : XML.Element;
VAR yourComponent : YourComponent;
BEGIN
NEW(yourComponent); RETURN yourComponent;
END GenYourComponent;
PROCEDURE InitStrings;
BEGIN
StrYourComponent := Strings.NewString("YourComponent");
StrProperty := Strings.NewString("Property");
StrPropertyDescription := Strings.NewString("Description of Property");
StrPropertyCached := Strings.NewString("PropertyCached");
StrPropertyCachedDescription := Strings.NewString("Description of PropertyCached");
END InitStrings;
BEGIN
InitStrings;
END WMVisualComponentSkeleton.