Ignore:
Timestamp:
Feb 18, 2012, 8:44:10 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Target specific options is maintained by target class in registry.
  • Modified: Integer index TargetIndex replaced by object reference CurrentTarget.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTarget.pas

    r31 r32  
    1212  TCompilerOptimization = (coNone, coNormal);
    1313
    14   TTargetCapability = (tcRun, tcPause, tcStop, tcStepOut, tsStepOver, tsStepInto,
    15     tsRunToCursor, tcCompile, tcBreakpoint);
     14  TTargetCapability = (tcRun, tcPause, tcStop, tcStepOut, tcStepOver, tcStepInto,
     15    tcRunToCursor, tcCompile, tcBreakpoint);
    1616  TTargetCapabilities = set of TTargetCapability;
    1717
     18  TRunState = (rsStopped, rsPaused, rsRunning);
     19
    1820  { TTarget }
    1921
    2022  TTarget = class
     23  private
    2124  protected
     25    FSource: string;
    2226    Indent: Integer;
     27    FState: TRunState;
     28    FOnChangeState: TNotifyEvent;
     29    procedure SetSource(AValue: string); virtual;
    2330    procedure AddLine(Text: string);
    2431    function LongFileName(FileName: string): string;
     
    2633    Name: string;
    2734    ProgramName: string;
    28     Source: string;
    2935    Output: string;
    3036    Optimization: TCompilerOptimization;
     
    4551    procedure StepOut; virtual;
    4652    procedure RunToCursor; virtual;
     53    procedure LoadFromRegistry(Root: HKEY; Key: string); virtual;
     54    procedure SaveToRegistry(Root: HKEY; Key: string); virtual;
     55    property State: TRunState read FState;
     56    property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState;
     57    property Source: string write SetSource;
    4758  end;
    4859
     
    5263    procedure LoadFromRegistry(Root: HKEY; Key: string);
    5364    procedure SaveToRegistry(Root: HKEY; Key: string);
     65    function FindByName(Name: string): TTarget;
    5466  end;
    5567
     
    98110end;
    99111
     112function TTargetList.FindByName(Name: string): TTarget;
     113var
     114  I: Integer;
     115begin
     116  I := 0;
     117  while (I < Count) and (TTarget(Items[I]).Name <> Name) do Inc(I);
     118  if I < Count then Result := TTarget(Items[I])
     119    else Result := nil;
     120end;
     121
    100122{ TTarget }
     123
     124procedure TTarget.SetSource(AValue: string);
     125begin
     126  FSource := AValue;
     127end;
    101128
    102129procedure TTarget.AddLine(Text: string);
     
    209236end;
    210237
     238procedure TTarget.LoadFromRegistry(Root: HKEY; Key: string);
     239begin
     240
     241end;
     242
     243procedure TTarget.SaveToRegistry(Root: HKEY; Key: string);
     244begin
     245
     246end;
     247
    211248end.
    212249
Note: See TracChangeset for help on using the changeset viewer.