View Issue Details

IDProjectCategoryView StatusLast Update
0036412LazarusWidgetsetpublic2020-02-13 10:46
ReporterBrunoK Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Platform32 / 64 bitOSwindows 
Product Version2.0.7 (SVN) 
Summary0036412: TWin32WSCustomTabControl.GetTabRect doesn't return correct rectangle
DescriptionGetTabRect transforms the rectangle returned by call to windows TCM_GETITEMRECT to a useless rectangle.

Additional InformationProbably also wrong in lcl\interfaces\wince\wincepagecontrol.inc
TagsNo tags attached.
Fixed in Revisionr62366
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0036384 closedJuha Manninen Add buttons in find in files results to clean tabs. 

Activities

BrunoK

2019-12-09 12:31

reporter  

win32pagecontrol.inc.patch (827 bytes)   
Index: lcl/interfaces/win32/win32pagecontrol.inc
===================================================================
--- lcl/interfaces/win32/win32pagecontrol.inc	(revision 62137)
+++ lcl/interfaces/win32/win32pagecontrol.inc	(working copy)
@@ -621,15 +621,8 @@
     exit;
   end;
 
-  GetLCLClientBoundsOffset(ATabControl, ORect);
-  if Windows.SendMessage(ATabControl.Handle, TCM_GETITEMRECT, WPARAM(AIndex), LPARAM(@Result)) <> 0
-  then begin
-    Result.Top := Result.Top - Orect.Top;
-    Result.Bottom := Result.Bottom - Orect.Top;
-    Result.Left := Result.Left - Orect.Left;
-    Result.Right := Result.Right - Orect.Left;
-  end
-  else
+  if Windows.SendMessage(ATabControl.Handle, TCM_GETITEMRECT, WPARAM(AIndex), LPARAM(@Result)) = 0
+  then
     Result := inherited GetTabRect(ATabControl, AIndex);
 end;
 
win32pagecontrol.inc.patch (827 bytes)   

Juha Manninen

2019-12-09 20:39

developer   ~0119714

Applied, thanks.

Martin Friebe

2020-02-12 09:15

manager   ~0121036

Breaks ExtendedNotebook (drag and drop indicator for SourceEditor tabs reordering by drag/drop)
Breaks https://forum.lazarus.freepascal.org/index.php?topic=48462

Not verified, but from current implementation of ExtendedNotebook, other WS also return the old value. I.e., it might be that this patch breaks inter-widgetset-compatibility.

Martin Friebe

2020-02-12 09:25

manager   ~0121037

What-Delphi-Does: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/ComCtrls_TCustomTabControl_TabRect.html
>> TabRect returns the bounding rectangle (in client coordinates) of the specified tab

The ClientOrigin (x/y=0/0) of a tab-control afaik (need verification, if it should be) is the top/left corner of the "Page" (which is *below* the tab bar).

The old code (before patch) returned TabRect like
Result = TRECT (LEFT = 53; TOP = -22; RIGHT = 110; BOTTOM = -2;

That (negative TOP) would be correct, if the ClientOrigin is indeed the top of the embedded page (and not the top of the overall control)

ClientRect is not the same as the Controls overall Rect.

BrunoK

2020-02-12 13:22

reporter   ~0121046

Last edited: 2020-02-12 13:24

View 2 revisions

Acknowledged, narrow sighted view in respect to 0036384 proposal.

Please revert. [Edit : Please revert r62365]

BrunoK

2020-02-12 15:09

reporter   ~0121049

I just tested this issue.

Please someone do a revert in trunk for unit :

/trunk/lcl/interfaces/win32/win32pagecontrol.inc
to Revision: 62201

Pascal Riekenberg

2020-02-12 20:02

developer   ~0121054

Confirmed. Reverting /trunk/lcl/interfaces/win32/win32pagecontrol.inc to r62201 restores old behaviour.

Juha Manninen

2020-02-12 21:02

developer   ~0121057

Last edited: 2020-02-12 21:21

View 4 revisions

> Please revert. [Edit : Please revert r62365]
That makes no sense. The commit msg for r62365 is:
  "Revert the debug code for issue 0036384."
It only removes the debug code I accidentally left there earlier.
... Ok, oops, I see I had marked a wrong number in the "Fixed in Revision" field of this issue. It should be r62366. (Changed it now.) I guess you want it reverted.

> Please someone do a revert in trunk for unit :
> /trunk/lcl/interfaces/win32/win32pagecontrol.inc
> to Revision: 62201
What means "do a revert in trunk ... to Revision: 62201"?
Revert r62201 or all changes after it?
Reverting everything AFTER r62201 indeed means just r62366. There were no other changes in win32pagecontrol.inc.

Martin Friebe

2020-02-12 21:10

manager   ~0121058

I reverted the contents of r62366
That is the reversion of the patch attached here.


Juha Manninen

2020-02-12 21:29

developer   ~0121059

Thanks Martin. I was just planning to do that.

Now traveling with a mini-laptop and had to update the development environment.
I won't do any serious debugging with this one.

BrunoK

2020-02-13 10:46

reporter   ~0121080

Reverted /trunk/lcl/interfaces/win32/win32pagecontrol.inc to r62201

Issue History

Date Modified Username Field Change
2019-12-09 12:31 BrunoK New Issue
2019-12-09 12:31 BrunoK File Added: win32pagecontrol.inc.patch
2019-12-09 17:38 Juha Manninen Relationship added related to 0036384
2019-12-09 20:38 Juha Manninen Assigned To => Juha Manninen
2019-12-09 20:38 Juha Manninen Status new => assigned
2019-12-09 20:39 Juha Manninen Status assigned => resolved
2019-12-09 20:39 Juha Manninen Resolution open => fixed
2019-12-09 20:39 Juha Manninen Fixed in Revision => r62365
2019-12-09 20:39 Juha Manninen LazTarget => -
2019-12-09 20:39 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2019-12-09 20:39 Juha Manninen Note Added: 0119714
2020-02-12 09:15 Martin Friebe Status resolved => assigned
2020-02-12 09:15 Martin Friebe Resolution fixed => reopened
2020-02-12 09:15 Martin Friebe Note Added: 0121036
2020-02-12 09:25 Martin Friebe Note Added: 0121037
2020-02-12 13:22 BrunoK Note Added: 0121046
2020-02-12 13:24 BrunoK Note Edited: 0121046 View Revisions
2020-02-12 15:09 BrunoK Note Added: 0121049
2020-02-12 20:02 Pascal Riekenberg Note Added: 0121054
2020-02-12 21:02 Juha Manninen Note Added: 0121057
2020-02-12 21:08 Juha Manninen Note Edited: 0121057 View Revisions
2020-02-12 21:09 Juha Manninen Fixed in Revision r62365 => r62366
2020-02-12 21:09 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-02-12 21:10 Martin Friebe Status assigned => resolved
2020-02-12 21:10 Martin Friebe Resolution reopened => won't fix
2020-02-12 21:10 Martin Friebe Widgetset Win32/Win64 => Win32/Win64
2020-02-12 21:10 Martin Friebe Note Added: 0121058
2020-02-12 21:11 Juha Manninen Note Edited: 0121057 View Revisions
2020-02-12 21:21 Juha Manninen Note Edited: 0121057 View Revisions
2020-02-12 21:29 Juha Manninen Note Added: 0121059
2020-02-13 10:46 BrunoK Status resolved => closed
2020-02-13 10:46 BrunoK Note Added: 0121080