anchor.diff:  end;
   
   
  -{Make sure image area is at least enough to fit an image, or bigger}
  -{if Width/Height are 0 then image gets centered around Left/Top}
  -{if Width/Height are smaller than actual image then adjust them to fit image}
  -{if Width/Height are bigger than actual image then image will be centered within bounds}
   constructor TKMImage.Create(aParent:TKMPanel; aLeft, aTop, aWidth, aHeight, aTexID, aRXid:integer);
   begin
  -  RXid:=aRXid;
  -  TexID:=aTexID;
  +  RXid := aRXid;
  +  TexID := aTexID;
     Anchors := [anLeft, anTop];
     Inherited Create(aLeft, aTop, aWidth, aHeight);
     ParentTo(aParent);
  
positive.code: 
  {One common thing - draw childs for self}
  procedure TKMControl.Paint();
  var i:integer;
  begin
    if Self is TKMPanel then //Only Panels have childs    //todo: move to TKMPanel!
    for i:=1 to TKMPanel(Self).ChildCount do
      if TKMPanel(Self).Childs[i].Visible then
      begin
        TKMPanel(Self).Childs[i].Paint;
        inc(CtrlPaintCount);
      end;
  end;
  
  
  {Shortcuts to Controls properties}
  procedure TKMControl.Enable;  begin Enabled:=true;  end;
  
  function TKMControl.GetHeight: Integer;
  begin
    Result := Round(fHeight * Scale);
  end;
  
  function TKMControl.GetLeft: Integer;
  begin
    Result := Round(fLeft * Scale);
  end;
  
  function TKMControl.GetTop: Integer;
  begin
    Result := Round(fTop * Scale);
  end;
  
  function TKMControl.GetWidth: Integer;
  begin
    Result := Round(fWidth * Scale);
  end;
  
  procedure TKMControl.Disable; begin Enabled:=false; end;
  procedure TKMControl.Show;    begin Visible:=true;  end;
  procedure TKMControl.Hide;    begin Visible:=false; end;
  
  
  {Check Control including all its Parents to see if Control is actually displayed/visible}
  function TKMControl.IsVisible():boolean;
  var C:TKMControl;
  begin
    Result:=Visible;
    C:=Self.Parent;
    while C<>nil do begin
      Result:=Result and C.Visible;
      C:=C.Parent;
    end;
  end;
  
  
  { TKMPanel } //virtual panels to contain child items
  procedure TKMPanel.CheckCursorOver(X, Y: integer; AShift: TShiftState);
  var
    I: Integer;
  begin
    inherited;
    for i:=1 to ChildCount do
      if Childs[i].Visible and Childs[i].Enabled then
         Childs[i].CheckCursorOver(X,Y,AShift);
  end;
  
  constructor TKMPanel.Create(aParent:TKMPanel; aLeft,aTop,aWidth,aHeight:integer);
  begin
    Inherited Create(aLeft,aTop,aWidth,aHeight);
    ParentTo(aParent);
  end;
  
  
  {Panel Paint means to Paint all its childs}
  procedure TKMPanel.Paint();
  begin
    if MakeDrawPagesOverlay then fRenderUI.WriteLayer(Left, Top, Width, Height, $400000FF);
    Inherited Paint;
  end;
  
  
  
negative.code: 
  {If image area is bigger than image - do center image in it}
  procedure TKMImage.Paint();
  var
    OffsetX, OffsetY, DrawWidth, DrawHeight:smallint; //variable parameters
    StretchDraw:boolean; //Check if the picture should be stretched
  begin
    if (TexID=0)or(RXid=0) then exit; //No picture to draw
  
    StretchDraw := false; 
    DrawWidth := Width;
    DrawHeight := Height;
    OffsetX := 0;
    OffsetY := 0;
  
    if anRight in Anchors then OffsetX := Width - GFXData[RXid, TexID].PxWidth; //First check "non-zero offset" anchor incase both anchors are set
    if anLeft in Anchors then OffsetX := 0;
  