anchor.diff:    PopUp_ObjectsPalette.Left := 25;
     PopUp_ObjectsPalette.Top := 25;
   
  -    ObjectsPalette_Bevel := TKMBevel.Create(PopUp_ObjectsPalette, -1000,  -1000, 4000, 4000);
  -    ObjectsPalette_Bevel.BackAlpha := 0.7;
  -    ObjectsPalette_Bevel.EdgeAlpha := 0.9;
  -
  -    ObjectsPalette_Image := TKMImage.Create(PopUp_ObjectsPalette, 0, 0, PopUp_ObjectsPalette.Width, PopUp_ObjectsPalette.Height, 3, rxGuiMain);
  -    ObjectsPalette_Image.ImageStretch;
  -
  -    ObjectsPalette_Scroll := TKMScrollBar.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Width - 20, 25, 20, PopUp_ObjectsPalette.Height - 75, sa_Vertical, bsGame);
  -    ObjectsPalette_Scroll.MinValue := 0;
  -    ObjectsPalette_Scroll.Position := 0;
  -    ObjectsPalette_Scroll.OnChange := ObjectsPalette_Refresh;
  -
  -    ObjectsPalette_Image.OnMouseWheel := ObjectsPalette_Scroll.MouseWheel;
  -    ObjectsPalette_Image.OnClickShift := ObjPalette_ClickShift;
  -    ObjectsPalette_Bevel.OnMouseWheel := ObjectsPalette_Scroll.MouseWheel;
  -    ObjectsPalette_Bevel.OnClickShift := ObjPalette_ClickShift;
  -
  -    SetLength(ObjPaletteTable, fCountCompact);
  +    Bevel_ObjectsPalette := TKMBevel.Create(PopUp_ObjectsPalette, -1000,  -1000, 4000, 4000);
  +    Bevel_ObjectsPalette.BackAlpha := 0.7;
  +    Bevel_ObjectsPalette.EdgeAlpha := 0.9;
  +
  +    Image_ObjectsPalette := TKMImage.Create(PopUp_ObjectsPalette, 0, 0, PopUp_ObjectsPalette.Width, PopUp_ObjectsPalette.Height, 3, rxGuiMain);
  +    Image_ObjectsPalette.ImageStretch;
  +
  +    Scroll_ObjectsPalette := TKMScrollBar.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Width - 20, 25, 20, PopUp_ObjectsPalette.Height - 75, sa_Vertical, bsGame);
  +    Scroll_ObjectsPalette.MinValue := 0;
  +    Scroll_ObjectsPalette.Position := 0;
  +    Scroll_ObjectsPalette.OnChange := ObjectsPalette_Refresh;
  +
  +    Image_ObjectsPalette.OnMouseWheel := Scroll_ObjectsPalette.MouseWheel;
  +    Image_ObjectsPalette.OnClickShift := ObjPalette_ClickShift;
  +    Bevel_ObjectsPalette.OnMouseWheel := Scroll_ObjectsPalette.MouseWheel;
  +    Bevel_ObjectsPalette.OnClickShift := ObjPalette_ClickShift;
  +
  +    SetLength(ObjectsPaletteTable, fCountCompact);
       for I := 0 to fCountCompact - 1 do
       begin
  -      ObjPaletteTable[I] := TKMButtonFlat.Create(PopUp_ObjectsPalette, 0, 0, 64, 84, 1, rxTrees); // Left and Top will update later
  -      ObjPaletteTable[I].Tag := I; //Store ID
  -      ObjPaletteTable[I].Enable;
  -      ObjPaletteTable[I].Hide;
  -      ObjPaletteTable[I].OnMouseWheel := ObjectsPalette_Scroll.MouseWheel;
  -      ObjPaletteTable[I].OnClickShift := ObjPalette_ClickShift;
  +      ObjectsPaletteTable[I] := TKMButtonFlat.Create(PopUp_ObjectsPalette, 0, 0, 64, 84, 1, rxTrees); // Left and Top will update later
  +      ObjectsPaletteTable[I].Tag := I; //Store ID
  +      ObjectsPaletteTable[I].Enable;
  +      ObjectsPaletteTable[I].Hide;
  +      ObjectsPaletteTable[I].OnMouseWheel := Scroll_ObjectsPalette.MouseWheel;
  +      ObjectsPaletteTable[I].OnClickShift := ObjPalette_ClickShift;
       end;
   
  -    ObjectsPalette_Label := TKMLabel.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Center.X, 0, 'Objects palette', fnt_Outline, taCenter); //Todo translate
  -
  -    ClosePalette_Button  := TKMButton.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Center.X - 100, PopUp_ObjectsPalette.Bottom - 50,
  +    Label_ObjectsPalette := TKMLabel.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Center.X, 0, 'Objects palette', fnt_Outline, taCenter); //Todo translate
  +
  +    Button_ClosePalette  := TKMButton.Create(PopUp_ObjectsPalette, PopUp_ObjectsPalette.Center.X - 100, PopUp_ObjectsPalette.Bottom - 50,
                                                200, 30, 'Close palette', bsGame); //Todo translate
  -    ClosePalette_Button.Anchors := [anLeft,anBottom];
  -    ClosePalette_Button.OnClick := ObjectsPaletteClose_Click;
  +    Button_ClosePalette.Anchors := [anLeft,anBottom];
  +    Button_ClosePalette.OnClick := ObjectsPaletteClose_Click;
   
       ObjPalette_UpdateControlsPosition;
   end;
  
