View Issue Details

IDProjectCategoryView StatusLast Update
0018182LazarusIDEpublic2011-01-20 10:16
ReporterTomasz WieckowskiAssigned ToPaul Ishenin 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0018182: Object Inspector - ComponentTree height
Description1. Height of "component tree" in object inspector is not saved when you close the IDE.
2. There is unnecessary issue with reset height of "component tree" on resize object inspector. When you set you own height for "component tree" and then you resize a object inspector then height will be one fourth of oi height.

Attached is a proposed patch (fix for saving height and remove reset height on resize).
TagsNo tags attached.
Fixed in Revision29134
LazTarget0.99.0
WidgetsetWin32/Win64
Attached Files
  • oi_resize2.patch (2,062 bytes)
    Index: ideintf/objectinspector.lfm
    ===================================================================
    --- ideintf/objectinspector.lfm	(revision 28673)
    +++ ideintf/objectinspector.lfm	(working copy)
    @@ -8,7 +8,6 @@
       ClientHeight = 669
       ClientWidth = 275
       KeyPreview = True
    -  OnResize = ObjectInspectorResize
       LCLVersion = '0.9.29'
       object StatusBar: TStatusBar
         Left = 0
    Index: ideintf/objectinspector.pp
    ===================================================================
    --- ideintf/objectinspector.pp	(revision 28673)
    +++ ideintf/objectinspector.pp	(working copy)
    @@ -612,7 +612,6 @@
         procedure ComponentTreeKeyDown(Sender: TObject; var Key: Word;
           Shift: TShiftState);
         procedure ComponentTreeSelectionChanged(Sender: TObject);
    -    procedure ObjectInspectorResize(Sender: TObject);
         procedure OnGridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
         procedure OnGridKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
         procedure OnGridDblClick(Sender: TObject);
    @@ -3759,7 +3758,7 @@
       AnObjInspector.DefaultItemHeight := FDefaultItemHeight;
       AnObjInspector.ShowComponentTree := FShowComponentTree;
       AnObjInspector.ShowInfoBox := FShowInfoBox;
    -  AnObjInspector.ComponentTreeHeight := FComponentTreeHeight;
    +  AnObjInspector.ComponentTree.Height := FComponentTreeHeight;
       AnObjInspector.AutoShow := AutoShow;
       AnObjInspector.ShowStatusBar := ShowStatusBar;
     end;
    @@ -4217,6 +4216,7 @@
     begin
       ComponentTree.Selection := FSelection;
       ComponentTree.MakeSelectionVisible;
    +  FComponentTreeHeight := ComponentTree.Height;
     end;
     
     procedure TObjectInspectorDlg.SaveChanges;
    @@ -4345,13 +4345,6 @@
         FOnSelectPersistentsInOI(Self);
     end;
     
    -procedure TObjectInspectorDlg.ObjectInspectorResize(Sender: TObject);
    -begin
    -  if (ComponentTree<>nil) and (ComponentTree.Visible)
    -  and (ComponentTree.Parent=Self) then
    -    ComponentTree.Height:=ClientHeight div 4;
    -end;
    -
     procedure TObjectInspectorDlg.OnGridKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     var
    
    oi_resize2.patch (2,062 bytes)
  • oi_resize3.patch (1,890 bytes)
    Index: ideintf/objectinspector.lfm
    ===================================================================
    --- ideintf/objectinspector.lfm	(revision 28679)
    +++ ideintf/objectinspector.lfm	(working copy)
    @@ -8,7 +8,6 @@
       ClientHeight = 669
       ClientWidth = 275
       KeyPreview = True
    -  OnResize = ObjectInspectorResize
       LCLVersion = '0.9.29'
       object StatusBar: TStatusBar
         Left = 0
    Index: ideintf/objectinspector.pp
    ===================================================================
    --- ideintf/objectinspector.pp	(revision 28679)
    +++ ideintf/objectinspector.pp	(working copy)
    @@ -612,7 +612,6 @@
         procedure ComponentTreeKeyDown(Sender: TObject; var Key: Word;
           Shift: TShiftState);
         procedure ComponentTreeSelectionChanged(Sender: TObject);
    -    procedure ObjectInspectorResize(Sender: TObject);
         procedure OnGridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
         procedure OnGridKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
         procedure OnGridDblClick(Sender: TObject);
    @@ -3999,6 +3998,7 @@
     begin
       if FComponentTreeHeight=AValue then exit;
       FComponentTreeHeight:=AValue;
    +  ComponentTree.Height:=FComponentTreeHeight;
     end;
     
     procedure TObjectInspectorDlg.SetDefaultItemHeight(const AValue: integer);
    @@ -4217,6 +4217,7 @@
     begin
       ComponentTree.Selection := FSelection;
       ComponentTree.MakeSelectionVisible;
    +  FComponentTreeHeight := ComponentTree.Height;
     end;
     
     procedure TObjectInspectorDlg.SaveChanges;
    @@ -4345,13 +4346,6 @@
         FOnSelectPersistentsInOI(Self);
     end;
     
    -procedure TObjectInspectorDlg.ObjectInspectorResize(Sender: TObject);
    -begin
    -  if (ComponentTree<>nil) and (ComponentTree.Visible)
    -  and (ComponentTree.Parent=Self) then
    -    ComponentTree.Height:=ClientHeight div 4;
    -end;
    -
     procedure TObjectInspectorDlg.OnGridKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     var
    
    oi_resize3.patch (1,890 bytes)

