View Issue Details

IDProjectCategoryView StatusLast Update
0036282LazarusLCLpublic2019-11-13 13:37
ReportererrnoAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSwindowsOS Version10 1903
Product Version2.1 (SVN)Product Build62218 
Target VersionFixed in Version 
Summary0036282: TPageControl can throw an exception when a tab is disabled .
DescriptionThe lcl component TPageControl can throw an exception when a tabsheet is disabled .
This happens when the component has a focused control and then you select a disabled tabsheet .
Steps To ReproduceOpen and run provided project "PageControl focus.zip"
-select Tabsheet3
-click on Button31
-select TabSheet1


Additional InformationPatch added .
TagsNo tags attached.
Fixed in Revisionr62235
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • PageControl focus.zip (130,372 bytes)
  • pagectrl.patch (638 bytes)
    Index: include/customnotebook.inc
    ===================================================================
    --- include/customnotebook.inc	(r�vision 62218)
    +++ include/customnotebook.inc	(copie de travail)
    @@ -1135,7 +1135,7 @@
       if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
          (FPageIndexOnLastChange <> FPageIndex) then
       begin
    -    if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
    +    if Assigned(CurPage) and CurPage.enabled and HasFocusedControl(Page[FPageIndexOnLastChange]) then
           CurPage.SetFocus;
         Page[FPageIndexOnLastChange].Visible := False;
       end;
    
    pagectrl.patch (638 bytes)
  • pagectrl2.patch (650 bytes)
    Index: lcl/include/customnotebook.inc
    ===================================================================
    --- lcl/include/customnotebook.inc	(r�vision 62218)
    +++ lcl/include/customnotebook.inc	(copie de travail)
    @@ -1135,7 +1135,7 @@
       if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
          (FPageIndexOnLastChange <> FPageIndex) then
       begin
    -    if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
    +    if Assigned(CurPage) and CurPage.enabled and HasFocusedControl(Page[FPageIndexOnLastChange]) then
           CurPage.SetFocus;
         Page[FPageIndexOnLastChange].Visible := False;
       end;
    
    pagectrl2.patch (650 bytes)

Activities

errno

2019-11-08 15:04

reporter  

PageControl focus.zip (130,372 bytes)
pagectrl.patch (638 bytes)
Index: include/customnotebook.inc
===================================================================
--- include/customnotebook.inc	(r�vision 62218)
+++ include/customnotebook.inc	(copie de travail)
@@ -1135,7 +1135,7 @@
   if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
      (FPageIndexOnLastChange <> FPageIndex) then
   begin
-    if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
+    if Assigned(CurPage) and CurPage.enabled and HasFocusedControl(Page[FPageIndexOnLastChange]) then
       CurPage.SetFocus;
     Page[FPageIndexOnLastChange].Visible := False;
   end;
pagectrl.patch (638 bytes)

errno

2019-11-08 15:14

reporter   ~0119160

Last edited: 2019-11-08 15:14

View 2 revisions

New patch added pagectrl2.patch , fixes base path of the patch .



pagectrl2.patch (650 bytes)
Index: lcl/include/customnotebook.inc
===================================================================
--- lcl/include/customnotebook.inc	(r�vision 62218)
+++ lcl/include/customnotebook.inc	(copie de travail)
@@ -1135,7 +1135,7 @@
   if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
      (FPageIndexOnLastChange <> FPageIndex) then
   begin
-    if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
+    if Assigned(CurPage) and CurPage.enabled and HasFocusedControl(Page[FPageIndexOnLastChange]) then
       CurPage.SetFocus;
     Page[FPageIndexOnLastChange].Visible := False;
   end;
pagectrl2.patch (650 bytes)

Zeljan Rikalo

2019-11-08 17:15

developer   ~0119162

pagectrl2.patch looks good.

Juha Manninen

2019-11-12 23:55

developer   ~0119247

Applied, thanks.

errno

2019-11-13 13:37

reporter   ~0119269

thanks

Issue History

Date Modified Username Field Change
2019-11-08 15:04 errno New Issue
2019-11-08 15:04 errno File Added: PageControl focus.zip
2019-11-08 15:04 errno File Added: pagectrl.patch
2019-11-08 15:14 errno File Added: pagectrl2.patch
2019-11-08 15:14 errno Note Added: 0119160
2019-11-08 15:14 errno Note Edited: 0119160 View Revisions
2019-11-08 17:15 Zeljan Rikalo Note Added: 0119162
2019-11-12 23:48 Juha Manninen Assigned To => Juha Manninen
2019-11-12 23:48 Juha Manninen Status new => assigned
2019-11-12 23:55 Juha Manninen Status assigned => resolved
2019-11-12 23:55 Juha Manninen Resolution open => fixed
2019-11-12 23:55 Juha Manninen Fixed in Revision => r62235
2019-11-12 23:55 Juha Manninen LazTarget => -
2019-11-12 23:55 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2019-11-12 23:55 Juha Manninen Note Added: 0119247
2019-11-13 13:37 errno Status resolved => closed
2019-11-13 13:37 errno Note Added: 0119269