positive.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
    ObjectsPalette_Scroll.Visible := RowsCnt*ColsCnt < fCountCompact;
    ColsCnt := Min(OBJECTS_PALETTE_MAX_COLS_CNT, (PopUp_ObjectsPalette.Width - 25*Byte(ObjectsPalette_Scroll.Visible)) div 65); // Recalc ColsCount considering possible scroll width
  
    fObjPaletteTableSize := KMPoint(ColsCnt, RowsCnt);
  
    ObjectsPalette_Image.Width := GetObjPaletteTableWidth + 100;
    ObjectsPalette_Image.Height := GetObjPaletteTableHeight + 150;
    ObjectsPalette_Image.Left := (PopUp_ObjectsPalette.Width - ObjectsPalette_Image.Width) div 2;
    ObjectsPalette_Image.Top := ((PopUp_ObjectsPalette.Height - ObjectsPalette_Image.Height) div 2);
  
    ObjectsPalette_Label.Left := PopUp_ObjectsPalette.Center.X;
    ObjectsPalette_Label.Top := ObjectsPalette_Image.Top + 25;
  
    ClosePalette_Button.Left := PopUp_ObjectsPalette.Center.X - 100;
    ClosePalette_Button.Top := ObjectsPalette_Image.Bottom - 70;
  
    ObjectsPalette_Scroll.Left := ObjectsPalette_Image.Right - 50;
    ObjectsPalette_Scroll.Top := ObjectsPalette_Image.Top + 50;
    ObjectsPalette_Scroll.Height := ObjectsPalette_Image.Height - 150;
  
    ObjectsPalette_Scroll.MaxValue := ((fCountCompact - 1) div ColsCnt) + 1 - RowsCnt;
  
    ObjectsPalette_Refresh(nil);
  end;
  
negative.code:   // Update Objects Palette scroll position
    if not (ObjIndex in [61, 255])
      and not InRange(ObjIndex,
                      Scroll_ObjectsPalette.Position*fObjPaletteTableSize.X,
                      Scroll_ObjectsPalette.Position*fObjPaletteTableSize.X + fObjPaletteTableSize.X*fObjPaletteTableSize.Y - 1) then
      Scroll_ObjectsPalette.Position := ((ObjIndex - 1) div fObjPaletteTableSize.X);
  end;
  
  
  