anchor.diff:    Self._ColorTable := Value;
   End;
   
  -Procedure TERRAUI.AddWidget(MyWidget:UIWidget);
  -Var
  -  Temp:UIWidget;
  -  Found:Boolean;
  -  It:Iterator;
  -  NameIndex:Integer;
  -  BaseName:TERRAString;
  -Begin
  -  BaseName := MyWidget.Name;
  -  NameIndex := 0;
  -  While Assigned(GetWidget(MyWidget.Name)) Do
  -  Begin
  -    If NameIndex<=0 Then
  -    Begin
  -      Temp := GetWidget(MyWidget.Name);
  -      Temp.Name := BaseName + '_'+IntToString(NameIndex);
  -    End;
  -
  -    Inc(NameIndex);
  -    MyWidget.Name := BaseName + '_' + IntToString(NameIndex);
  -  End;
  -
  -  If (Assigned(MyWidget.Parent)) Then
  -  Begin
  -    (*It := _Widgets.GetIterator();
  -    Found := False;
  -    While (It.HasNext) Do
  -    Begin
  -      Temp := Widget(It.Value);
  -      If (Temp = MyWidget._Parent) Then
  -      Begin
  -        Widget(Temp).AddChild(MyWidget);
  -        Found := True;
  -        Break;
  -      End;
  -    End;
  -    ReleaseObject(It);
  -
  -    If Not Found Then
  -      Log(logWarning, 'UI', 'Error finding parent for '+ MyWidget.Name +'!');*)
  -
  -    MyWidget.Parent.AddChild(MyWidget);
  -  End Else
  -    InsertIntoTopWidgets(MyWidget);
  -
  -  _Widgets.Add(MyWidget);
  -End;
  -
  -Procedure TERRAUI.InsertIntoTopWidgets(W:UIWidget);
  -Var
  -  Found:Boolean;
  -  Temp, Last:UIWidget;
  -Begin
  -  If (Assigned(_First)) Then
  -  Begin
  -    If (_First.Layer > W.Layer) Then
  -    Begin
  -      W.Next := _First;
  -      _First := W;
  -    End Else
  -    Begin
  -      Last := _First;
  -      Temp := _First.Next;
  -      Found := False;
  -      While (Assigned(Temp)) Do
  -      Begin
  -        If (Temp.Layer > W.Layer) Then
  -        Begin
  -          W.Next := Temp;
  -          Last.Next := W;
  -          Found := True;
  -          Break;
  -        End;
  -        Last := Temp;
  -        Temp := Temp.Next;
  -      End;
  -
  -      If (Not Found) Then
  -      Begin
  -        Last.Next := W;
  -        W.Next := Nil;
  -      End;
  -    End;
  -
  -  End Else
  -  Begin
  -    _First := W;
  -    W.Next := Nil;
  -  End;
  -End;
  -
  -Procedure TERRAUI.RemoveFromTopWidgets(W:UIWidget);
  -Var
  -  Current, Temp:UIWidget;
  -Begin
  -  If (_First = W) Then
  -  Begin
  -    _First := _First.Next;
  -    Exit;
  -  End;
  -
  -  Current := _First;
  -  While Assigned(Current) Do
  -  Begin
  -    Temp := Current.Next;
  -    If (Temp = W) Then
  -    Begin
  -      Current.Next := Temp.Next;
  -      Exit;
  -    End;
  -
  -    Current := Temp;
  -  End;
  -End;
  -
  -Procedure TERRAUI.DeleteWidget(MyWidget:UIWidget);
  -Begin
  -  If (MyWidget = Nil) Then
  -    Exit;
  -
  -  MyWidget.Delete();
  -End;
  -
  -Function SearchWidgetByName(P:CollectionObject; UserData:Pointer):Boolean; CDecl;
  -Begin
  -  Result := (UIWidget(P).Name = PString(Userdata)^);
  -End;
  -
  -Function TERRAUI.GetWidget(Const Name:TERRAString):UIWidget;
  -Var
  -  WidgetName:TERRAString;
  -Begin
  -  WidgetName := GetFileName(Name, True);
  -  Result := UIWidget(_Widgets.Search(SearchWidgetByName, @WidgetName));
  -End;
  -
  -
  -Procedure TERRAUI.UpdateLanguage();
  -Var
  -  MyWidget:UIWidget;
  -  It:Iterator;
  -Begin
  -  _Language := Application.Instance.Language;
  -  It := _Widgets.GetIterator();
  -  While (It.HasNext) Do
  -  Begin
  -    MyWidget := UIWidget(It.Value);
  -    MyWidget.OnLanguageChange();
  -  End;
  -  ReleaseObject(It);
  -End;
   
   Procedure TERRAUI.Render;
   Var
  
positive.code:     _Modal := Nil;
  
    If (_Language <> Application.Instance.Language) Then
      UpdateLanguage();
  
    //glEnable(glCoverage);
  
    (*ShaderManager.Instance.Bind(Self.GetShader);
    _Shader.SetUniform('texture', 0);
    _Shader.SetUniform('projectionMatrix', GraphicsManager.Instance.ProjectionMatrix);
    Q.X := GraphicsManager.Instance.Ratio2D.X;
    Q.Y := GraphicsManager.Instance.Ratio2D.Y;
    Q.Z := 1;
    Q.W := 1;
    _Shader.SetUniform('screen_ratio', Q);
  
    PositionHandle := _Shader.GetAttribute('terra_position');
    UVHandle := _Shader.GetAttribute('terra_UV0');
    ColorHandle := _Shader.GetAttribute('terra_color');
    *)
  
    If (UIManager.Instance._UpdateTextureAtlas) Then
      Exit;
  
    GraphicsManager.Instance.Renderer.SetBlendMode(blendBlend);
  
    If _HasDeletions Then
    Begin
      _HasDeletions := False;
  
      It := Self.Widgets.GetIterator();
      While It.HasNext() Do
      Begin
        Current := UIWidget(It.Value);
  
        If Current.Deleted Then
        Begin
          If Current.Parent = Nil Then
            Self.RemoveFromTopWidgets(Current);
  
          Current.Discard();
        End;
      End;
      ReleaseObject(It);
    End;
  
    While (Assigned(_First)) And (Assigned(_First.Parent)) Do
    Begin
      _First := _First.Next;
    End;
  
    Current := _First;
    While (Assigned(Current)) Do
    Begin
      Temp := Current.Next;
      If (Assigned(Temp)) And (Assigned(Temp.Parent)) Then
      Begin
        Current.Next := Temp.Next;
        Temp := Current.Next;
      End;
  
      If (Current.Visible) And (Current.CanRender()) Then
        Current.Render();
  
      Current := Temp;
    End;
  
    //glDisable(glCoverage);
  End;
  
  Procedure TERRAUI.AfterEffects;
  
negative.code:   Base := Target.AbsolutePosition;
    GroupID := Target.HighlightGroup;
  
    It := Self.GetIterator();
    While It.HasNext() Do
    Begin
      W := UIWidget(It.Value);
  