Ignore:
Timestamp:
Oct 14, 2010, 8:41:34 AM (15 years ago)
Author:
george
Message:
  • Added: On parsing uses section load and parse unit files.
Location:
branches/Transpascal/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Transpascal/Forms/UMainForm.lfm

    r55 r59  
    6565        Priority = 0
    6666      end>
     67    RightGutter.Width = 0
     68    RightGutter.MouseActions = <   
     69      item
     70        Shift = []
     71        ShiftMask = []
     72        Button = mbLeft
     73        ClickCount = ccAny
     74        ClickDir = cdDown
     75        Command = 13
     76        MoveCaret = False
     77        Option = 0
     78        Priority = 0
     79      end   
     80      item
     81        Shift = []
     82        ShiftMask = []
     83        Button = mbRight
     84        ClickCount = ccSingle
     85        ClickDir = cdUp
     86        Command = 12
     87        MoveCaret = False
     88        Option = 0
     89        Priority = 0
     90      end>
    6791    Highlighter = SynPasSyn1
    6892    Keystrokes = <   
     
    616640    inline SynGutterPartList1: TSynGutterPartList
    617641      object SynGutterMarks1: TSynGutterMarks
    618         Width = 23
     642        Width = 24
    619643      end
    620644      object SynGutterLineNumber1: TSynGutterLineNumber
     
    721745      end
    722746    end
     747    inline SynRightGutterPartList1: TSynRightGutterPartList
     748    end
    723749  end
    724750  object ComboBox1: TComboBox
     
    773799  end
    774800  object SynPasSyn1: TSynPasSyn
     801    Enabled = False
    775802    CompilerMode = pcmDelphi
    776803    NestedComments = False
  • branches/Transpascal/Forms/UMainForm.pas

    r55 r59  
    3737    procedure UpdateProjectTree;
    3838    procedure UpdateProjectGroup(Node: TTreeNode; Group: TProjectGroup);
     39    function GetSource(Name: string; Source: TStringList): Boolean;
    3940  public
    4041    Project: TProject;
     
    8081  // Compile all project files
    8182  Compiler.Init;
    82   for I := 0 to Project.Items.Count - 1 do begin
    83     if TProjectNode(Project.Items[I]) is TProjectFile then
    84     with TProjectFile(Project.Items[I]) do begin
    85       Compiler.Compile(Parent.GetDir + Name, Source, ProducedCode);
    86     end;
     83  Compiler.Parser.OnGetSource := GetSource;
     84  with TProjectFile(Project.Items[0]) do begin
     85    Compiler.Compile(Parent.GetDir + Name, Source, ProducedCode);
    8786  end;
    8887
     
    179178end;
    180179
     180function TMainForm.GetSource(Name: string; Source: TStringList): Boolean;
     181var
     182  FileName: string;
     183begin
     184  FileName := Project.GetDir(True) + Name + '.pas';
     185  if FileExists(FileName) then begin
     186    Source.LoadFromFile(FileName);
     187    Result := True;
     188  end else Result := False;
     189end;
     190
    181191procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
    182192begin
Note: See TracChangeset for help on using the changeset viewer.