Activities

2010-12-11 00:18

 

oi_resize2.patch (2,062 bytes)
Index: ideintf/objectinspector.lfm
===================================================================
--- ideintf/objectinspector.lfm	(revision 28673)
+++ ideintf/objectinspector.lfm	(working copy)
@@ -8,7 +8,6 @@
   ClientHeight = 669
   ClientWidth = 275
   KeyPreview = True
-  OnResize = ObjectInspectorResize
   LCLVersion = '0.9.29'
   object StatusBar: TStatusBar
     Left = 0
Index: ideintf/objectinspector.pp
===================================================================
--- ideintf/objectinspector.pp	(revision 28673)
+++ ideintf/objectinspector.pp	(working copy)
@@ -612,7 +612,6 @@
     procedure ComponentTreeKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     procedure ComponentTreeSelectionChanged(Sender: TObject);
-    procedure ObjectInspectorResize(Sender: TObject);
     procedure OnGridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure OnGridKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure OnGridDblClick(Sender: TObject);
@@ -3759,7 +3758,7 @@
   AnObjInspector.DefaultItemHeight := FDefaultItemHeight;
   AnObjInspector.ShowComponentTree := FShowComponentTree;
   AnObjInspector.ShowInfoBox := FShowInfoBox;
-  AnObjInspector.ComponentTreeHeight := FComponentTreeHeight;
+  AnObjInspector.ComponentTree.Height := FComponentTreeHeight;
   AnObjInspector.AutoShow := AutoShow;
   AnObjInspector.ShowStatusBar := ShowStatusBar;
 end;
@@ -4217,6 +4216,7 @@
 begin
   ComponentTree.Selection := FSelection;
   ComponentTree.MakeSelectionVisible;
+  FComponentTreeHeight := ComponentTree.Height;
 end;
 
 procedure TObjectInspectorDlg.SaveChanges;
@@ -4345,13 +4345,6 @@
     FOnSelectPersistentsInOI(Self);
 end;
 
