View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038403 | Lazarus | LCL | public | 2021-01-26 18:21 | 2021-02-28 08:33 |
Reporter | CudaText man_ | Assigned To | Martin Friebe | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Win10 x64 | ||||
Product Version | 2.1 (SVN) | ||||
Target Version | 2.2 | Fixed in Version | 2.2 | ||
Summary | 0038403: TTabControl.IndexOfTabAt is always -1, with a hack p.y:=-5 it works | ||||
Description | demo attached. it shows PageControl - for it, mouse move shows OK tab index in caption. if shows TabControl - for it, mouse move shows always -1 index in caption. if you make hack from https://bugs.freepascal.org/view.php?id=27467 and set p.y:= -5 before the n:=TabControl1.IndexOfTabAt(p); then it will work. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 64424,64436,64677 | ||||
LazTarget | 2.2 | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
related to | 0027467 | resolved | Michl | Lazarus | TTabControl.IndexOfTabAt() always returns -1 |
parent of | 0038409 | closed | Martin Friebe | Packages | Error when building LCLBase |
parent of | 0038422 | closed | Martin Friebe | Lazarus | TTabControl fix in r64424 broke the CudaText |
|
|
|
P have to be control-relative or screen-relative? |
|
And does that hack also work if TabPosition <> tpTop? And (again), please attach a proper patch instead of the "instructions" you gave. |
|
P.Y:=-5 will NOT work for multiline tabs (wrapped tabs). |
|
First of all it needs to be checked that windows handles the client-rect for the tabcontrol the same way as for the pagecontrol. If so, the correct code can be found here B:\lazarus_latest_svn_2\lcl\interfaces\win32\win32pagecontrol.inc line 398..407 if not (AWinControl is TTabControl) then begin ... Params.WindowInfo^.ClientOffsetProc := @TabControlClientOffset; TabControlClientOffset gets the offset between the outer and inner bounds rect. For some reason it was decided that this code does NOT apply to TTabControl. However it is well possible that the line in question was accidentally put into the if block. (may be worth checking svn history) |
|
Please test and close if ok. |
|
Btw, I do not know what Delphi does. It is also possible to have an Origin of zero, and apply the diff only when performing actions on the child-tab-control (such as getting the tab index). |
|
Moving the origin has side-effect (user placed child controls of the TTabControl). This breaks backward compatibility (as all those children would move by the new offset) Reverted, and apply the offset only when querying the tab-index. |
|
Hi, before this patch, TTabControl.IndexOfTabAt() works if you pass the X/Y params of the MouseMove event (which has a negative Y, similar to TPageControl). Now, it always returns -1. The problem might be in TTabControl.ScreenToClient(Mouse.CursorPos), which returns a positive Y. Inside the MouseMove event, the params X/Y should be similar to the point returned by TTabControl.ScreenToClient(Mouse.CursorPos). |
|
Let's reopen the issue then? |
|
Seems to cause a regression? |
|
Interesting, the message.x/y start at -20 (depends) go to 0, then jump to +20 .... If the tabs are at the bottom, then Y starts at 0 again. Making the y range from 0..20 ambiguous, is it occurs in the client above, and on the tabs. (That is if you make the height of the TTabControl big enough to have free space above the tabs) Similar for X with tabs on the right. |
|
@Joeny Ang I plan to adjust the values in the mouse coordinates, so they can be used again (directly passed through). This should then also fix that there currently are two points 0,0 in the TTabControl. (tabs at bottom) |
|
Fixed Mouse-event x/y in rev 64677 They now report relative to the TabControl. They will no longer be negative. Fore more details see: https://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes#ShortcutToText_.2F_TextToShortcut |
|
good work, thanks! |
|
Great! Works now. Thanks! |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-26 18:21 | CudaText man_ | New Issue | |
2021-01-26 18:21 | CudaText man_ | File Added: tst-tabcontrol-tabindex.zip | |
2021-01-26 18:40 | Juha Manninen | Relationship added | related to 0027467 |
2021-01-26 20:27 | Anton Kavalenka | Note Added: 0128604 | |
2021-01-27 11:07 | Bart Broersma | Note Added: 0128612 | |
2021-01-27 11:07 | Bart Broersma | Status | new => feedback |
2021-01-27 11:07 | Bart Broersma | LazTarget | => - |
2021-01-27 12:55 | Martin Friebe | Note Added: 0128616 | |
2021-01-27 13:14 | Martin Friebe | Note Added: 0128617 | |
2021-01-27 14:03 | Martin Friebe | Assigned To | => Martin Friebe |
2021-01-27 14:03 | Martin Friebe | Status | feedback => resolved |
2021-01-27 14:03 | Martin Friebe | Resolution | open => fixed |
2021-01-27 14:03 | Martin Friebe | Fixed in Version | => 2.2 |
2021-01-27 14:03 | Martin Friebe | Fixed in Revision | => 64424 |
2021-01-27 14:03 | Martin Friebe | LazTarget | - => 2.2 |
2021-01-27 14:03 | Martin Friebe | Widgetset | Win32/Win64 => Win32/Win64 |
2021-01-27 14:03 | Martin Friebe | Note Added: 0128620 | |
2021-01-27 14:05 | Martin Friebe | Note Added: 0128621 | |
2021-01-27 17:09 | Martin Friebe | Relationship added | parent of 0038409 |
2021-01-29 19:21 | Martin Friebe | Relationship added | parent of 0038422 |
2021-01-29 19:56 | Martin Friebe | Fixed in Revision | 64424 => 64424,64436 |
2021-01-29 19:56 | Martin Friebe | Widgetset | Win32/Win64 => Win32/Win64 |
2021-01-29 19:56 | Martin Friebe | Note Added: 0128658 | |
2021-02-24 07:59 | Joeny Ang | Note Added: 0129133 | |
2021-02-24 08:45 | CudaText man | Note Added: 0129135 | |
2021-02-24 09:45 | Bart Broersma | Status | resolved => assigned |
2021-02-24 09:45 | Bart Broersma | Resolution | fixed => open |
2021-02-24 09:45 | Bart Broersma | Note Added: 0129137 | |
2021-02-26 15:55 | Martin Friebe | Target Version | => 2.2 |
2021-02-26 15:55 | Martin Friebe | Widgetset | Win32/Win64 => Win32/Win64 |
2021-02-27 03:26 | Martin Friebe | Note Added: 0129190 | |
2021-02-27 03:41 | Martin Friebe | Note Edited: 0129190 | View Revisions |
2021-02-27 03:49 | Martin Friebe | Note Added: 0129191 | |
2021-02-27 17:08 | Martin Friebe | Status | assigned => resolved |
2021-02-27 17:08 | Martin Friebe | Resolution | open => fixed |
2021-02-27 17:08 | Martin Friebe | Fixed in Revision | 64424,64436 => 64424,64436,64677 |
2021-02-27 17:08 | Martin Friebe | Widgetset | Win32/Win64 => Win32/Win64 |
2021-02-27 17:08 | Martin Friebe | Note Added: 0129208 | |
2021-02-27 21:01 | CudaText man | Note Added: 0129211 | |
2021-02-28 08:33 | Joeny Ang | Note Added: 0129221 |