~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to debugger/inspectdlg.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
interface
29
29
 
30
30
uses
31
 
  Classes, SysUtils, TypInfo, FileUtil, Forms, Controls, Graphics,
32
 
  Dialogs, ComCtrls, ObjectInspector, PropEdits, Debugger, DebuggerDlg, BaseDebugManager,
33
 
  LazarusIDEStrConsts, IDEWindowIntf, LCLProc, LCLType, Grids, StdCtrls;
 
31
  Classes, SysUtils, Forms, Controls, Graphics,
 
32
  IDEWindowIntf, DebuggerStrConst, ComCtrls, ObjectInspector, PropEdits, Debugger, DebuggerDlg, BaseDebugManager,
 
33
  LazarusIDEStrConsts, LCLType, Grids, StdCtrls, Menus;
34
34
 
35
35
type
36
36
 
47
47
 
48
48
  TIDEInspectDlg = class(TDebuggerDlg)
49
49
    EditInspected: TEdit;
 
50
    menuClassType: TMenuItem;
50
51
    PageControl: TPageControl;
 
52
    PopupMenu1: TPopupMenu;
51
53
    StatusBar1: TStatusBar;
52
54
    DataPage: TTabSheet;
53
55
    PropertiesPage: TTabSheet;
54
56
    MethodsPage: TTabSheet;
55
57
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
56
58
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
 
59
    procedure menuClassTypeClick(Sender: TObject);
57
60
  private
58
 
    FDataGridHook,
59
 
    FPropertiesGridHook,
60
 
    FMethodsGridHook: TPropertyEditorHook;
61
 
    FDataGrid,
62
 
    FPropertiesGrid,
63
 
    FMethodsGrid: TOIDBGGrid;
 
61
    //FDataGridHook,
 
62
    //FPropertiesGridHook,
 
63
    //FMethodsGridHook: TPropertyEditorHook;
 
64
    //FDataGrid,
 
65
    //FPropertiesGrid,
 
66
    //FMethodsGrid: TOIDBGGrid;
64
67
    FExpression: ansistring;
65
68
    FHumanReadable: ansistring;
66
69
    FDBGInfo: TDBGType;
67
70
    FGridData: TStringGrid;
68
71
    FGridMethods: TStringGrid;
 
72
    FUpdateLock, FUpdateNeeded: Boolean;
69
73
    procedure Localize;
70
74
    procedure InspectClass;
71
75
    procedure InspectRecord;
72
76
    procedure InspectVariant;
73
77
    procedure InspectSimple;
 
78
    procedure InspectEnum;
 
79
    procedure InspectSet;
74
80
    procedure InspectPointer;
75
 
    procedure GridDataSetup;
76
 
    procedure GridMethodsSetup;
 
81
    procedure GridDataSetup(Initial: Boolean = False);
 
82
    procedure GridMethodsSetup(Initial: Boolean = False);
77
83
    procedure ShowDataFields;
78
84
    procedure ShowMethodsFields;
 
85
    procedure Clear;
79
86
  protected
 
87
    function  ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
 
88
    procedure ColSizeSetter(AColId: Integer; ASize: Integer);
80
89
  public
81
90
    constructor Create(AOwner: TComponent); override;
82
91
    destructor Destroy; override;
83
92
    procedure Execute(const AExpression: ansistring);
 
93
    procedure UpdateData;
84
94
  end;
85
95
 
86
96
implementation
87
97
 
88
98
{$R *.lfm}
89
99
 
 
100
var
 
101
  InspectDlgWindowCreator: TIDEWindowCreator;
 
102
 
 
103
const
 
104
  COL_INSPECT_DNAME    = 1;
 
105
  COL_INSPECT_DTYPE    = 2;
 
106
  COL_INSPECT_DVALUE   = 3;
 
107
  COL_INSPECT_MNAME    = 11;
 
108
  COL_INSPECT_MTYPE    = 12;
 
109
  COL_INSPECT_MRETURNS = 13;
 
110
  COL_INSPECT_MADDRESS = 14;
 
