mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 04:39:41 +01:00 
			
		
		
		
	implemented jump to code on double click for breakpoints and callstack dlg
git-svn-id: trunk@3056 -
This commit is contained in:
		
							parent
							
								
									9234059378
								
							
						
					
					
						commit
						43fed46717
					
				@ -1,8 +1,13 @@
 | 
			
		||||
  LazarusResources.Add('TCallStackDlg','FORMDATA',
 | 
			
		||||
    'TPF0'#13'TCallStackDlg'#12'CallStackDlg'#4'Left'#3'g'#1#3'Top'#2'~'#5'Wid'
 | 
			
		||||
    +'th'#3#244#1#6'Height'#3#200#0#7'Caption'#6#9'CallStack'#0#9'TListView'#11
 | 
			
		||||
    +'lvCallStack'#4'Left'#2#0#3'Top'#2#0#5'Width'#3#228#1#6'Height'#3#200#0#5
 | 
			
		||||
    +'Align'#7#8'alClient'#7'Columns'#14#1#7'Caption'#6#6'Source'#5'Width'#3
 | 
			
		||||
    +#150#0#0#1#7'Caption'#6#4'Line'#5'Width'#2'2'#0#1#7'Caption'#6#8'Function'
 | 
			
		||||
    +#5'Width'#3','#1#0#0#11'MultiSelect'#8#9'ViewStyle'#7#8'vsReport'#0#0#0
 | 
			
		||||
  );
 | 
			
		||||
{ This is an automatically generated lazarus resource file }
 | 
			
		||||
 | 
			
		||||
