Changeset 11


Ignore:
Timestamp:
Aug 3, 2012, 3:06:51 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Project management as separated module.
Location:
trunk
Files:
9 added
4 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/LibreDevelopStudio.lpi

    r8 r11  
    3333      </local>
    3434    </RunParams>
    35     <RequiredPackages Count="5">
     35    <RequiredPackages Count="6">
    3636      <Item1>
    37         <PackageName Value="LDModulePascal"/>
     37        <PackageName Value="LDModuleProject"/>
    3838      </Item1>
    3939      <Item2>
    40         <PackageName Value="LDModuleBrainfuck"/>
     40        <PackageName Value="LDModulePascal"/>
    4141      </Item2>
    4242      <Item3>
    43         <PackageName Value="LDModuleDebug"/>
     43        <PackageName Value="LDModuleBrainfuck"/>
    4444      </Item3>
    4545      <Item4>
    46         <PackageName Value="LibreDevelopStudio"/>
     46        <PackageName Value="LDModuleDebug"/>
    4747      </Item4>
    4848      <Item5>
     49        <PackageName Value="LibreDevelopStudio"/>
     50      </Item5>
     51      <Item6>
    4952        <PackageName Value="LCL"/>
    50       </Item5>
     53      </Item6>
    5154    </RequiredPackages>
    5255    <Units Count="2">
  • trunk/Studio/LibreDevelopStudio.lpr

    r8 r11  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UCore, UDataModule;
     10  Forms, UCore, ULDModuleProject;
    1111
    1212{$R *.res}
  • trunk/Studio/UCore.pas

    r9 r11  
    2929
    3030uses
    31   ULDModuleDebug, UFormMain, ULDModuleBrainfuck, UDataModule, ULDModulePascal;
     31  ULDModuleDebug, UFormMain, ULDModuleBrainfuck, UDataModule, ULDModulePascal,
     32  ULDModuleProject;
    3233
    3334{ TCore }
     
    4950    RegisterModule(TLDModuleBrainfuck.Create, True);
    5051    RegisterModule(TLDModulePascal.Create, True);
     52    RegisterModule(TLDModuleProject.Create, True);
    5153    InstallMarked;
    5254  end;
  • trunk/StudioCommon/ULDStudioAPI.pas

    r10 r11  
    2424
    2525    // API functions
     26    procedure OpenFile(FileName: string);
    2627    procedure RegisterFileType(FileType: TSourceType);
    2728    procedure UnregisterFileType(FileType: TSourceType);
     
    4849  FreeAndNil(Actions);
    4950  inherited Destroy;
     51end;
     52
     53procedure TLDStudioAPI.OpenFile(FileName: string);
     54begin
     55
    5056end;
    5157
  • trunk/StudioModules/LDModuleBrainfuck/ULDModuleBrainfuck.pas

    r7 r11  
    3535begin
    3636  inherited Create;
    37   Name := 'Brainfuck';
     37  Identification := 'Brainfuck';
    3838  Title := SBrainfuck;
    3939  Version := '0.1';
  • trunk/StudioModules/LDModuleDebug/ULDModuleDebug.pas

    r10 r11  
    4545begin
    4646  inherited Create;
    47   Name := 'Debug';
     47  Identification := 'Debug';
    4848  Title := SDebug;
    4949end;
  • trunk/StudioModules/LDModulePascal/ULDModulePascal.pas

    r8 r11  
    3535begin
    3636  inherited Create;
    37   Name := 'Pascal';
     37  Identification := 'Pascal';
    3838  Title := SPascal;
    3939  Version := '0.1';
  • trunk/StudioPackage/Forms/UFormMain.lfm

    r10 r11  
    3030    object ToolButton1: TToolButton
    3131      Left = 1
     32      Hint = 'New project'
    3233      Top = 2
    33       Action = AProjectNew
     34      Caption = 'New...'
     35      ImageIndex = 4
    3436    end
    3537    object ToolButton2: TToolButton
    3638      Left = 24
     39      Hint = 'Open project'
    3740      Top = 2
    38       Action = AProjectOpen
     41      Caption = 'Open...'
     42      ImageIndex = 8
    3943    end
    4044    object ToolButton3: TToolButton
    4145      Left = 47
     46      Hint = 'Save project'
    4247      Top = 2
    43       Action = AProjectSave
     48      Caption = 'Save'
     49      ImageIndex = 13
    4450    end
    4551    object ToolButton4: TToolButton
    4652      Left = 70
     53      Hint = 'Close project'
    4754      Top = 2
    48       Action = AProjectClose
     55      Caption = 'Close'
     56      ImageIndex = 3
    4957    end
    5058  end
     
    125133      object MenuItem27: TMenuItem
    126134        Action = AFileNew
    127       end
    128       object MenuItem28: TMenuItem
    129         Action = AFileOpen
    130       end
    131       object MenuItem29: TMenuItem
    132         Action = AFileOpenRecent
    133       end
    134       object MenuItem30: TMenuItem
    135         Action = AFileSave
    136       end
    137       object MenuItem31: TMenuItem
    138         Action = AFileSaveAs
    139       end
    140       object MenuItem32: TMenuItem
    141         Action = AFileClose
    142       end
    143       object MenuItem33: TMenuItem
    144         Caption = '-'
    145       end
    146       object MenuItem34: TMenuItem
    147         Action = AExit
    148       end
    149     end
    150     object MenuItem1: TMenuItem
    151       Caption = 'Project'
    152       object MenuItem3: TMenuItem
    153         Action = AProjectNew
    154135        Bitmap.Data = {
    155136          36040000424D3604000000000000360000002800000010000000100000000100
     
    189170        }
    190171      end
    191       object MenuItem8: TMenuItem
    192         Action = AProjectOpen
     172      object MenuItem28: TMenuItem
     173        Action = AFileOpen
    193174        Bitmap.Data = {
    194175          36040000424D3604000000000000360000002800000010000000100000000100
     
    228209        }
    229210      end
    230       object MenuItem9: TMenuItem
    231         Action = AProjectOpenRecent
     211      object MenuItem29: TMenuItem
     212        Action = AFileOpenRecent
    232213        Bitmap.Data = {
    233214          36040000424D3604000000000000360000002800000010000000100000000100
     
    267248        }
    268249      end
    269       object MenuItem10: TMenuItem
    270         Action = AProjectSave
     250      object MenuItem30: TMenuItem
     251        Action = AFileSave
    271252        Bitmap.Data = {
    272253          36040000424D3604000000000000360000002800000010000000100000000100
     
    306287        }
    307288      end
    308       object MenuItem11: TMenuItem
    309         Action = AProjectSaveAs
     289      object MenuItem31: TMenuItem
     290        Action = AFileSaveAs
    310291        Bitmap.Data = {
    311292          36040000424D3604000000000000360000002800000010000000100000000100
     
    345326        }
    346327      end
    347       object MenuItem12: TMenuItem
    348         Action = AProjectClose
     328      object MenuItem32: TMenuItem
     329        Action = AFileClose
    349330        Bitmap.Data = {
    350331          36040000424D3604000000000000360000002800000010000000100000000100
     
    384365        }
    385366      end
    386       object MenuItem13: TMenuItem
     367      object MenuItem33: TMenuItem
    387368        Caption = '-'
    388369      end
    389       object MenuItem14: TMenuItem
    390         Action = AViewProjectManager
     370      object MenuItem34: TMenuItem
     371        Action = AExit
     372        Bitmap.Data = {
     373          36040000424D3604000000000000360000002800000010000000100000000100
     374          2000000000000004000064000000640000000000000000000000000000000000
     375          0000000000000000000000000000000000FF0000000000000000000000000000
     376          0000000000000000000000000000000000000000000000000000000000000000
     377          00000000000000000000000000FF000000FF0000000000000000000000000000
     378          0000000000000000000000000000000000000000000000000000000000000000
     379          000000000000000000FF008484FF000000FF0000000000000000000000000000
     380          0000000000000000000000000000000000000000000000000000000000000000
     381          0000000000FF008484FF008484FF000000FF0000000000000000000000000000
     382          0000000000000000000000000000000000000000000000000000000000FF0000
     383          00FF008484FF008484FF008484FF000000FF000000FF000000FF000000FF0000
     384          00FF000000FF000000FF000000FF000000000000000000000000000000000000
     385          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     386          0000000000000000000000000000000000000000000000000000000000000000
     387          00FF008484FF008484FF000000FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     388          0000000000000000000000000000840000FF0000000000000000000000000000
     389          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     390          00000000000000000000840000FF840000FF0000000000000000000000000000
     391          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     392          000000000000840000FF840000FF840000FF840000FF840000FF000000000000
     393          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     394          0000840000FF840000FF840000FF840000FF840000FF840000FF000000000000
     395          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     396          000000000000840000FF840000FF840000FF840000FF840000FF000000000000
     397          00FF008484FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     398          00000000000000000000840000FF840000FF0000000000000000000000000000
     399          00FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     400          0000000000000000000000000000840000FF0000000000000000000000000000
     401          00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     402          0000000000000000000000000000000000000000000000000000000000000000
     403          00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
     404          0000000000000000000000000000000000000000000000000000000000000000
     405          0000000000000000000000000000000000000000000000000000000000000000
     406          0000000000000000000000000000000000000000000000000000
     407        }
    391408      end
    392409    end
     
    630647    left = 80
    631648    top = 104
    632     object AProjectNew: TAction
    633       Category = 'Project'
    634       Caption = 'New...'
    635       Hint = 'New project'
    636       ImageIndex = 4
    637     end
    638     object AProjectOpen: TAction
    639       Category = 'Project'
    640       Caption = 'Open...'
    641       Hint = 'Open project'
    642       ImageIndex = 8
    643     end
    644     object AProjectOpenRecent: TAction
    645       Category = 'Project'
    646       Caption = 'Open recent'
    647       Hint = 'Open recent project'
    648       ImageIndex = 8
    649     end
    650     object AProjectSave: TAction
    651       Category = 'Project'
    652       Caption = 'Save'
    653       Hint = 'Save project'
    654       ImageIndex = 13
    655     end
    656     object AProjectSaveAs: TAction
    657       Category = 'Project'
    658       Caption = 'Save as...'
    659       Hint = 'Save project as'
    660       ImageIndex = 13
    661     end
    662     object AProjectClose: TAction
    663       Category = 'Project'
    664       Caption = 'Close'
    665       Hint = 'Close project'
    666       ImageIndex = 3
    667     end
    668649    object AClipboardCopy: TAction
    669650      Category = 'Edit'
     
    703684      Category = 'View'
    704685      Caption = 'Project manager'
    705       OnExecute = AViewProjectManagerExecute
    706686    end
    707687    object AViewSettings: TAction
     
    15311511  object SaveDialogFile: TSaveDialog
    15321512    left = 82
    1533     top = 264
     1513    top = 272
    15341514  end
    15351515end
  • trunk/StudioPackage/Forms/UFormMain.lrt

    r9 r11  
    11TFORMMAIN.CAPTION=LibreDevelop Studio
    22TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1
     3TFORMMAIN.TOOLBUTTON1.HINT=New project
     4TFORMMAIN.TOOLBUTTON1.CAPTION=New...
     5TFORMMAIN.TOOLBUTTON2.HINT=Open project
     6TFORMMAIN.TOOLBUTTON2.CAPTION=Open...
     7TFORMMAIN.TOOLBUTTON3.HINT=Save project
     8TFORMMAIN.TOOLBUTTON3.CAPTION=Save
     9TFORMMAIN.TOOLBUTTON4.HINT=Close project
     10TFORMMAIN.TOOLBUTTON4.CAPTION=Close
    311TFORMMAIN.TABSHEETPROJECT.CAPTION=TabSheetProject
    412TFORMMAIN.TABSHEET2.CAPTION=TabSheet2
     
    715TFORMMAIN.MENUITEM26.CAPTION=File
    816TFORMMAIN.MENUITEM33.CAPTION=-
    9 TFORMMAIN.MENUITEM1.CAPTION=Project
    10 TFORMMAIN.MENUITEM13.CAPTION=-
    1117TFORMMAIN.MENUITEM2.CAPTION=Edit
    1218TFORMMAIN.MENUITEM18.CAPTION=-
     
    1824TFORMMAIN.MENUITEM17.CAPTION=View
    1925TFORMMAIN.MENUITEM15.CAPTION=Help
    20 TFORMMAIN.APROJECTNEW.CAPTION=New...
    21 TFORMMAIN.APROJECTNEW.HINT=New project
    22 TFORMMAIN.APROJECTOPEN.CAPTION=Open...
    23 TFORMMAIN.APROJECTOPEN.HINT=Open project
    24 TFORMMAIN.APROJECTOPENRECENT.CAPTION=Open recent
    25 TFORMMAIN.APROJECTOPENRECENT.HINT=Open recent project
    26 TFORMMAIN.APROJECTSAVE.CAPTION=Save
    27 TFORMMAIN.APROJECTSAVE.HINT=Save project
    28 TFORMMAIN.APROJECTSAVEAS.CAPTION=Save as...
    29 TFORMMAIN.APROJECTSAVEAS.HINT=Save project as
    30 TFORMMAIN.APROJECTCLOSE.CAPTION=Close
    31 TFORMMAIN.APROJECTCLOSE.HINT=Close project
    3226TFORMMAIN.ACLIPBOARDCOPY.CAPTION=Copy
    3327TFORMMAIN.ACLIPBOARDCOPY.HINT=Copy to clipboard
  • trunk/StudioPackage/Forms/UFormMain.pas

    r10 r11  
    4343    ASelectAll: TAction;
    4444    AClipboardCut: TAction;
    45     AProjectOpenRecent: TAction;
    46     AProjectSaveAs: TAction;
    47     AProjectSave: TAction;
    48     AProjectClose: TAction;
    49     AProjectOpen: TAction;
    50     AProjectNew: TAction;
    5145    ActionListMain: TActionList;
    5246    ImageListMain: TImageList;
    5347    MainMenu: TMainMenu;
    54     MenuItem1: TMenuItem;
    55     MenuItem10: TMenuItem;
    56     MenuItem11: TMenuItem;
    57     MenuItem12: TMenuItem;
    58     MenuItem13: TMenuItem;
    59     MenuItem14: TMenuItem;
    6048    MenuItem15: TMenuItem;
    6149    MenuItem16: TMenuItem;
     
    7462    MenuItem28: TMenuItem;
    7563    MenuItem29: TMenuItem;
    76     MenuItem3: TMenuItem;
    7764    MenuItem30: TMenuItem;
    7865    MenuItem31: TMenuItem;
     
    9885    MenuItem6: TMenuItem;
    9986    MenuItem7: TMenuItem;
    100     MenuItem8: TMenuItem;
    101     MenuItem9: TMenuItem;
    10287    OpenDialogFile: TOpenDialog;
    10388    PageControlRight: TPageControl;
     
    122107    procedure AFileOpenExecute(Sender: TObject);
    123108    procedure AViewModulesExecute(Sender: TObject);
    124     procedure AViewProjectManagerExecute(Sender: TObject);
    125109    procedure AViewSettingsExecute(Sender: TObject);
    126110    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     
    142126
    143127uses
    144   UFormProject, UFormSourceCode, UFormSettings, UFormModuleList;
     128  UFormSourceCode, UFormSettings, UFormModuleList;
    145129
    146130{ TFormMain }
     
    168152  FormModuleList.ModuleManager := DataModule1.ModuleManager;
    169153  FormModuleList.Show;
    170 end;
    171 
    172 procedure TFormMain.AViewProjectManagerExecute(Sender: TObject);
    173 begin
    174   FormProject.Show;
    175154end;
    176155
     
    201180procedure TFormMain.DockInit;
    202181begin
    203   FormProject.ManualDock(TabSheetProject, nil, alClient);
     182{  FormProject.ManualDock(TabSheetProject, nil, alClient);
    204183  FormProject.Align := alClient;
    205184  FormProject.Show;
    206 end;
     185}end;
    207186
    208187procedure TFormMain.OpenFileExecute(OpenedFile: TOpenedFile);
  • trunk/StudioPackage/Forms/UFormModuleList.pas

    r9 r11  
    6464  if (Item.Index >= 0) and (Item.Index < FModuleManager.Modules.Count) then
    6565  with TModule(FModuleManager.Modules[Item.Index]) do begin
    66     Item.Caption := Name;
     66    Item.Caption := Identification;
    6767    Item.Data := FModuleManager.Modules[Item.Index];
    6868    Item.SubItems.Add(Title);
  • trunk/StudioPackage/Forms/UFormSourceCode.pas

    r4 r11  
    11unit UFormSourceCode;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    9   SynEdit, SynHighlighterPas, UProject;
     9  SynEdit, SynHighlighterPas;
    1010
    1111type
     
    1818    procedure SynEditSourceChange(Sender: TObject);
    1919  private
     20    FFileName: string;
    2021    FOnChange: TNotifyEvent;
    21     FProjectFile: TProjectFile;
    22     procedure SetProjectFile(const AValue: TProjectFile);
     22    procedure SetFileName(AValue: string);
    2323  public
    24     property ProjectFile: TProjectFile read FProjectFile write SetProjectFile;
     24    property FileName: string read FFileName write SetFileName;
    2525    procedure Save;
    2626    procedure UpdateInterface;
     
    4747end;
    4848
    49 procedure TFormSourceCode.SetProjectFile(const AValue: TProjectFile);
     49procedure TFormSourceCode.SetFileName(AValue: string);
    5050begin
    51   if FProjectFile = AValue then Exit;
    52   FProjectFile := AValue;
    53   if Assigned(AValue) then
    54     SynEditSource.Lines.Assign(FProjectFile.Source)
     51  if FFileName = AValue then Exit;
     52  FFileName := AValue;
     53  if FileExistsUTF8(FFileName) then
     54    SynEditSource.Lines.LoadFromFile(FFileName)
    5555    else SynEditSource.ClearAll;
    5656end;
     
    5858procedure TFormSourceCode.Save;
    5959begin
    60   if Assigned(ProjectFile) then
    61     ProjectFile.Source.Assign(SynEditSource.Lines);
     60{  if Assigned(ProjectFile) then
     61    ProjectFile.Source.Assign(SynEditSource.Lines);}
    6262end;
    6363
    6464procedure TFormSourceCode.UpdateInterface;
    6565begin
    66   SynEditSource.Enabled := Assigned(DataModule1.Project);
    67   if not Assigned(DataModule1.Project) then SynEditSource.ClearAll;
     66//  SynEditSource.Enabled := Assigned(DataModule1.Project);
     67//  if not Assigned(DataModule1.Project) then SynEditSource.ClearAll;
    6868end;
    6969
  • trunk/StudioPackage/LibreDevelopStudio.lpk

    r9 r11  
    2323      </Other>
    2424    </CompilerOptions>
    25     <Files Count="7">
     25    <Files Count="5">
    2626      <Item1>
    2727        <Filename Value="Forms\UFormMain.pas"/>
     
    2929      </Item1>
    3030      <Item2>
    31         <Filename Value="UProject.pas"/>
    32         <UnitName Value="UProject"/>
     31        <Filename Value="UDataModule.pas"/>
     32        <UnitName Value="UDataModule"/>
    3333      </Item2>
    3434      <Item3>
    35         <Filename Value="UDataModule.pas"/>
    36         <UnitName Value="UDataModule"/>
     35        <Filename Value="Forms\UFormSourceCode.pas"/>
     36        <UnitName Value="UFormSourceCode"/>
    3737      </Item3>
    3838      <Item4>
    39         <Filename Value="Forms\UFormProject.pas"/>
    40         <UnitName Value="UFormProject"/>
     39        <Filename Value="Forms\UFormSettings.pas"/>
     40        <UnitName Value="UFormSettings"/>
    4141      </Item4>
    4242      <Item5>
    43         <Filename Value="Forms\UFormSourceCode.pas"/>
    44         <UnitName Value="UFormSourceCode"/>
    45       </Item5>
    46       <Item6>
    47         <Filename Value="Forms\UFormSettings.pas"/>
    48         <UnitName Value="UFormSettings"/>
    49       </Item6>
    50       <Item7>
    5143        <Filename Value="Forms\UFormModuleList.pas"/>
    5244        <UnitName Value="UFormModuleList"/>
    53       </Item7>
     45      </Item5>
    5446    </Files>
    5547    <i18n>
  • trunk/StudioPackage/LibreDevelopStudio.pas

    r9 r11  
    88
    99uses
    10   UFormMain, UProject, UDataModule, UFormProject, UFormSourceCode,
    11   UFormSettings, UFormModuleList, LazarusPackageIntf;
     10  UFormMain, UDataModule, UFormSourceCode, UFormSettings, UFormModuleList,
     11  LazarusPackageIntf;
    1212
    1313implementation
  • trunk/StudioPackage/UDataModule.pas

    r10 r11  
    66
    77uses
    8   Classes, SysUtils, FileUtil, UProject, Forms, SpecializedList, USource,
     8  Classes, SysUtils, FileUtil, Forms, SpecializedList, USource,
    99  UModularSystem, ULDStudioAPI;
    1010
     
    4747  public
    4848    ModuleManager: TModuleManager;
    49     Project: TProject;
    5049    FileTypes: TFileTypes;
    5150    OpenedFiles: TOpenedFiles;
     
    6160
    6261uses
    63   UFormSourceCode, UFormMain, UFormProject, UFormSettings, UFormModuleList;
     62  UFormSourceCode, UFormMain, UFormSettings, UFormModuleList;
    6463
    6564procedure TOpenedFile.SetFileName(AValue: string);
     
    111110  Application.UpdateMainForm(FormMain);
    112111  OpenedFiles.OnOpenFile := FormMain.OpenFileExecute;
    113   FormProject := TFormProject.Create(nil);
    114112  FormSourceCode := TFormSourceCode.Create(nil);
    115113  FormSettings := TFormSettings.Create(nil);
     
    127125  FreeAndNil(API);
    128126  FreeAndNil(FormMain);
    129   FreeAndNil(FormProject);
    130127  FreeAndNil(FormSourceCode);
    131128  FreeAndNil(FormSettings);
Note: See TracChangeset for help on using the changeset viewer.