-procedure TObjectInspectorDlg.ObjectInspectorResize(Sender: TObject);
-begin
-  if (ComponentTree<>nil) and (ComponentTree.Visible)
-  and (ComponentTree.Parent=Self) then
-    ComponentTree.Height:=ClientHeight div 4;
-end;
-
 procedure TObjectInspectorDlg.OnGridKeyDown(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 var
oi_resize2.patch (2,062 bytes)

2010-12-11 10:46

 

oi_resize3.patch (1,890 bytes)
Index: ideintf/objectinspector.lfm
===================================================================
--- ideintf/objectinspector.lfm	(revision 28679)
+++ ideintf/objectinspector.lfm	(working copy)
@@ -8,7 +8,6 @@
   ClientHeight = 669
   ClientWidth = 275
   KeyPreview = True
-  OnResize = ObjectInspectorResize
   LCLVersion = '0.9.29'
   object StatusBar: TStatusBar
     Left = 0
Index: ideintf/objectinspector.pp
===================================================================
--- ideintf/objectinspector.pp	(revision 28679)
+++ ideintf/objectinspector.pp	(working copy)
@@ -612,7 +612,6 @@
     procedure ComponentTreeKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     procedure ComponentTreeSelectionChanged(Sender: TObject);
-    procedure ObjectInspectorResize(Sender: TObject);
     procedure OnGridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure OnGridKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure OnGridDblClick(Sender: TObject);
@@ -3999,6 +3998,7 @@
 begin
   if FComponentTreeHeight=AValue then exit;
   FComponentTreeHeight:=AValue;
+  ComponentTree.Height:=FComponentTreeHeight;
 end;
 
 procedure TObjectInspectorDlg.SetDefaultItemHeight(const AValue: integer);
@@ -4217,6 +4217,7 @@
 begin
   ComponentTree.Selection := FSelection;
   ComponentTree.MakeSelectionVisible;
+  FComponentTreeHeight := ComponentTree.Height;
 end;
 
 procedure TObjectInspectorDlg.SaveChanges;
@@ -4345,13 +4346,6 @@
     FOnSelectPersistentsInOI(Self);
 end;
 
-procedure TObjectInspectorDlg.ObjectInspectorResize(Sender: TObject);
-begin
-  if (ComponentTree<>nil) and (ComponentTree.Visible)
-  and (ComponentTree.Parent=Self) then
-    ComponentTree.Height:=ClientHeight div 4;
-end;
-
 procedure TObjectInspectorDlg.OnGridKeyDown(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 var
oi_resize3.patch (1,890 bytes)

Tomasz Wieckowski

2010-12-11 10:47

reporter   ~0044166

The second patch will be better.

Paul Ishenin

2011-01-20 10:00

manager   ~0045323

I reviewed your patch.

1. Resize handler removal - ok.
2. Height save/load - not ok. Better to get actual treeview height than to rely on non-related event handler.

I've rewrote a part related to save/loading of component tree and information box heights.

Please test and close if ok.

Issue History

Date Modified Username Field Change
2010-12-11 00:18 Tomasz Wieckowski New Issue
2010-12-11 00:18 Tomasz Wieckowski File Added: oi_resize2.patch
2010-12-11 00:18 Tomasz Wieckowski Widgetset => Win32/Win64
2010-12-11 08:09 Vincent Snijders LazTarget => 0.99.0
2010-12-11 08:09 Vincent Snijders Status new => acknowledged
2010-12-11 08:09 Vincent Snijders Target Version => 0.99.0
2010-12-11 10:46 Tomasz Wieckowski File Added: oi_resize3.patch
2010-12-11 10:47 Tomasz Wieckowski Note Added: 0044166
2011-01-20 10:00 Paul Ishenin Fixed in Revision => 29134
2011-01-20 10:00 Paul Ishenin Status acknowledged => resolved
2011-01-20 10:00 Paul Ishenin Fixed in Version => 0.9.31 (SVN)
2011-01-20 10:00 Paul Ishenin Resolution open => fixed
2011-01-20 10:00 Paul Ishenin Assigned To => Paul Ishenin
2011-01-20 10:00 Paul Ishenin Note Added: 0045323
2011-01-20 10:16 Tomasz Wieckowski Status resolved => closed