111
 
 
112
function InspectDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
 
113
begin
 
114
  Result := AForm is TIDEInspectDlg;
 
115
  if Result then
 
116
    Result := TIDEInspectDlg(AForm).ColSizeGetter(AColId, ASize);
 
117
end;
 
118
 
 
119
procedure InspectDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
 
120
begin
 
121
  if AForm is TIDEInspectDlg then
 
122
    TIDEInspectDlg(AForm).ColSizeSetter(AColId, ASize);
 
123
end;
 
124
 
90
125
{ TIDEInspectDlg }
91
126
 
92
127
procedure TIDEInspectDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);
101
136
    Close;
102
137
end;
103
138
 
 
139
procedure TIDEInspectDlg.menuClassTypeClick(Sender: TObject);
 
140
begin
 
141
  menuClassType.Checked := not menuClassType.Checked;
 
142
  UpdateData;
 
143
end;
 
144
 
104
145
procedure TIDEInspectDlg.Localize;
105
146
begin
106
147
  Caption := lisInspectDialog;
107
148
  DataPage.Caption := lisInspectData;
108
149
  PropertiesPage.Caption := lisInspectProperties;
109
150
  MethodsPage.Caption := lisInspectMethods;
 
151
  menuClassType.Caption := drsUseInstanceClassType;
110
152
end;
111
153
 
112
154
procedure TIDEInspectDlg.InspectClass;
120
162
  EditInspected.Text:=FExpression+' : Class '+FDBGInfo.TypeName+' inherits from '+FDBGInfo.Ancestor;
121
163
  GridDataSetup;
122
164
  ShowDataFields;
123
 
  FGridData.AutoSizeColumn(1);
124
 
  FGridData.AutoSizeColumn(2);
 
165
  //FGridData.AutoSizeColumn(1);
 
166
  //FGridData.AutoSizeColumn(2);
125
167
  GridMethodsSetup;
126
168
  ShowMethodsFields;
127
 
  FGridMethods.AutoSizeColumn(1);
128
 
  FGridMethods.AutoSizeColumn(3);
 
169
  //FGridMethods.AutoSizeColumn(1);
 
170
  //FGridMethods.AutoSizeColumn(3);
129
171
end;
130
172
 
131
173
procedure TIDEInspectDlg.InspectVariant;
139
181
  FGridData.Cells[0,1]:=FExpression;
140
182
  FGridData.Cells[1,1]:='Variant';
141
183
  FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
142
 
  FGridData.AutoSizeColumn(1);
 
184
  //FGridData.AutoSizeColumn(1);
143
185
end;
144
186
 
145
187
procedure TIDEInspectDlg.InspectRecord;
153
195
  EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName;
154
196
  GridDataSetup;
155
197
  ShowDataFields;
156
 
  FGridData.AutoSizeColumn(2);
 
198
  //FGridData.AutoSizeColumn(2);
157
199
end;
158
200
 
159
201
procedure TIDEInspectDlg.InspectSimple;
167
209
  FGridData.Cells[0,1]:=FExpression;
168
210
  FGridData.Cells[1,1]:=FDBGInfo.TypeName;
169
211
  FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
170
 
  FGridData.AutoSizeColumn(2);
 
212
  //FGridData.AutoSizeColumn(2);
 
213
end;
 
214
 
 
215
procedure TIDEInspectDlg.InspectEnum;
 
216
begin
 
217
  DataPage.TabVisible:=true;
 
218
  PropertiesPage.TabVisible:=false;
 
219
  MethodsPage.TabVisible:=false;
 
220
  if not Assigned(FDBGInfo) then exit;
 
221
  EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
 
222
  GridDataSetup;
 
223
  FGridData.Cells[0,1]:=FExpression;
 
224
  FGridData.Cells[1,1]:=FDBGInfo.TypeName;
 
225
  if (FDBGInfo.TypeName <> '') and (FDBGInfo.TypeDeclaration <> '')
 
226
  then FGridData.Cells[1,1] := FGridData.Cells[1,1] + ' = ';
 
