View Issue Details

IDProjectCategoryView StatusLast Update
0021990PatchesIDEpublic2012-05-15 21:49
ReporterDarius Blaszijk Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.2.0Fixed in Version1.1 (SVN) 
Summary0021990: Improve message dialog variable visability
DescriptionThis patch improves the visability of variables in the message dialog. When viewing record or class variables only part of the information is shown due to the limitation to 255 characters in the code. This patch implements a treeview where all data is shown when a variable is selected.
Additional InformationI can imagine that this patch will be rejected and the listview in the message dialog will be replaced by a propertygrid of some sort.
TagsNo tags attached.
Fixed in Revision37259
LazTarget1.2
Widgetset
Attached Files

Activities

2012-05-08 20:22

 

watchesdlg.diff (3,383 bytes)   
Index: watchesdlg.lfm
===================================================================
--- watchesdlg.lfm	(revision 37224)
+++ watchesdlg.lfm	(working copy)
@@ -16,7 +16,7 @@
     Left = 0
     Height = 174
     Top = 26
-    Width = 500
+    Width = 286
     Align = alClient
     Columns = <    
       item
@@ -115,7 +115,24 @@
       Action = actProperties
     end
   end
-  object mnuPopup: TPopupMenu[2]
+  object tvWatches: TTreeView[2]
+    Left = 291
+    Height = 174
+    Top = 26
+    Width = 209
+    Align = alRight
+    DefaultItemHeight = 16
+    TabOrder = 2
+  end
+  object Splitter1: TSplitter[3]
+    Left = 286
+    Height = 174
+    Top = 26
+    Width = 5
+    Align = alRight
+    ResizeAnchor = akRight
+  end
+  object mnuPopup: TPopupMenu[4]
     left = 100
     top = 96
     object popAdd: TMenuItem
@@ -167,7 +184,7 @@
       Action = actCopyValue
     end
   end
-  object ActionList1: TActionList[3]
+  object ActionList1: TActionList[5]
     left = 184
     top = 88
     object actPower: TAction
Index: watchesdlg.pp
===================================================================
--- watchesdlg.pp	(revision 37224)
+++ watchesdlg.pp	(working copy)
@@ -39,8 +39,9 @@
 
 uses
   Classes, Forms, Controls, math, sysutils, LazLoggerBase, Clipbrd,
-  IDEWindowIntf, Menus, ComCtrls, ActnList, IDEImagesIntf, LazarusIDEStrConsts, DebuggerStrConst,
-  Debugger, DebuggerDlg, BaseDebugManager;
+  IDEWindowIntf, Menus, ComCtrls, ActnList, ExtCtrls, IDEImagesIntf,
+  LazarusIDEStrConsts, DebuggerStrConst, Debugger, DebuggerDlg,
+  BaseDebugManager;
 
 type
 
@@ -87,6 +88,7 @@
     popDisableAll: TMenuItem;
     popEnableAll: TMenuItem;
     popDeleteAll: TMenuItem;
+    Splitter1: TSplitter;
     ToolBar1: TToolBar;
     ToolButtonProperties: TToolButton;
     ToolButtonAdd: TToolButton;
@@ -100,6 +102,7 @@
     ToolButtonEnableAll: TToolButton;
     ToolButtonDisableAll: TToolButton;
     ToolButtonTrashAll: TToolButton;
+    tvWatches: TTreeView;
     procedure actAddWatchPointExecute(Sender: TObject);
     procedure actCopyNameExecute(Sender: TObject);
     procedure actCopyValueExecute(Sender: TObject);
@@ -136,6 +139,7 @@
     procedure WatchUpdate(const ASender: TWatches; const AWatch: TWatch);
     procedure WatchRemove(const ASender: TWatches; const AWatch: TWatch);
 
+    procedure ParseRecordData(expression, data: string);
     procedure UpdateItem(const AItem: TListItem; const AWatch: TWatch);
     procedure UpdateAll;
     procedure DisableAllActions;
@@ -383,6 +387,10 @@
   actProperties.Enabled := ItemSelected;
   actAddWatch.Enabled := True;
   actPower.Enabled := True;
+
+  tvWatches.Items.Clear;
+  if Watch <> nil then
+    ParseRecordData(Watch.Expression, Watch.Values[GetThreadId, GetStackframe].Value);
 end;
 
 procedure TWatchesDlg.lvWatchesDblClick(Sender: TObject);
@@ -665,6 +673,23 @@
   end;
 end;
 
+procedure TWatchesDlg.ParseRecordData(expression, data: string);
+var
+  n: TTreeNode = nil;
+  s: TStrings;
+  i: integer;
+begin
+  n := tvWatches.Items.AddChild(n, expression);
+
+  s := TStringList.Create;
+  s.Text := data;
+
+  for i := 0 to s.Count - 1 do
+    tvWatches.Items.AddChild(n, s[i]);
+
+  s.Free;
+end;
+
 procedure TWatchesDlg.UpdateItem(const AItem: TListItem; const AWatch: TWatch);
   function ClearMultiline(const AValue: ansistring): ansistring;
   var
watchesdlg.diff (3,383 bytes)   

Martin Friebe

2012-05-12 17:29

manager   ~0059537

Thanks.

Applied with various changes.

Darius Blaszijk

2012-05-15 21:49

developer   ~0059635

Thanks!

Issue History

Date Modified Username Field Change
2012-05-08 20:22 Darius Blaszijk New Issue
2012-05-08 20:22 Darius Blaszijk File Added: watchesdlg.diff
2012-05-08 20:22 Darius Blaszijk LazTarget => -
2012-05-08 20:32 Martin Friebe Status new => assigned
2012-05-08 20:32 Martin Friebe Assigned To => Martin Friebe
2012-05-12 17:29 Martin Friebe Fixed in Revision => 37259
2012-05-12 17:29 Martin Friebe LazTarget - => 1.2
2012-05-12 17:29 Martin Friebe Status assigned => resolved
2012-05-12 17:29 Martin Friebe Fixed in Version => 1.1 (SVN)
2012-05-12 17:29 Martin Friebe Resolution open => fixed
2012-05-12 17:29 Martin Friebe Note Added: 0059537
2012-05-12 17:30 Martin Friebe Target Version => 1.2.0
2012-05-15 21:49 Darius Blaszijk Status resolved => closed
2012-05-15 21:49 Darius Blaszijk Note Added: 0059635