anchor.diff:        ObjectsTable: array [0..8] of TKMButtonFlat;
         ObjectsScroll: TKMScrollBar;
       PopUp_ObjectsPalette: TKMPopUpMenu;
  -      ObjectsPalette_Bevel: TKMBevel;
  -      ObjectsPalette_Image: TKMImage;
  -      ObjectsPalette_Label: TKMLabel;
  -      ClosePalette_Button: TKMButton;
  -      ObjPaletteTable: array of TKMButtonFlat;
  -      ObjectsPalette_Scroll: TKMScrollBar;
  +      Bevel_ObjectsPalette: TKMBevel;
  +      Image_ObjectsPalette: TKMImage;
  +      Label_ObjectsPalette: TKMLabel;
  +      Button_ClosePalette: TKMButton;
  +      ObjectsPaletteTable: array of TKMButtonFlat;
  +      Scroll_ObjectsPalette: TKMScrollBar;
     public
       constructor Create(aParent: TKMPanel);
   
  
positive.code:   // Update Objects Palette scroll position
    if not (ObjIndex in [61, 255])
      and not InRange(ObjIndex,
                      ObjectsPalette_Scroll.Position*fObjPaletteTableSize.X,
                      ObjectsPalette_Scroll.Position*fObjPaletteTableSize.X + fObjPaletteTableSize.X*fObjPaletteTableSize.Y - 1) then
      ObjectsPalette_Scroll.Position := ((ObjIndex - 1) div fObjPaletteTableSize.X);
  end;
  
  
  
negative.code: 
    RowsCnt := (PopUp_ObjectsPalette.Height - 80) div 85;
    ColsCnt := Min(OBJECTS_PALETTE_MAX_COLS_CNT, (PopUp_ObjectsPalette.Width) div 65); // Calc cols count without Scroll first
    Scroll_ObjectsPalette.Visible := RowsCnt*ColsCnt < fCountCompact;
    ColsCnt := Min(OBJECTS_PALETTE_MAX_COLS_CNT, (PopUp_ObjectsPalette.Width - 25*Byte(Scroll_ObjectsPalette.Visible)) div 65); // Recalc ColsCount considering possible scroll width
  
    fObjPaletteTableSize := KMPoint(ColsCnt, RowsCnt);
  
    Image_ObjectsPalette.Width := GetObjPaletteTableWidth + 100;
    Image_ObjectsPalette.Height := GetObjPaletteTableHeight + 150;
    Image_ObjectsPalette.Left := (PopUp_ObjectsPalette.Width - Image_ObjectsPalette.Width) div 2;
    Image_ObjectsPalette.Top := ((PopUp_ObjectsPalette.Height - Image_ObjectsPalette.Height) div 2);
  
    Label_ObjectsPalette.Left := PopUp_ObjectsPalette.Center.X;
    Label_ObjectsPalette.Top := Image_ObjectsPalette.Top + 25;
  
    Button_ClosePalette.Left := PopUp_ObjectsPalette.Center.X - 100;
    Button_ClosePalette.Top := Image_ObjectsPalette.Bottom - 70;
  
    Scroll_ObjectsPalette.Left := Image_ObjectsPalette.Right - 50;
    Scroll_ObjectsPalette.Top := Image_ObjectsPalette.Top + 50;
    Scroll_ObjectsPalette.Height := Image_ObjectsPalette.Height - 150;
  
    Scroll_ObjectsPalette.MaxValue := ((fCountCompact - 1) div ColsCnt) + 1 - RowsCnt;
  
    ObjectsPalette_Refresh(nil);
  end;
  