anchor.diff:  begin
     if ANode.FTree <> FTree then
       raise Exception.Create('Nodes must be of the same tree');
  +end;
  +
  +procedure TfpgTreeNode.SetStateImageIndex(const AValue: integer);
  +begin
  +  if FStateImageIndex = AValue then
  +    exit;
  +  FStateImageIndex := AValue;
  +  DoRepaint;
   end;
   
   constructor TfpgTreeNode.Create;
  
positive.code: 
  function TfpgTreeview.GetNodeWidth(ANode: TfpgTreeNode): integer;
  var
    AImage: TfpgImageItem;
  begin
    {$IFDEF DEBUG}
    SendDebug(Classname + '.GetNodeWidth');
  
negative.code:     ACenterPos := YPos - FYOffset + col + (GetNodeHeight div 2);
      YPos := YPos + GetNodeHeight;
      i := GetColumnLeft(StepToRoot(h)) + GetNodeWidth(h);
      imgx := 0;
  
      // only paint the node if it is fully visible
      if i > FXOffset then
      begin
        // State images must always be 16x16 pixels
        if (StateImageList <> nil) and ShowImages then
        begin
          AImageItem := StateImageList.Items[h.StateImageIndex];
          if Assigned(AImageItem) then
          begin
            Canvas.DrawImagePart(w - FXOffset + 1, ACenterPos - 8, AImageItem.Image, 0, 0, 16, 16);
            imgx := 18; // 16px max image width + 2px spacing or right
          end
          else
          begin
            if FIndentNodeWithNoImage then
              imgx := 18
            else
              imgx := 0;
          end;
        end;
  
        if (ImageList <> nil) and ShowImages then
        begin
          AImageItem := ImageList.Items[h.ImageIndex];
          if AImageItem <> nil then
          begin
            Canvas.DrawImagePart(w + imgx - FXOffset + 1, ACenterPos - 8, AImageItem.Image, 0, 0, 16, 16);
            imgx += AImageItem.Image.Width + 2; // 1px spacing on right before node text
          end
          else
          begin
            if FIndentNodeWithNoImage then
              imgx += FNoImageIndent + 2
            else
              imgx += 2;
          end;
        end;
  
        if h = Selection then // draw the selection rectangle and text
        begin
          if Focused then
  