LazarusResources.Add('TCallStackDlg','FORMDATA',[
 | 
			
		||||
  'TPF0'#13'TCallStackDlg'#12'CallStackDlg'#7'CAPTION'#6#9'CallStack'#12'CLIENT'
 | 
			
		||||
  +'HEIGHT'#3#200#0#11'CLIENTWIDTH'#3#244#1#7'VISIBLE'#9#18'HORZSCROLLBAR.PAGE'
 | 
			
		||||
  +#3#245#1#18'VERTSCROLLBAR.PAGE'#3#201#0#4'LEFT'#3'g'#1#6'HEIGHT'#3#200#0#3'T'
 | 
			
		||||
  +'OP'#2'~'#5'WIDTH'#3#244#1#0#9'TLISTVIEW'#11'lvCallStack'#5'ALIGN'#7#8'alcli'
 | 
			
		||||
  +'ent'#7'ANCHORS'#11#5'aktop'#6'akleft'#0#7'COLUMNS'#14#1#7'CAPTION'#6#6'Sour'
 | 
			
		||||
  +'ce'#7'VISIBLE'#9#5'WIDTH'#3#150#0#0#1#7'CAPTION'#6#4'Line'#7'VISIBLE'#9#5'W'
 | 
			
		||||
  +'IDTH'#2'2'#0#1#7'CAPTION'#6#8'Function'#7'VISIBLE'#9#5'WIDTH'#3','#1#0#0#9
 | 
			
		||||
  +'VIEWSTYLE'#7#8'vsreport'#10'ONDBLCLICK'#7#19'lvCallStackDBLCLICK'#6'HEIGHT'
 | 
			
		||||
  +#3#200#0#5'WIDTH'#3#244#1#0#0#0
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
@ -42,6 +42,7 @@ uses
 | 
			
		||||
type
 | 
			
		||||
  TCallStackDlg = class(TDebuggerDlg)
 | 
			
		||||
    lvCallStack: TListView;
 | 
			
		||||
    procedure lvCallStackDBLCLICK(Sender: TObject);
 | 
			
		||||
  private  
 | 
			
		||||
    procedure CallStackChanged(Sender: TObject);
 | 
			
		||||
  protected
 | 
			
		||||
@ -61,6 +62,20 @@ implementation
 | 
			
		||||
 | 
			
		||||
{ TCallStackDlg }
 | 
			
		||||
 | 
			
		||||
procedure TCallStackDlg.lvCallStackDBLCLICK(Sender: TObject);
 | 
			
		||||
var
 | 
			
		||||
  CurItem: TListItem;
 | 
			
		||||
  Filename: String;
 | 
			
		||||
  Line: Integer;
 | 
			
		||||
begin
 | 
			
		||||
  CurItem:=lvCallStack.Selected;
 | 
			
		||||
  if CurItem=nil then exit;
 | 
			
		||||
  Filename:=CurItem.Caption;
 | 
			
		||||
  if DoGetFullDebugFilename(Filename,true)<>mrOk then exit;
 | 
			
		||||
  Line:=StrToIntDef(CurItem.SubItems[0],0);
 | 
			
		||||
  DoJumpToCodePos(Filename,Line,0);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCallStackDlg.CallStackChanged(Sender: TObject);
 | 
			
		||||
var
 | 
			
		||||
  n, m: Integer;                               
 | 
			
		||||
@ -68,6 +83,11 @@ var
 | 
			
		||||
  S: String;   
 | 
			
		||||
  Entry: TDBGCallStackEntry;
 | 
			
		||||
begin       
 | 
			
		||||
  if Debugger=nil then begin
 | 
			
		||||
    lvCallStack.Items.Clear;
 | 
			
		||||
    exit;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
  // Reuse entries, so add and remove only                    
 | 
			
		||||
  // Remove unneded
 | 
			
		||||
  for n := lvCallStack.Items.Count - 1 downto Debugger.CallStack.Count do
 | 
			
		||||
@ -125,6 +145,9 @@ end.
 | 
			
		||||
 | 
			
		||||
{ =============================================================================
 | 
			
		||||
  $Log$
 | 
			
		||||
  Revision 1.3  2003/05/29 23:14:17  mattias
 | 
			
		||||
  implemented jump to code on double click for breakpoints and callstack dlg
 | 
			
		||||
 | 
			
		||||
  Revision 1.2  2002/05/10 06:57:47  lazarus
 | 
			
		||||
  MG: updated licenses
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								ide/main.pp
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								ide/main.pp
									
									
									
									
									
								
							@ -575,6 +575,9 @@ type
 | 
			
		||||
                           var ActiveSrcEdit: TSourceEditor;
 | 
			
		||||
                           var ActiveUnitInfo: TUnitInfo;
 | 
			
		||||
                           Flags: TCodeToolsFlags): boolean;
 | 
			
		||||
    function DoJumpToSourcePos(const Filename: string;
 | 
			
		||||
                               NewX, NewY, NewTopLine: integer;
 | 
			
		||||
                               AddJumpPoint: boolean): TModalResult; override;
 | 
			
		||||
    function DoJumpToCodePos(
 | 
			
		||||
                        ActiveSrcEdit: TSourceEditor; ActiveUnitInfo: TUnitInfo;
 | 
			
		||||
                        NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
 | 
			
		||||
@ -7602,6 +7605,17 @@ begin
 | 
			
		||||
  Result:=true;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TMainIDE.DoJumpToSourcePos(const Filename: string; NewX, NewY,
 | 
			
		||||
  NewTopLine: integer; AddJumpPoint: boolean): TModalResult;
 | 
			
		||||
var
 | 
			
		||||
  CodeBuffer: TCodeBuffer;
 | 
			
		||||
begin
 | 
			
		||||
  Result:=mrCancel;
 | 
			
		||||
  CodeBuffer:=CodeToolBoss.LoadFile(CleanAndExpandFilename(Filename),true,false);
 | 
			
		||||
  if CodeBuffer=nil then exit;
 | 
			
		||||
  Result:=DoJumpToCodePos(nil,nil,CodeBuffer,NewX,NewY,NewTopLine,AddJumpPoint);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TMainIDE.DoJumpToCodePos(
 | 
			
		||||
  ActiveSrcEdit: TSourceEditor; ActiveUnitInfo: TUnitInfo;
 | 
			
		||||
  NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
 | 
			
		||||
@ -9080,6 +9094,9 @@ end.
 | 
			
		||||
 | 
			
		||||
{ =============================================================================
 | 
			
		||||
  $Log$
 | 
			
		||||
  Revision 1.587  2003/05/29 23:14:17  mattias
 | 
			
		||||
  implemented jump to code on double click for breakpoints and callstack dlg
 | 
			
		||||
 | 
			
		||||
  Revision 1.586  2003/05/28 21:16:47  mattias
 | 
			
		||||
  added a help and a more button tot he package editor
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user