Hi,
Is it possible to make an event which is fired after a tab is moved?
I only need the info, where to place that. I think I can implement it by myself, if I know where.
kind regards
mcinternet
Posted 05 August 2019 - 06:40 PM
Hi,
Is it possible to make an event which is fired after a tab is moved?
I only need the info, where to place that. I think I can implement it by myself, if I know where.
kind regards
mcinternet
Posted 05 August 2019 - 06:51 PM
Posted 05 August 2019 - 06:55 PM
Hi,
I will try to add it. It should be easy.
Can you pls. post it here? - I need it really urgent.
thx in adv
kind regards
Jörg alias mcinternet
Posted 06 August 2019 - 04:17 PM
Hi,
You can add it to
procedure TNxPageControl6.SetMoving(const Value: Boolean); begin if Value <> FMoving then begin FMoving := Value; if FMoving then Screen.Cursor := crDrag else Screen.Cursor := crDefault; DoAfterTabMode; // <--- call to the event end; end;
Posted 06 August 2019 - 04:36 PM
It's actually not a good place. It should be inside MouseMove method of PageControl.
There is a line:
ActivePage.Index := NearestTab.Index;
Posted 06 August 2019 - 04:52 PM
Hi Boki,
I did it here, that´s not good!
procedure TNxPageControl6.MouseMove(Shift: TShiftState; X, Y: Integer); var NearestTab: TNxPageSheet6; begin inherited; { Ignore while in design state } if not (csDesigning in ComponentState) then begin { Tab Moving code } if Assigned(PressedPageTab) and TabMoving then begin { Already Moving } if FMoving then begin NearestTab := GetTabAtPos(Point(X, Y)); if NearestTab <> nil then begin // WritelnDebug(IntToStr(NearestTab.Index)); ActivePage.Index := NearestTab.Index; DoAfterTabMode; // Hier eingefügt JB end; Exit; end;
Always, if you move the mouse (pressed), the event pops up
regards
Jörg alias mcinternet
Posted 06 August 2019 - 04:58 PM
Posted 06 August 2019 - 05:08 PM
I just made tests with new and old index - no successfull results. The event must be fired AFTER moving, when the mousebutton goes up.
Regards
Jörg alias mcinternet
Posted 06 August 2019 - 05:41 PM
That seems not to be the right place ?
Regards
Jörg alias mcinternet
Posted 06 August 2019 - 05:56 PM
Got it!!!
under private:
procedure TNxPageControl6.MouseMove(Shift: TShiftState; X, Y: Integer); var NearestTab: TNxPageSheet6; begin inherited; { Ignore while in design state } if not (csDesigning in ComponentState) then begin { Tab Moving code } if Assigned(PressedPageTab) and TabMoving then begin { Already Moving } if FMoving then begin NearestTab := GetTabAtPos(Point(X, Y)); if NearestTab <> nil then begin // WritelnDebug(IntToStr(NearestTab.Index)); FNewInt := NearestTab.Index; ActivePage.Index := NearestTab.Index; end; Exit; end;
and:
procedure TNxPageControl6.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; { Change cursor back } Moving := False; if FOldInt <> FNewInt then DoAfterTabMode; FOldInt := 0; FNewInt := 0;
For completing this Code (public)
Posted 06 August 2019 - 06:23 PM
Hi Jörg,
Problem is that tab is moved even after you don't raise mouse button. Only dragging is stopped after you mouse up.
I can have for example 2 events, one when tab is moved and one when moving is done.
This will be more correct approach.
Posted 06 August 2019 - 06:25 PM
oh, then do so
many thx
Kind Regards
Jörg
0 members, 0 guests, 0 anonymous users