View Issue Details

IDProjectCategoryView StatusLast Update
0018317LazarusWidgetsetpublic2011-01-24 10:26
ReportercobinesAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindows XPOS VersionSP3
Product Version0.9.31 (SVN)Product Build28822 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0018317: Pages bounds not adjusted in TCustomNotebook when switching Multiline or ShowTabs
DescriptionWhen switching Multiline and/or ShowTabs after adding some tabs the pages (or maybe just the page that was active during the switch) don't have their bounds recalculated to the possibly new size of the client area, which results in page being drawn over the header.

I think there should be additional calls to TWin32WSCustomNotebook.AdjustSizeNotebookPages added when adding and removing pages and when updating properties.

Attached proposed solution.
Steps To ReproduceRun attached example, you should see drawing artifacts like on pictures attached.
TagsNo tags attached.
Fixed in Revision28861
LazTarget0.99.0
WidgetsetWin32/Win64
Attached Files
  • multiline_notebook.zip (2,283 bytes)
  • artifacts.png (9,445 bytes)
    artifacts.png (9,445 bytes)
  • win32multiline_artifacts.diff (1,288 bytes)
    Index: lcl/interfaces/win32/win32wsextctrls.pp
    ===================================================================
    --- lcl/interfaces/win32/win32wsextctrls.pp	(revision 28822)
    +++ lcl/interfaces/win32/win32wsextctrls.pp	(working copy)
    @@ -474,7 +474,8 @@
         // clientrect possible changed, adding first tab, or deleting last
         // windows should send a WM_SIZE message because of this, but it doesn't
         // send it ourselves
    -    LCLControlSizeNeedsUpdate(ANotebook, True);
    +    if LCLControlSizeNeedsUpdate(ANotebook, True) then
    +      AdjustSizeNotebookPages(ANotebook);
       end;
     end;
     
    @@ -489,6 +490,8 @@
       const AIndex: integer);
     begin
       Windows.SendMessage(ANotebook.Handle, TCM_DELETEITEM, Windows.WPARAM(AIndex), 0);
    +  if LCLControlSizeNeedsUpdate(ANotebook, True) then
    +    AdjustSizeNotebookPages(ANotebook);
     end;
     
     { -----------------------------------------------------------------------------
    @@ -726,7 +729,8 @@
       begin
         SetWindowLong(ANotebook.Handle, GWL_STYLE, NewStyle);
         SetWindowPos(ANoteBook.Handle, 0, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_DRAWFRAME);
    -    LCLControlSizeNeedsUpdate(ANotebook, True);
    +    if LCLControlSizeNeedsUpdate(ANotebook, True) then
    +      AdjustSizeNotebookPages(ANotebook);
       end;
     end;
     
    

Activities

2010-12-26 00:58

 

multiline_notebook.zip (2,283 bytes)

2010-12-26 01:01

 

artifacts.png (9,445 bytes)
artifacts.png (9,445 bytes)

2010-12-26 01:02

 

win32multiline_artifacts.diff (1,288 bytes)
Index: lcl/interfaces/win32/win32wsextctrls.pp
===================================================================
--- lcl/interfaces/win32/win32wsextctrls.pp	(revision 28822)
+++ lcl/interfaces/win32/win32wsextctrls.pp	(working copy)
@@ -474,7 +474,8 @@
     // clientrect possible changed, adding first tab, or deleting last
     // windows should send a WM_SIZE message because of this, but it doesn't
     // send it ourselves
-    LCLControlSizeNeedsUpdate(ANotebook, True);
+    if LCLControlSizeNeedsUpdate(ANotebook, True) then
+      AdjustSizeNotebookPages(ANotebook);
   end;
 end;
 
@@ -489,6 +490,8 @@
   const AIndex: integer);
 begin
   Windows.SendMessage(ANotebook.Handle, TCM_DELETEITEM, Windows.WPARAM(AIndex), 0);
+  if LCLControlSizeNeedsUpdate(ANotebook, True) then
+    AdjustSizeNotebookPages(ANotebook);
 end;
 
 { -----------------------------------------------------------------------------
@@ -726,7 +729,8 @@
   begin
     SetWindowLong(ANotebook.Handle, GWL_STYLE, NewStyle);
     SetWindowPos(ANoteBook.Handle, 0, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_DRAWFRAME);
-    LCLControlSizeNeedsUpdate(ANotebook, True);
+    if LCLControlSizeNeedsUpdate(ANotebook, True) then
+      AdjustSizeNotebookPages(ANotebook);
   end;
 end;
 

Paul Ishenin

2011-01-04 10:25

manager   ~0044857

Thanks, applied. Hope there will be no regressions. Please close if ok.

cobines

2011-01-05 04:38

reporter   ~0044890

Thanks. I hope so too :-)

Issue History

Date Modified Username Field Change
2010-12-26 00:58 cobines New Issue
2010-12-26 00:58 cobines File Added: multiline_notebook.zip
2010-12-26 00:58 cobines Widgetset => Win32/Win64
2010-12-26 01:01 cobines File Added: artifacts.png
2010-12-26 01:02 cobines File Added: win32multiline_artifacts.diff
2010-12-26 10:46 Vincent Snijders LazTarget => 0.99.0
2010-12-26 10:46 Vincent Snijders Assigned To => Paul Ishenin
2010-12-26 10:46 Vincent Snijders Status new => assigned
2010-12-26 10:46 Vincent Snijders Target Version => 0.99.0
2011-01-04 10:25 Paul Ishenin Fixed in Revision => 28861
2011-01-04 10:25 Paul Ishenin Status assigned => resolved
2011-01-04 10:25 Paul Ishenin Fixed in Version => 0.9.31 (SVN)
2011-01-04 10:25 Paul Ishenin Resolution open => fixed
2011-01-04 10:25 Paul Ishenin Note Added: 0044857
2011-01-05 04:38 cobines Status resolved => closed
2011-01-05 04:38 cobines Note Added: 0044890
2011-01-24 10:26 Vincent Snijders Fixed in Version 0.9.31 (SVN) => 0.9.29 (SVN)