227
  FGridData.Cells[1,1] := FGridData.Cells[1,1] + FDBGInfo.TypeDeclaration;
 
228
  FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
 
229
  //FGridData.AutoSizeColumn(2);
 
230
end;
 
231
 
 
232
procedure TIDEInspectDlg.InspectSet;
 
233
begin
 
234
  DataPage.TabVisible:=true;
 
235
  PropertiesPage.TabVisible:=false;
 
236
  MethodsPage.TabVisible:=false;
 
237
  if not Assigned(FDBGInfo) then exit;
 
238
  EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
 
239
  GridDataSetup;
 
240
  FGridData.Cells[0,1]:=FExpression;
 
241
  FGridData.Cells[1,1]:=FDBGInfo.TypeName;
 
242
  if (FDBGInfo.TypeName <> '') and (FDBGInfo.TypeDeclaration <> '')
 
243
  then FGridData.Cells[1,1] := FGridData.Cells[1,1] + ' = ';
 
244
  FGridData.Cells[1,1] := FGridData.Cells[1,1] + FDBGInfo.TypeDeclaration;
 
245
  FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
 
246
  //FGridData.AutoSizeColumn(2);
171
247
end;
172
248
 
173
249
procedure TIDEInspectDlg.InspectPointer;
182
258
  if (FDBGInfo.TypeName <> '') and (FDBGInfo.TypeName[1] = '^')
183
259
  then FGridData.Cells[1,1]:='Pointer to '+copy(FDBGInfo.TypeName, 2, length(FDBGInfo.TypeName))
184
260
  else FGridData.Cells[1,1]:=FDBGInfo.TypeName;
 
261
  {$PUSH}{$RANGECHECKS OFF}
185
262
  FGridData.Cells[2,1]:=format('$%x',[PtrUInt(FDBGInfo.Value.AsPointer)]);
186
 
  FGridData.AutoSizeColumn(2);
187
 
end;
188
 
 
189
 
procedure TIDEInspectDlg.GridDataSetup;
190
 
begin
191
 
  with FGridData do begin
192
 
    Clear;
193
 
    BorderStyle:=bsNone;
194
 
    BorderWidth:=0;
195
 
    DefaultColWidth:=100;
196
 
    Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
197
 
                        goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
198
 
                        goTabs,goScrollKeepVisible,goRowSelect];
199
 
    Align:=alClient;
200
 
    TitleFont.Style:=[fsBold];
201
 
    ExtendedSelect:=false;
202
 
    RowCount:=2;
203
 
    FixedRows:=1;
204
 
    FixedCols:=0;
205
 
    ColCount:=3;
206
 
    Cols[0].Text:='Name';
207
 
    Cols[1].Text:='Type';
208
 
    Cols[2].Text:='Value';
209
 
    Color:=clBtnFace;
210
 
  end;
211
 
end;
212
 
 
213
 
procedure TIDEInspectDlg.GridMethodsSetup;
214
 
begin
215
 
  with FGridMethods do begin
216
 
    Clear;
217
 
    BorderStyle:=bsNone;
218
 
    BorderWidth:=0;
219
 
    DefaultColWidth:=100;
220
 
    Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
221
 
                        goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
222
 
                        goTabs,goScrollKeepVisible,goRowSelect];
223
 
    Align:=alClient;
224
 
    TitleFont.Style:=[fsBold];
225
 
    ExtendedSelect:=false;
226
 
    RowCount:=2;
227
 
    FixedRows:=1;
228
 
    FixedCols:=0;
229
 
    ColCount:=4;
230
 
    Cols[0].Text:='Name';
231
 
    Cols[1].Text:='Type';
232
 
    Cols[2].Text:='Returns';
233
 
    Cols[3].Text:='Address';
234
 
    Color:=clBtnFace;
235
 
  end;
 
263
  {$POP}
 
264
  //FGridData.AutoSizeColumn(2);
 
265
end;
 
266
 
 
267
procedure TIDEInspectDlg.GridDataSetup(Initial: Boolean = False);
 
268
begin
 
269
  if Initial then
 
