Changeset 55 for trunk


Ignore:
Timestamp:
Jul 13, 2012, 1:49:52 PM (12 years ago)
Author:
chronos
Message:
  • Updated: Common package now contain TApplicationInfo class which contain various application info.
Location:
trunk
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Forms/UFormAbout.pas

    r45 r55  
    3131implementation
    3232
     33uses
     34  UCore;
     35
    3336resourcestring
    3437  SApplicationName = 'Application name';
     
    4245procedure TFormAbout.FormShow(Sender: TObject);
    4346begin
    44   with Memo1, Lines, ApplicationInfo do begin
     47  with Memo1, Lines, Core.ApplicationInfo do begin
    4548    BeginUpdate;
    4649    Clear;
  • trunk/IDE/Forms/UFormMain.pas

    r54 r55  
    77uses
    88  SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
    9   UCompiler, Registry, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas,
     9  Registry, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas,
    1010  UProject, FileUtil, Menus, ActnList,
    11   UCoolTranslator, UFormTargetCode, UFormCodeTree, URegistry, ULastOpenedList, UApplicationInfo,
    12   UDebugLog;
    13 
    14 const
    15   RegistryRootKey = HKEY_CURRENT_USER;
     11  UFormTargetCode, UFormCodeTree, URegistry, UApplicationInfo;
    1612
    1713type
     
    164160uses
    165161  UCore, UFormMessages, UFormSourceCode, UFormProject, UCommon, UFormAbout, UFormOptions,
    166   UFormTargets, UTarget, UAnalyzer, UProducer, UExecutor, UFormProjectNew,
    167   UProjectTemplates, UFormTargetProject;
    168 
    169 resourcestring
    170   SNewProject = 'New project';
     162  UFormTargets, UTarget, UExecutor, UFormProjectNew,
     163  UFormTargetProject;
    171164
    172165{ TFormMain }
     
    441434  Title: string;
    442435begin
    443   Title := ApplicationInfo.Name;
     436  Title := Core.ApplicationInfo.AppName;
    444437  if Assigned(Core.Project) then begin
    445438    if Core.Project.FileName <> '' then Title := Core.Project.FileName + ' - ' + Title;
     
    452445begin
    453446  AProjectClose.Execute;
    454   Core.SaveToRegistry(RegistryRootKey, ApplicationInfo.RegistryKey);
     447  Core.SaveToRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
    455448end;
    456449
    457450procedure TFormMain.FormCreate(Sender: TObject);
    458 var
    459   I: Integer;
    460451begin
    461452end;
     
    472463
    473464procedure TFormMain.FormShow(Sender: TObject);
    474 var
    475   NewProjectFile: TProjectFile;
    476 begin
    477   Core.LoadFromRegistry(RegistryRootKey, ApplicationInfo.RegistryKey);
     465begin
     466  Core.LoadFromRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
    478467  DockInit;
    479468  Core.ProjectTemplatesInit;
     
    517506procedure TFormMain.AHomepageExecute(Sender: TObject);
    518507begin
    519   OpenWebPage(ApplicationInfo.HomePage);
     508  OpenWebPage(Core.ApplicationInfo.HomePage);
    520509end;
    521510
     
    526515
    527516procedure TFormMain.AProjectNewExecute(Sender: TObject);
    528 var
    529   NewFile: TProjectFile;
    530517begin
    531518  if FormProjectNew.ShowModal = mrOk then begin
  • trunk/IDE/Forms/UFormProject.lfm

    r45 r55  
    77  ClientHeight = 253
    88  ClientWidth = 331
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.1'
    1010  object TreeViewProject: TTreeView
    1111    Left = 0
     
    1414    Width = 331
    1515    Align = alClient
     16    DefaultItemHeight = 16
     17    PopupMenu = PopupMenuFile
    1618    ReadOnly = True
    1719    TabOrder = 0
     
    1921    Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
    2022  end
     23  object PopupMenuFile: TPopupMenu
     24    Images = FormMain.ImageList1
     25    left = 94
     26    top = 38
     27    object MenuItem4: TMenuItem
     28      Action = AShow
     29    end
     30    object MenuItem1: TMenuItem
     31      Action = AAdd
     32    end
     33    object MenuItem2: TMenuItem
     34      Action = ADelete
     35    end
     36    object MenuItem3: TMenuItem
     37      Action = ARename
     38    end
     39  end
     40  object ActionList1: TActionList
     41    left = 184
     42    top = 40
     43    object AAdd: TAction
     44      Caption = 'Add'
     45      OnExecute = AAddExecute
     46    end
     47    object ADelete: TAction
     48      Caption = 'Delete'
     49    end
     50    object ARename: TAction
     51      Caption = 'Rename'
     52    end
     53    object AShow: TAction
     54      Caption = 'Show'
     55    end
     56  end
     57  object OpenDialog1: TOpenDialog
     58    left = 94
     59    top = 98
     60  end
    2161end
  • trunk/IDE/Forms/UFormProject.lrt

    r45 r55  
    11TFORMPROJECT.CAPTION=Project manager
     2TFORMPROJECT.AADD.CAPTION=Add
     3TFORMPROJECT.ADELETE.CAPTION=Delete
     4TFORMPROJECT.ARENAME.CAPTION=Rename
     5TFORMPROJECT.ASHOW.CAPTION=Show
  • trunk/IDE/Forms/UFormProject.pas

    r54 r55  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   UProject;
     7  Menus, ActnList, UProject;
    88
    99type
     
    1212
    1313  TFormProject = class(TForm)
     14    AAdd: TAction;
     15    AShow: TAction;
     16    ARename: TAction;
     17    ADelete: TAction;
     18    ActionList1: TActionList;
     19    MenuItem1: TMenuItem;
     20    MenuItem2: TMenuItem;
     21    MenuItem3: TMenuItem;
     22    MenuItem4: TMenuItem;
     23    OpenDialog1: TOpenDialog;
     24    PopupMenuFile: TPopupMenu;
    1425    TreeViewProject: TTreeView;
     26    procedure AAddExecute(Sender: TObject);
    1527    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
    1628  private
     
    6779end;
    6880
     81procedure TFormProject.AAddExecute(Sender: TObject);
     82begin
     83  if Sender is TMenuItem then
     84  with TMenuItem(Sender) do begin
     85    if OpenDialog1.Execute then begin
     86
     87      UpdateProjectTree;
     88    end;
     89  end;
     90end;
     91
    6992procedure TFormProject.UpdateProjectTree;
    7093var
    7194  NewNode: TTreeNode;
    7295begin
    73   with Core, TreeViewProject, Items do begin
     96  with Core, TreeViewProject, Items do
     97  try
    7498    BeginUpdate;
    7599    Clear;
    76100    if Assigned(Project) then begin
    77       NewNode := AddChild(nil, ExtractFileNameOnly(Project.FileName));
     101      NewNode := AddChildObject(nil, ExtractFileNameOnly(Project.FileName), Project);
    78102      UpdateProjectFiles(NewNode, Project.Files);
    79103      NewNode.Expand(True);
    80104    end;
    81     EndUpdate;
    82105    if Assigned(TreeViewProject.TopItem) and
    83106      (TreeViewProject.TopItem.Count > 0) then
    84107      TreeViewProject.TopItem.Items[0].Selected := True
    85108      else FormSourceCode.ProjectFile := nil;
     109  finally
     110    EndUpdate;
    86111  end;
    87112end;
     
    113138      end;
    114139    end;
    115     NewNode := TreeViewProject.Items.AddChild(SelNode, FileName);
    116     NewNode.Data := Pointer(Files[I]);
     140    NewNode := TreeViewProject.Items.AddChildObject(SelNode, FileName, Pointer(Files[I]));
    117141  end;
    118142end;
  • trunk/IDE/Languages/Transpascal.cs.po

    r49 r55  
    55"POT-Creation-Date: \n"
    66"PO-Revision-Date: \n"
    7 "Last-Translator: Chronos <robie@centrum.cz>\n"
     7"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
    88"Language-Team: \n"
    99"MIME-Version: 1.0\n"
     
    402402msgstr "Cesta vykonání"
    403403
     404#: tformproject.aadd.caption
     405msgid "Add"
     406msgstr "Přidat"
     407
     408#: tformproject.adelete.caption
     409msgid "Delete"
     410msgstr "Smazat"
     411
     412#: tformproject.arename.caption
     413msgid "Rename"
     414msgstr "Přejmenovat"
     415
     416#: tformproject.ashow.caption
     417msgid "Show"
     418msgstr "Ukázat"
     419
    404420#: tformproject.caption
    405421msgctxt "tformproject.caption"
  • trunk/IDE/Languages/Transpascal.po

    r50 r55  
    393393msgstr ""
    394394
     395#: tformproject.aadd.caption
     396msgid "Add"
     397msgstr ""
     398
     399#: tformproject.adelete.caption
     400msgid "Delete"
     401msgstr ""
     402
     403#: tformproject.arename.caption
     404msgid "Rename"
     405msgstr ""
     406
     407#: tformproject.ashow.caption
     408msgid "Show"
     409msgstr ""
     410
    395411#: tformproject.caption
    396412msgctxt "TFORMPROJECT.CAPTION"
  • trunk/IDE/Transpascal.lpi

    r53 r55  
    106106      </Item7>
    107107    </RequiredPackages>
    108     <Units Count="18">
     108    <Units Count="17">
    109109      <Unit0>
    110110        <Filename Value="Transpascal.lpr"/>
     
    134134        <IsPartOfProject Value="True"/>
    135135        <ComponentName Value="FormProject"/>
     136        <HasResources Value="True"/>
    136137        <ResourceBaseClass Value="Form"/>
    137138        <UnitName Value="UFormProject"/>
     
    168169      </Unit8>
    169170      <Unit9>
    170         <Filename Value="UApplicationInfo.pas"/>
    171         <IsPartOfProject Value="True"/>
    172         <UnitName Value="UApplicationInfo"/>
     171        <Filename Value="Forms\UFormAbout.pas"/>
     172        <IsPartOfProject Value="True"/>
     173        <ComponentName Value="FormAbout"/>
     174        <HasResources Value="True"/>
     175        <ResourceBaseClass Value="Form"/>
     176        <UnitName Value="UFormAbout"/>
    173177      </Unit9>
    174178      <Unit10>
    175         <Filename Value="Forms\UFormAbout.pas"/>
    176         <IsPartOfProject Value="True"/>
    177         <ComponentName Value="FormAbout"/>
    178         <HasResources Value="True"/>
    179         <ResourceBaseClass Value="Form"/>
    180         <UnitName Value="UFormAbout"/>
     179        <Filename Value="Forms\UFormOptions.pas"/>
     180        <IsPartOfProject Value="True"/>
     181        <ComponentName Value="FormOptions"/>
     182        <ResourceBaseClass Value="Form"/>
     183        <UnitName Value="UFormOptions"/>
    181184      </Unit10>
    182185      <Unit11>
    183         <Filename Value="Forms\UFormOptions.pas"/>
    184         <IsPartOfProject Value="True"/>
    185         <ComponentName Value="FormOptions"/>
    186         <ResourceBaseClass Value="Form"/>
    187         <UnitName Value="UFormOptions"/>
     186        <Filename Value="Forms\UFormTargets.pas"/>
     187        <IsPartOfProject Value="True"/>
     188        <ComponentName Value="FormTargets"/>
     189        <HasResources Value="True"/>
     190        <ResourceBaseClass Value="Form"/>
     191        <UnitName Value="UFormTargets"/>
    188192      </Unit11>
    189193      <Unit12>
    190         <Filename Value="Forms\UFormTargets.pas"/>
    191         <IsPartOfProject Value="True"/>
    192         <ComponentName Value="FormTargets"/>
    193         <HasResources Value="True"/>
    194         <ResourceBaseClass Value="Form"/>
    195         <UnitName Value="UFormTargets"/>
     194        <Filename Value="Forms\UFormCompilerSettings.pas"/>
     195        <IsPartOfProject Value="True"/>
     196        <ComponentName Value="FormCompilerSettings"/>
     197        <ResourceBaseClass Value="Form"/>
     198        <UnitName Value="UFormCompilerSettings"/>
    196199      </Unit12>
    197200      <Unit13>
    198         <Filename Value="Forms\UFormCompilerSettings.pas"/>
    199         <IsPartOfProject Value="True"/>
    200         <ComponentName Value="FormCompilerSettings"/>
    201         <ResourceBaseClass Value="Form"/>
    202         <UnitName Value="UFormCompilerSettings"/>
     201        <Filename Value="Forms\UFormProjectNew.pas"/>
     202        <IsPartOfProject Value="True"/>
     203        <ComponentName Value="FormProjectNew"/>
     204        <ResourceBaseClass Value="Form"/>
     205        <UnitName Value="UFormProjectNew"/>
    203206      </Unit13>
    204207      <Unit14>
    205         <Filename Value="Forms\UFormProjectNew.pas"/>
    206         <IsPartOfProject Value="True"/>
    207         <ComponentName Value="FormProjectNew"/>
    208         <ResourceBaseClass Value="Form"/>
    209         <UnitName Value="UFormProjectNew"/>
     208        <Filename Value="UProjectTemplates.pas"/>
     209        <IsPartOfProject Value="True"/>
     210        <UnitName Value="UProjectTemplates"/>
    210211      </Unit14>
    211212      <Unit15>
    212         <Filename Value="UProjectTemplates.pas"/>
    213         <IsPartOfProject Value="True"/>
    214         <UnitName Value="UProjectTemplates"/>
     213        <Filename Value="Forms\UFormTargetProject.pas"/>
     214        <IsPartOfProject Value="True"/>
     215        <ComponentName Value="FormTargetProject"/>
     216        <HasResources Value="True"/>
     217        <ResourceBaseClass Value="Form"/>
     218        <UnitName Value="UFormTargetProject"/>
    215219      </Unit15>
    216220      <Unit16>
    217         <Filename Value="Forms\UFormTargetProject.pas"/>
    218         <IsPartOfProject Value="True"/>
    219         <ComponentName Value="FormTargetProject"/>
    220         <HasResources Value="True"/>
    221         <ResourceBaseClass Value="Form"/>
    222         <UnitName Value="UFormTargetProject"/>
    223       </Unit16>
    224       <Unit17>
    225221        <Filename Value="UCore.pas"/>
    226222        <IsPartOfProject Value="True"/>
     
    229225        <ResourceBaseClass Value="DataModule"/>
    230226        <UnitName Value="UCore"/>
    231       </Unit17>
     227      </Unit16>
    232228    </Units>
    233229  </ProjectOptions>
  • trunk/IDE/Transpascal.lpr

    r53 r55  
    99  Forms, Interfaces, SysUtils,
    1010  UFormMain {MainForm},
    11   UTextSource, UProject, UApplicationInfo, TranspascalCompiler, UFormProject,
     11  UTextSource, UProject, TranspascalCompiler, UFormProject,
    1212UFormSourceCode, UFormMessages,
    1313  UFormTargetCode, UFormCodeTree, TemplateGenerics, CoolTranslator, Common,
  • trunk/IDE/UCore.lfm

    r53 r55  
    2525    top = 136
    2626  end
     27  object ApplicationInfo: TApplicationInfo
     28    Identification = 1
     29    VersionMajor = 1
     30    VersionMinor = 0
     31    VersionBugFix = 0
     32    VersionSuffix = 'alfa'
     33    CompanyName = 'Chronosoft'
     34    CompanyHomePage = 'http://svn.zdechov.net/trac/Transpascal'
     35    HomePage = 'http://svn.zdechov.net/trac/Transpascal'
     36    AuthorsName = 'Chronos'
     37    EmailContact = 'robie@centrum.cz'
     38    AppName = 'Transpascal IDE'
     39    ReleaseDate = 41103
     40    RegistryKey = '\Software\Chronosoft\Transpascal'
     41    RegistryRoot = rrKeyCurrentUser
     42    left = 48
     43    top = 195
     44  end
    2745end
  • trunk/IDE/UCore.pas

    r54 r55  
    66
    77uses
    8   Classes, SysUtils, FileUtil, ULastOpenedList, UProject, UCompiler, Registry,
    9   URegistry, UDebugLog, UCoolTranslator, UTarget;
     8  Classes, SysUtils, FileUtil, ULastOpenedList, UProject, UApplicationInfo,
     9  UCompiler, Registry, URegistry, UDebugLog, UCoolTranslator, UTarget;
    1010
    1111type
     
    2020
    2121  TCore = class(TDataModule)
     22    ApplicationInfo: TApplicationInfo;
    2223    CoolTranslator1: TCoolTranslator;
    2324    DebugLog1: TDebugLog;
     
    125126      Free;
    126127    end;
    127   LastOpenedFiles.LoadFromRegistry(RegistryRootKey, Key + '\LastOpenedFiles');
    128   Compiler.LoadFromRegistry(RegistryRootKey, Key + '\Compiler');
     128  LastOpenedFiles.LoadFromRegistry(Root, Key + '\LastOpenedFiles');
     129  Compiler.LoadFromRegistry(Root, Key + '\Compiler');
    129130  FormMain.LoadFromRegistry(Root, Key);
    130131end;
     
    147148      Free;
    148149    end;
    149   LastOpenedFiles.SaveToRegistry(RegistryRootKey, Key + '\LastOpenedFiles');
    150   Compiler.SaveToRegistry(RegistryRootKey, Key + '\Compiler');
     150  LastOpenedFiles.SaveToRegistry(Root, Key + '\LastOpenedFiles');
     151  Compiler.SaveToRegistry(Root, Key + '\Compiler');
    151152  FormMain.SaveToRegistry(Root, Key);
    152153end;
Note: See TracChangeset for help on using the changeset viewer.