Alexey-T / ATFlatControls

Controls for Delphi/Lazarus, used in CudaText: ATTabs, ATButton, ATListbox, ATScrollbar, ATStatusbar, ATGroups, ATGauge
Other
101 stars 29 forks source link

TATTabs: Missing Event while reordering Tabs #81

Closed SilentDude80 closed 2 years ago

SilentDude80 commented 2 years ago

Hi,

I am looking for an event, that is fired while the user is moving a tab to another position - basically it should fire every time when that little red indicator line changes to another tab position:

image

All events I could find so far are fired only after the user releases the left mouse button.

Alexey-T commented 2 years ago

Added OnTabDragging, pls test it.

SilentDude80 commented 2 years ago

Wow, thank you for that fast reply and enhancement. It basically works, but I noticed two things:

property Tag:integer read FTag write FTag;

to the public section of TATTabData class to be able to store a reference to e.g. an array index or database index. Could you also include that into your official code or do you know a more easy way that such code modifications are not lost ?

Alexey-T commented 2 years ago

Made the changes-- pls check is it ok? Added Tag too.

SilentDude80 commented 2 years ago

Works perfectly now ! Thanks a lot !

SilentDude80 commented 2 years ago

Hi Alexey - i came across a problem:

The event does not fire, when the tab insertion indicator moves again to it's original position/index - i would need the event there too...

Thank you !

Alexey-T commented 2 years ago

I added indicator of OnTabDragging to the app/demo_tabs program. it shows line like 'OnTagDragging: 2 -> 3' on the bottom of the form. I cannot see your issue - I see indicator always. even when I return to original drop-index.

ie I see

SilentDude80 commented 2 years ago

Sorry, was a problem in my own code - event is working fine like you said.