Jump to content


mcinternet

Member Since 31 May 2005
Offline Last Active Aug 13 2019 06:10 PM
-----

Posts I've Made

In Topic: Event OnAfterMoveTab

06 August 2019 - 06:25 PM

oh, then do so  :)

 

many thx

 

Kind Regards

 

Jörg


In Topic: Event OnAfterMoveTab

06 August 2019 - 05:56 PM

Got it!!!

 

under private:

 

    FAfterTabMoving : TNotifyEvent;
    FOldInt : Integer;
    FNewInt : Integer;
 
Published:
 
property OnAfterTabMoving : TNotifyEvent read FAfterTabMoving write FAfterTabMoving;
 
 
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)

 

procedure TNxPageControl6.DoAfterTabMode;
begin
  if Assigned(FAfterTabMoving) then FAfterTabMoving(self);
end;
 
 
Kind regards
 
Jörg alias mcinternet
 
 
@Boki: pls. implement this property so as it is in the next release  :rolleyes:

In Topic: Event OnAfterMoveTab

06 August 2019 - 05:41 PM

That seems not to be the right place ?

 

Regards

 

Jörg alias mcinternet


In Topic: Event OnAfterMoveTab

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


In Topic: Event OnAfterMoveTab

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