270
    with FGridData do begin
 
271
      Clear;
 
272
      BorderStyle:=bsNone;
 
273
      BorderWidth:=0;
 
274
      DefaultColWidth:=100;
 
275
      Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected, goThumbTracking,
 
276
                          goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
 
277
                          goTabs,goRowSelect];
 
278
      Align:=alClient;
 
279
      TitleFont.Style:=[fsBold];
 
280
      ExtendedSelect:=false;
 
281
      RowCount:=2;
 
282
      FixedRows:=1;
 
283
      FixedCols:=0;
 
284
      ColCount:=3;
 
285
      Cols[0].Text:='Name';
 
286
      Cols[1].Text:='Type';
 
287
      Cols[2].Text:='Value';
 
288
      Color:=clBtnFace;
 
289
    end;
 
290
  FGridData.RowCount:=1;
 
291
  FGridData.RowCount:=2;
 
292
  FGridData.FixedRows:=1;
 
293
  FGridData.Visible := True;
 
294
end;
 
295
 
 
296
procedure TIDEInspectDlg.GridMethodsSetup(Initial: Boolean = False);
 
297
begin
 
298
  if Initial then
 
299
    with FGridMethods do begin
 
300
      Clear;
 
301
      BorderStyle:=bsNone;
 
302
      BorderWidth:=0;
 
303
      DefaultColWidth:=100;
 
304
      Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected, goThumbTracking,
 
305
                          goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
 
306
                          goTabs,goRowSelect];
 
307
      Align:=alClient;
 
308
      TitleFont.Style:=[fsBold];
 
309
      ExtendedSelect:=false;
 
310
      RowCount:=2;
 
311
      FixedRows:=1;
 
312
      FixedCols:=0;
 
313
      ColCount:=4;
 
314
      Cols[0].Text:='Name';
 
315
      Cols[1].Text:='Type';
 
316
      Cols[2].Text:='Returns';
 
317
      Cols[3].Text:='Address';
 
318
      Color:=clBtnFace;
 
319
    end;
 
320
  FGridMethods.RowCount:=1;
 
321
  FGridMethods.RowCount:=2;
 
322
  FGridMethods.FixedRows:=1;
236
323
end;
237
324
 
238
325
procedure TIDEInspectDlg.ShowDataFields;
347
434
  end;
348
435
end;
349
436
 
 
437
procedure TIDEInspectDlg.Clear;
 
438
begin
 
439
  DataPage.TabVisible:=false;
 
440
  PropertiesPage.TabVisible:=false;
 
441
  MethodsPage.TabVisible:=false;
 
442
  GridDataSetup;
 
443
  FGridData.Visible := False;
 
444
  EditInspected.Text:='';
 
445
end;
 
446
 
 
447
function TIDEInspectDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
 
448
begin
 
449
  ASize := -1;
 
450
  case AColId of
 
451
    COL_INSPECT_DNAME:    ASize := FGridData.ColWidths[0];
 
452
    COL_INSPECT_DTYPE:    ASize := FGridData.ColWidths[1];
 
453
    COL_INSPECT_DVALUE:   ASize := FGridData.ColWidths[2];
 
454
    COL_INSPECT_MNAME:    ASize := FGridMethods.ColWidths[0];
 
455
    COL_INSPECT_MTYPE:    ASize := FGridMethods.ColWidths[1];
 
456
    COL_INSPECT_MRETURNS: ASize := FGridMethods.ColWidths[2];
 
457
    COL_INSPECT_MADDRESS: ASize := FGridMethods.ColWidths[3];
 
458
  end;
 
459
  Result := (ASize > 0) and (ASize <> 100); // The default for all
 
460
end;
 
461
 
 
462
procedure TIDEInspectDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
 
463
begin
 
464
  case AColId of
 
465
    COL_INSPECT_DNAME:    FGridData.ColWidths[0]:= ASize;
 
466
    COL_INSPECT_DTYPE:    FGridData.ColWidths[1]:= ASize;
 
467
    COL_INSPECT_DVALUE:   FGridData.ColWidths[2]:= ASize;
 
