ISlideShowObject (SlideShow object)
1. Definition
The SlideShow object is a base class for all objects, that are used in SlideShow/Stages..
ISlideShowObject procedure SetItem(Index: Integer; Item: ISlideShowObject); function GetItem(Index: Integer): ISlideShowObject; function Text: IText; function Clone: ISlideShowObject; function CloneWithChildren: ISlideShowObject; procedure SetValueAsString(const Key: string; const Value: string); function GetValueAsString(const Key: string): string; procedure SetValueAsSingle(const Key: string; const Value: Single); function GetValueAsSingle(const Key: string): Single; procedure SetValueAsInteger(const Key: string; const Value: Integer); function GetValueAsInteger(const Key: string): Integer; procedure SetValueAsBoolean(const Key: string; const Value: Boolean); function GetValueAsBoolean(const Key: string): Boolean; function NameIs(const AName: string): Boolean; property Name: string; property Offset: Integer; property Duration: Integer; property Parent: ISlideShowObject; property Count: Integer; end;
2. Methods
-
Getter and Setter for child elements. All objects can contain other SlideShow objects (short: SSO) as children. As an outstanding example, you can call the chapter, which combines images in itself. Generally this works with all other objects as well.
procedure InsertItem(Index: Integer; Item: ISlideShowObject); procedure AddItem(Item: ISlideShowObject); procedure SetItem(Index: Integer; Item: ISlideShowObject); function GetItem(Index: Integer): ISlideShowObject;
-
Returns the number of child elements
property Count: Integer;
-
Returns the parent element
property Parent: ISlideShowObject;
-
An SSO can contain text that is of type IText
function Text: IText;
-
Play/display time of an object in milliseconds. Caution! Should be changed only in exceptional cases!
property Duration: Integer; // reading and writing
-
The offset of the object is the distance to the previous object in milliseconds.
property Offset: Integer; // reading and writing
-
Copies the SSO without or with its child element(s)
function Clone: ISlideShowObject; function CloneWithChildren: ISlideShowObject;
-
Getter and Setter for GUI values. The Key specifies which GUI element is meant, Value sets the corresponding value. The data type of value is different from component to component.
procedure SetValueAsString(const Key: string; const Value: string); function GetValueAsString(const Key: string): string;
procedure SetValueAsSingle(const Key: string; const Value: Single); function GetValueAsSingle(const Key: string): Single;
procedure SetValueAsInteger(const Key: string; const Value: Integer); function GetValueAsInteger(const Key: string): Integer;
procedure SetValueAsBoolean(const Key: string; const Value: Boolean); function GetValueAsBoolean(const Key: string): Boolean;
-
Object naming: objects can get an access name in the main program. This can be accessed via the "Name" property.
property Name: string;
-
Returns True if the name of the object is equal to AName. Upper/lower case is ignored.
function NameIs(const AName: string): Boolean;
3. Usage
An ISlideShowObject never comes in its pure form but always as a special variation (e.g. an Image or Text). It's the base for all objects, that are used in SlideShow/Stages. Thus, all others derive from it and can be converted (cast) into an ISlideShowObject:
var Pic: IPicture; var SSO: ISlideShowObject; Pic := CreatePicture; SSO := Pic as ISlideShowObject; // an image can be cast in the more general ISlideShow object