Ignore:
Timestamp:
Jun 25, 2012, 1:17:58 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r41 r44  
    173173    procedure UpdateToolBarHints;
    174174    procedure DockInit;
     175    procedure LastOpenedListChange(Sender: TObject);
    175176  public
    176177    Modified: Boolean;
     
    213214begin
    214215  PageControlMain.TabIndex := 0;
    215   if OpenProjectOnStart and (LastOpenedList.Count > 0) then
    216     ProjectOpen(LastOpenedList[0])
     216  if OpenProjectOnStart and (LastOpenedList.Items.Count > 0) then
     217    ProjectOpen(LastOpenedList.Items[0])
    217218    else AProjectNew.Execute;
    218219  UpdateInterface;
     
    333334  PageControlRight.Width := MainForm.Width div 2;
    334335  PageControlBottom.Height := MainForm.Height div 5;
     336end;
     337
     338procedure TMainForm.LastOpenedListChange(Sender: TObject);
     339begin
     340  LastOpenedList.LoadToMenuItem(MenuItemOpenRecent);
    335341end;
    336342
     
    438444  Targets.Add(TTargetJava.Create);
    439445  UpdateTargetList;
    440   LastOpenedList := TLastOpenedList.Create;
    441   LastOpenedList.MenuItem := MenuItemOpenRecent;
     446  LastOpenedList := TLastOpenedList.Create(nil);
     447  LastOpenedList.OnChange := LastOpenedListChange;
    442448  LastOpenedList.ClickAction := AProjectOpenRecentExecute;
    443449  LoadFromRegistry(RegistryRoot, ApplicationInfo.RegistryKey);
     
    681687procedure TMainForm.AProjectOpenRecentExecute(Sender: TObject);
    682688begin
    683   ProjectOpen(LastOpenedList[TMenuItem(Sender).MenuIndex]);
     689  ProjectOpen(LastOpenedList.Items[TMenuItem(Sender).MenuIndex]);
    684690end;
    685691
     
    698704    MemoSource.Lines.SaveToFile(UTF8Decode(SaveDialog1.FileName));
    699705    ProjectFileName := SaveDialog1.FileName;
    700     LastOpenedList.Add(SaveDialog1.FileName);
     706    LastOpenedList.AddItem(SaveDialog1.FileName);
    701707    Modified := False;
    702708    UpdateInterface;
Note: See TracChangeset for help on using the changeset viewer.