468
    COL_INSPECT_MNAME:    FGridMethods.ColWidths[0]:= ASize;
 
469
    COL_INSPECT_MTYPE:    FGridMethods.ColWidths[1]:= ASize;
 
470
    COL_INSPECT_MRETURNS: FGridMethods.ColWidths[2]:= ASize;
 
471
    COL_INSPECT_MADDRESS: FGridMethods.ColWidths[3]:= ASize;
 
472
  end;
 
473
end;
 
474
 
350
475
constructor TIDEInspectDlg.Create(AOwner: TComponent);
351
476
 
352
477
  function NewGrid(AName: String; AParent: TWinControl; AHook: TPropertyEditorHook): TOIDBGGrid;
363
488
 
364
489
begin
365
490
  inherited Create(AOwner);
366
 
  FDataGridHook := TPropertyEditorHook.Create;
367
 
  FDataGrid := NewGrid('DataGrid', DataPage, FDataGridHook);
368
 
 
369
 
  FPropertiesGridHook := TPropertyEditorHook.Create;
370
 
  FPropertiesGrid := NewGrid('PropertiesGrid', PropertiesPage, FPropertiesGridHook);
371
 
 
372
 
  FMethodsGridHook := TPropertyEditorHook.Create;
373
 
  FMethodsGrid := NewGrid('MethodsGrid', MethodsPage, FMethodsGridHook);
374
 
 
 
491
  //FDBGInfo := nil;
 
492
  //FDataGridHook := TPropertyEditorHook.Create;
 
493
  //FDataGrid := NewGrid('DataGrid', DataPage, FDataGridHook);
 
494
  //
 
495
  //FPropertiesGridHook := TPropertyEditorHook.Create;
 
496
  //FPropertiesGrid := NewGrid('PropertiesGrid', PropertiesPage, FPropertiesGridHook);
 
497
  //
 
498
  //FMethodsGridHook := TPropertyEditorHook.Create;
 
499
  //FMethodsGrid := NewGrid('MethodsGrid', MethodsPage, FMethodsGridHook);
 
500
 
 
501
  FUpdateLock := False;
 
502
  FUpdateNeeded := False;
375
503
  Localize;
376
504
 
377
505
  FGridData:=TStringGrid.Create(DataPage);
378
506
  DataPage.InsertControl(FGridData);
379
 
  GridDataSetup;
 
507
  GridDataSetup(True);
 
508
 
380
509
  FGridMethods:=TStringGrid.Create(MethodsPage);
381
510
  MethodsPage.InsertControl(FGridMethods);
382
 
  GridMethodsSetup;
 
511
  GridMethodsSetup(True);
 
512
 
 
513
  Clear;
383
514
end;
384
515
 
385
516
destructor TIDEInspectDlg.Destroy;
386
517
begin
387
518
  FreeAndNil(FDBGInfo);
388
 
  FreeAndNil(FDataGridHook);
389
 
  FreeAndNil(FPropertiesGridHook);
390
 
  FreeAndNil(FMethodsGridHook);
 
519
  //FreeAndNil(FDataGridHook);
 
520
  //FreeAndNil(FPropertiesGridHook);
 
521
  //FreeAndNil(FMethodsGridHook);
391
522
  inherited Destroy;
392
523
end;
393
524
 
394
525
procedure TIDEInspectDlg.Execute(const AExpression: ansistring);
395
526
begin
396
 
  FExpression:='';
397
 
  FreeAndNil(FDBGInfo);
398
 
  if not DebugBoss.Evaluate(AExpression,FHumanReadable,FDBGInfo) or not assigned(FDBGInfo) then
399
 
  begin
 
527
  FExpression:=AExpression;
 
528
  UpdateData;
 
529
end;
 
530
 
 
531
procedure TIDEInspectDlg.UpdateData;
 
532
var
 
533
  Opts: TDBGEvaluateFlags;
 
534
begin
 
535
  if FUpdateLock then begin
 
536
    FUpdateNeeded := True;
 
537
    exit;
 
