Drag and Drop to Rearrange Items in TsFrameBar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34952
    Eric24
    Participant

    Do you have any tips on adding drag-and-drop to rearrange items in a TsFrameBar? Maybe it's something that TsFrameBar should do on its own at some point in the future, but for now, I need to implement this myself.

    #47396
    Support
    Keymaster

    Hello

    Maybe this code can help you ?

    Code:
    type
    TAccessCollection = class(TPersistent)
    public
    FItemClass: TCollectionItemClass;
    FItems: TList;
    end;

    procedure ExchangeItems(FrameBar : TsFrameBar; Index1, Index2 : integer);
    var
    TmpItem : TsTitleItem;
    List : TList;
    TmpPointer : Pointer;
    begin
    List := TAccessCollection(FrameBar.Items).FItems;
    TmpPointer := List[Index1];
    List[Index1] := List[Index2];
    List[Index2] := TmpPointer;
    FrameBar.ArrangeTitles;
    end;

    procedure TForm1.sSpeedButton1Click(Sender: TObject);
    begin
    ExchangeItems(sFrameBar1, 0, 1);
    end;

    #47488
    Eric24
    Participant

    Thanks. That helps.

    –Eric

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