Bug in TsColorBox Selected

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37681
    Lasse
    Participant

    If you set twice selected

    ColorBox.Selected := clNone; <= works correctly, None is selected ColorBox.Selected := clNone; <= bug: "Custom..." is selected This happens because the first time color object will be set here:

    Code:
    procedure TsCustomColorBox.SetSelected(const AColor: TColor);
    var
    I, J: Integer;
    begin
    if HandleAllocated then begin
    I := Items.IndexOfObject(TObject(AColor));
    if AColor <> 0 then begin
    if ((cbCustomColor in Style) or (PopupMode = pmPickColor)) and ((AColor <> NoColorSelected) or UseAlpha) then
    TComboBoxExStrings(Items).ItemsEx[0].Data := TObject(AColor);


    const
    NoColorSelected = TColor($FF000000);

    I changed the NoColorSelected const to clNone to fix this for now.

    #57374
    Support
    Keymaster

    Thank you for the message, it will be changed soon.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.