538
  end;
 
539
 
 
540
  FUpdateLock := True;
 
541
  FUpdateNeeded := False;
 
542
  try
400
543
    FreeAndNil(FDBGInfo);
401
 
    Exit;
402
 
  end;
403
 
  FExpression:=AExpression;
404
 
  case FDBGInfo.Kind of
405
 
    skClass: InspectClass();
406
 
    skRecord: InspectRecord();
407
 
    skVariant: InspectVariant();
408
 
  //  skEnum: ;
409
 
  //  skSet: ;
410
 
  //  skProcedure: ;
411
 
  //  skFunction: ;
412
 
    skSimple: InspectSimple();
413
 
    skPointer: InspectPointer();
414
 
  //  skDecomposable: ;
415
 
  end;
 
544
    if FExpression = ''
 
545
      then begin
 
546
        Clear;
 
547
        StatusBar1.SimpleText := '';
 
548
        exit;
 
549
      end;
 
550
 
 
551
    Opts := [defFullTypeInfo];
 
552
    if menuClassType.Checked then
 
553
      include(Opts, defClassAutoCast);
 
554
    if not DebugBoss.Evaluate(FExpression, FHumanReadable, FDBGInfo, Opts)
 
555
    or not assigned(FDBGInfo) then
 
556
    begin
 
557
      FreeAndNil(FDBGInfo);
 
558
      Clear;
 
559
      EditInspected.Text:=FExpression + ' : unavailable';
 
560
      Exit;
 
561
    end;
 
562
    case FDBGInfo.Kind of
 
563
      skClass: InspectClass();
 
564
      skRecord: InspectRecord();
 
565
      skVariant: InspectVariant();
 
566
      skEnum: InspectEnum;
 
567
      skSet: InspectSet;
 
568
      skProcedure: InspectSimple;
 
569
      skFunction: InspectSimple;
 
570
      skSimple: InspectSimple();
 
571
      skPointer: InspectPointer();
 
572
    //  skDecomposable: ;
 
573
    end;
 
574
  finally
 
575
    FUpdateLock := False;
 
576
  end;
 
577
 
 
578
  if FUpdateNeeded then
 
579
    UpdateData;
416
580
end;
417
581
 
418
582
{ TOIDBGGrid }
422
586
 
423
587
end;
424
588
 
 
589
initialization
 
590
 
 
591
  InspectDlgWindowCreator := IDEWindowCreators.Add(DebugDialogNames[ddtInspect]);
 
592
  InspectDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
 
593
  InspectDlgWindowCreator.OnSetDividerSize := @InspectDlgColSizeSetter;
 
594
  InspectDlgWindowCreator.OnGetDividerSize := @InspectDlgColSizeGetter;
 
595
  InspectDlgWindowCreator.DividerTemplate.Add('InspectDataName',  COL_INSPECT_DNAME, @drsInspectColWidthDataName);
 
596
  InspectDlgWindowCreator.DividerTemplate.Add('InspectDataType',  COL_INSPECT_DTYPE, @drsInspectColWidthDataType);
 
597
  InspectDlgWindowCreator.DividerTemplate.Add('InspectDataValue', COL_INSPECT_DVALUE, @drsInspectColWidthDataValue);
 
598
 
 
599
  InspectDlgWindowCreator.DividerTemplate.Add('InspectMethName',    COL_INSPECT_MNAME,    @drsInspectColWidthMethName);
 
600
  InspectDlgWindowCreator.DividerTemplate.Add('InspectMethType',    COL_INSPECT_MTYPE,    @drsInspectColWidthMethType);
 
601
  InspectDlgWindowCreator.DividerTemplate.Add('InspectMethReturns', COL_INSPECT_MRETURNS, @drsInspectColWidthMethReturns);
 
602
  InspectDlgWindowCreator.DividerTemplate.Add('InspectMethAddress', COL_INSPECT_MADDRESS, @drsInspectColWidthMethAddress);
 
603
  InspectDlgWindowCreator.CreateSimpleLayout;
 
604
 
425
605
end.
426
606