Recent

Author Topic: Scrolling Arrows for TTabControl does not trigger any events?  (Read 2373 times)

jamie

  • Hero Member
  • *****
  • Posts: 6090
IF a TtabControl is anchored with the parent form and you resize the parent downwards so that the left/right scrolling arrows
appear, they do scroll through the tabs but there Is no event being triggered that allows code to act on this?

 The OnChanging and OnChange do not get called during this scrolling of the TABS but if you click on the TAB once scrolled
in view then they get called?

 Simply put it looks like the scrolling Arrows do nothing but scroll the TABS with no notification triggers?

 is this normal?

The only true wisdom is knowing you know nothing

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Scrolling Arrows for TTabControl does not trigger any events?
« Reply #1 on: April 09, 2018, 08:34:53 am »
corect there is not need for notification the tabs are either visible and accesible or invinsible and inaccessible from the scroll arrows.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Scrolling Arrows for TTabControl does not trigger any events?
« Reply #2 on: April 09, 2018, 11:34:57 pm »
one or two  tabs are visible when the arrows appear, and I can scroll any one of them into view, but the problem is the user needs that extra step to click on the tab.

  as it is now, you can change the tab position via software and it does not call the OnChange event but it does call the
OnChanging event.

 I would of expected to have the same hold true using the arrows, just call the onchanging event, from that point one
can make a choice..

 Oh well, Maybe I'll subclass it...

Thanks

The only true wisdom is knowing you know nothing

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Scrolling Arrows for TTabControl does not trigger any events?
« Reply #3 on: April 11, 2018, 05:57:39 am »
Extend the tab with support for the scrolling wheel and the "extra click need" disappears.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Scrolling Arrows for TTabControl does not trigger any events?
« Reply #4 on: April 11, 2018, 11:00:49 pm »
Yes, I've already had it that way for some time now.. MouseWheel scroll will switch tabs and it actually selects them. :)

I have two tabs to switch so all I do is this in the MouseWheel event :
 TabIndex := (TabIndex+1) and 1;
If Assigned(OnChange) then OnChange(Sender); //had to add this line for 1.8.2 laz..


  What I did notice when I recompile this particular app which was compiled last time with 1.6.2 and now with 1.8.2, The TABS would call the OnChange event if you changed the index via software..

 Recompiling the app with 1.8.2 now shows that the TABS only change but they do not call the Onchange via code, but I
kind of like it that way because since I do this from software I can simply directly call the OnChange event after I set the
Tab Index.. The user interaction still does call the OnChange event so all is well there.

 P.S.
   I just looked at an old windows Help file and I see no messages that notify the app when the arrows are showing so I
guess it must be a windows control limitation. I'll look at some newer docs later..
Thanks for responding..

« Last Edit: April 11, 2018, 11:16:15 pm by jamie »
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018