anchor.diff:  
   procedure TfpgTreeview.HandleKeyPress(var keycode: word;
     var shiftstate: TShiftState; var consumed: boolean);
  -begin
  -  inherited HandleKeyPress(keycode, shiftstate, consumed);
  +var
  +  h: TfpgTreeNode;
  +  OldSelection: TfpgTreeNode;
  +begin
  +  OldSelection := Selection;
  +  case KeyCode of
  +    keyRight:
  +      begin
  +        Consumed := True;
  +        Selection.Collapsed := false;
  +        DoExpand(Selection);
  +        ResetScrollbar;
  +        RePaint;
  +      end;
  +      
  +    keyLeft:
  +      begin
  +        Consumed := True;
  +        Selection.Collapsed := true;
  +        ResetScrollbar;
  +        RePaint;
  +      end;
  +      
  +    keyUp:
  +      begin
  +        if Selection = nil then
  +          Selection := RootNode.FirstSubNode
  +        else
  +          if Selection <> RootNode then
  +          begin
  +            if NodeIsVisible(selection) then
  +            begin
  +              h := PrevVisualNode(Selection);
  +              if (h <> RootNode) and (h <> nil) then
  +                Selection := h;
  +            end
  +            else
  +            begin
  +              Selection := RootNode.FirstSubNode;
  +            end;
  +          end;
  +          Consumed := True;
  +      end;
  +      
  +    keyDown:
  +      begin
  +        Consumed := True;
  +        if Selection = nil then
  +          Selection := RootNode.FirstSubNode
  +        else
  +        begin
  +          if NodeIsVisible(selection) then
  +          begin
  +            h := NextVisualNode(Selection);
  +            if (h <> nil) then
  +              Selection := h;
  +          end
  +          else
  +            Selection := RootNode.FirstSubNode;
  +        end;
  +      end;
  +      
  +    else
  +      Consumed := False;
  +  end;
  +
  +  if Selection <> OldSelection then
  +  begin
  +    RePaint;
  +    DoChange;
  +  end;
  +
  +  if not Consumed then
  +    inherited HandleKeyPress(keycode, shiftstate, consumed);
   end;
   
   procedure TfpgTreeview.HandleMouseScroll(x, y: integer;
  
positive.code:   n := ANode;
    if ANode.Prev <> nil then
    begin
      result := ANode.Prev;
      ANode := ANode.Prev;
      while (not ANode.Collapsed) and (ANode.Count > 0) do
      begin
        result := ANode.LastSubNode;
        aNode := ANode.LastSubNode;
      end;
    end
    else
  
negative.code: end;
  
  function TfpgTreeview.NextVisualNode(ANode: TfpgTreeNode): TfpgTreeNode;
    //----------------
    procedure _FindNextNode;
    begin
      if ANode.Next <> nil then
      begin
        result := ANode.Next;
      end
      else
      begin
        while ANode.Next = nil do
        begin
          ANode := ANode.Parent;
          if ANode = nil then
            exit;  //==>
        end;
        result := ANode.Next;
      end;
    end;
  
  begin
    result := nil;
    if ANode.Collapsed then
    begin
      _FindNextNode;
    end
    else
    begin
      if ANode.Count > 0 then
      begin
        result := ANode.FirstSubNode;
      end
      else
        _FindNextNode;
    end;
  end;
  
  