Unit 'TagsParamsHelper' Package
[Overview][Constants][Classes][Procedures and functions][Index] [#MUIClass]

TATagList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

A Tagelist for easier Taglist handling

Declaration

Source position: tagsparamshelper.pas line 27

type TATagList = object

public

  procedure Clear;

  

Clear the TagList

  function GetTagPointer;

  

Get the Pointer to the TagList as it should be supplied to Amiga Calls

  procedure AddTag();

  

Add a Single Tag to the TagList

  procedure AddTags();

  

Add a bunch of Tags

  procedure DebugPrint;

  

Prints the whole list to the Debug Output

end;

Inheritance

TATagList

  

A Tagelist for easier Taglist handling

|

TObject

Description

Use the TagList as normal variable, in the usual cases you do not need to keep it, so a local variable in most cases enough.

To call the function needing the TagList supply this variable directly at the position of the taglist, it will automatically transfer the needed Pointer. Alternatively you can also use the GetTagPointer() function to get the Pointer you need as parameter.

Note: if you add Tags you have to get the TagPointer again. You do not need to add TAG_DONE/TAG_END to the list, it will be added automatically as last Tag.

Example:

procedure OpenMyWindow(ATitle: string = ''): PWindow;
var
  Tags: TATagList;
begin
  // Add a bunch of Tags
  Tags.AddTags([
    WA_Left,   10,
    WA_Top,    20,
    WA_Width,  500,
    WA_Height, 300,
    WA_Flags,  WFLG_DEPTHGADGET or WFLG_DRAGBAR or WFLG_CLOSEGADGET or
      WFLG_ACTIVATE or WFLG_OTHER_REFRESH or WFLG_GIMMEZEROZERO,
    WA_IDCMP,  IDCMP_CLOSEWINDOW or IDCMP_REFRESHWINDOW or IDCMP_IDCMPUPDATE,
  ]);
  // Add a single Tag
  if ATitle <> '' then
  begin
    FTitle := ATitle;
    Tags.AddTag(WA_Title, AsTag(PChar(FTitle)));
  end;
  // ready top open the Window
  Result := OpenWindowTagList(nil, Tags);
end;

Documentation generated on: 2022-07-30