- Timestamp:
- Feb 12, 2012, 8:05:28 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/LazFuckIDE.cs.po
r20 r21 152 152 #: tmainform.ashrinksource.caption 153 153 msgid "Shrink source" 154 msgstr " "154 msgstr "Srazit kód" 155 155 156 156 #: tmainform.aviewcompiled.caption … … 198 198 msgstr "Program" 199 199 200 #: tmainform.menuitemopenrecent.caption 201 msgid "Open recent" 202 msgstr "" 203 200 204 #: tmainform.menuitemtarget.caption 201 205 msgctxt "tmainform.menuitemtarget.caption" … … 220 224 msgstr "Volby" 221 225 226 #: toptionsform.checkbox1.caption 227 msgid "Reopend last opened project" 228 msgstr "" 229 222 230 #: toptionsform.label1.caption 223 231 msgid "Memory size:" -
trunk/Languages/LazFuckIDE.po
r20 r21 189 189 msgstr "" 190 190 191 #: tmainform.menuitemopenrecent.caption 192 msgid "Open recent" 193 msgstr "" 194 191 195 #: tmainform.menuitemtarget.caption 192 196 msgctxt "TMAINFORM.MENUITEMTARGET.CAPTION" … … 211 215 msgstr "" 212 216 217 #: toptionsform.checkbox1.caption 218 msgid "Reopend last opened project" 219 msgstr "" 220 213 221 #: toptionsform.label1.caption 214 222 msgid "Memory size:" -
trunk/LazFuckIDE.lpi
r19 r21 85 85 </Item5> 86 86 </RequiredPackages> 87 <Units Count="1 0">87 <Units Count="12"> 88 88 <Unit0> 89 89 <Filename Value="LazFuckIDE.lpr"/> … … 144 144 <UnitName Value="UCompilerPHP"/> 145 145 </Unit9> 146 <Unit10> 147 <Filename Value="Common\ULastOpenedList.pas"/> 148 <IsPartOfProject Value="True"/> 149 <UnitName Value="ULastOpenedList"/> 150 </Unit10> 151 <Unit11> 152 <Filename Value="Common\URegistry.pas"/> 153 <IsPartOfProject Value="True"/> 154 <UnitName Value="URegistry"/> 155 </Unit11> 146 156 </Units> 147 157 </ProjectOptions> … … 154 164 <SearchPaths> 155 165 <IncludeFiles Value="$(ProjOutDir)"/> 156 <OtherUnitFiles Value="Compiler "/>166 <OtherUnitFiles Value="Compiler;Common"/> 157 167 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 158 168 </SearchPaths> -
trunk/LazFuckIDE.lpr
r19 r21 10 10 Interfaces, // this includes the LCL widgetset 11 11 Forms, UMainForm, UBrainFuck, UInterpreterForm, UApplicationInfo, 12 UCompiledForm, UOptionsForm, CoolTranslator, Common, TemplateGenerics,13 UCompiler, UCompilerDelphi, UCompilerPHP12 UCompiledForm, UOptionsForm, ULastOpenedList, URegistry, CoolTranslator, 13 Common, TemplateGenerics, UCompiler, UCompilerDelphi, UCompilerPHP 14 14 { you can add units after this }; 15 15 -
trunk/UMainForm.lfm
r20 r21 208 208 0000000000000000000000000000000000000000000000000000 209 209 } 210 end 211 object MenuItemOpenRecent: TMenuItem 212 Caption = 'Open recent' 210 213 end 211 214 object MenuItem3: TMenuItem -
trunk/UMainForm.lrt
r20 r21 2 2 TMAINFORM.TOOLBUTTON5.CAPTION=ToolButton5 3 3 TMAINFORM.MENUITEM1.CAPTION=Project 4 TMAINFORM.MENUITEMOPENRECENT.CAPTION=Open recent 4 5 TMAINFORM.MENUITEM5.CAPTION=- 5 6 TMAINFORM.MENUITEM9.CAPTION=Program -
trunk/UMainForm.pas
r20 r21 8 8 Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs, 9 9 Menus, ActnList, StdCtrls, ComCtrls, UBrainFuck, UCoolTranslator, StrUtils, 10 SpecializedList, UCompiler; 10 SpecializedList, UCompiler, Registry, URegistry, ULastOpenedList; 11 12 const 13 RegistryRoot = HKEY_CURRENT_USER; 11 14 12 15 type … … 62 65 MenuItem26: TMenuItem; 63 66 MenuItem27: TMenuItem; 67 MenuItemOpenRecent: TMenuItem; 64 68 MenuItemTarget: TMenuItem; 65 69 MenuItem3: TMenuItem; … … 116 120 Shift: TShiftState; X, Y: Integer); 117 121 private 122 procedure AProjectOpenRecentExecute(Sender: TObject); 118 123 procedure BrainFuckInterpreterChangeState(Sender: TObject); 119 124 procedure MenuItemTargetClick(Sender: TObject); 125 procedure ProjectOpen(FileName: string); 120 126 public 121 127 Modified: Boolean; … … 126 132 BreakPoints: TListInteger; 127 133 Compilers: TListObject; // TListObject<TCompiler> 134 LastOpenedList: TLastOpenedList; 135 OpenProjectOnStart: Boolean; 136 procedure LoadFromRegistry(Root: HKEY; Key: string); 137 procedure SaveToRegistry(Root: HKEY; Key: string); 128 138 procedure UpdateInterface; 129 139 procedure UpdateStatusBar; … … 146 156 procedure TMainForm.FormShow(Sender: TObject); 147 157 begin 148 AProjectNew.Execute; 158 if OpenProjectOnStart and (LastOpenedList.Count > 0) then 159 ProjectOpen(LastOpenedList[0]) 160 else AProjectNew.Execute; 149 161 end; 150 162 … … 190 202 for I := 0 to Parent.Count - 1 do 191 203 if Parent.Items[I].MenuIndex <> MenuIndex then Parent.Items[I].Checked := False 204 end; 205 end; 206 207 procedure TMainForm.ProjectOpen(FileName: string); 208 begin 209 MemoSource.Lines.LoadFromFile(UTF8Decode(FileName)); 210 LastOpenedList.AddItem(FileName); 211 ProjectFileName := FileName; 212 UpdateInterface; 213 Modified := False; 214 end; 215 216 procedure TMainForm.LoadFromRegistry(Root: HKEY; Key: string); 217 begin 218 with TRegistryEx.Create do 219 try 220 RootKey := Root; 221 OpenKey(Key, True); 222 OpenProjectOnStart := ReadBoolWithDefault('OpenProjectOnStart', True); 223 finally 224 Free; 225 end; 226 LastOpenedList.LoadFromRegistry(Root, Key); 227 end; 228 229 procedure TMainForm.SaveToRegistry(Root: HKEY; Key: string); 230 begin 231 LastOpenedList.SaveToRegistry(Root, Key); 232 with TRegistryEx.Create do 233 try 234 RootKey := Root; 235 OpenKey(Key, True); 236 WriteBool('OpenProjectOnStart', OpenProjectOnStart); 237 finally 238 Free; 192 239 end; 193 240 end; … … 242 289 Compilers.Add(TBrainFuckCompilerPHP.Create); 243 290 UpdateTergetList; 291 LastOpenedList := TLastOpenedList.Create; 292 LastOpenedList.MenuItem := MenuItemOpenRecent; 293 LastOpenedList.ClickAction := AProjectOpenRecentExecute; 294 LoadFromRegistry(RegistryRoot, ApplicationInfo.RegistryKey); 244 295 end; 245 296 246 297 procedure TMainForm.FormDestroy(Sender: TObject); 247 298 begin 299 SaveToRegistry(RegistryRoot, ApplicationInfo.RegistryKey); 300 LastOpenedList.Free; 248 301 Compilers.Free; 249 302 BrainFuckCompiler.Free; … … 377 430 end; 378 431 432 procedure TMainForm.AProjectOpenRecentExecute(Sender: TObject); 433 begin 434 ProjectOpen(LastOpenedList[TMenuItem(Sender).MenuIndex]); 435 end; 436 379 437 procedure TMainForm.AProjectOpenExecute(Sender: TObject); 380 438 begin 381 439 OpenDialog1.FileName := ProjectFileName; 382 440 if OpenDialog1.Execute then begin 383 MemoSource.Lines.LoadFromFile(UTF8Decode(OpenDialog1.FileName)); 384 ProjectFileName := OpenDialog1.FileName; 385 UpdateInterface; 386 Modified := False; 441 ProjectOpen(OpenDialog1.FileName); 387 442 end; 388 443 end; -
trunk/UOptionsForm.lfm
r15 r21 79 79 TabOrder = 4 80 80 end 81 object CheckBox1: TCheckBox 82 Left = 8 83 Height = 19 84 Top = 120 85 Width = 205 86 Caption = 'Reopend last opened project' 87 TabOrder = 5 88 end 81 89 end -
trunk/UOptionsForm.lrt
r15 r21 5 5 TOPTIONSFORM.LABEL2.CAPTION=Cell size: 6 6 TOPTIONSFORM.LABEL3.CAPTION=Interface language: 7 TOPTIONSFORM.CHECKBOX1.CAPTION=Reopend last opened project -
trunk/UOptionsForm.pas
r15 r21 16 16 ButtonOk: TButton; 17 17 ButtonCancel: TButton; 18 CheckBox1: TCheckBox; 18 19 ComboBoxLanguage: TComboBox; 19 20 Label1: TLabel; … … 48 49 ComboBoxLanguage.ItemIndex := MainForm.CoolTranslator1.Languages.IndexOf(MainForm.CoolTranslator1.Language); 49 50 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 51 CheckBox1.Checked := MainForm.OpenProjectOnStart; 50 52 end; 51 53 … … 54 56 if ComboBoxLanguage.ItemIndex <> -1 then 55 57 MainForm.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 58 MainForm.OpenProjectOnStart := CheckBox1.Checked; 56 59 end; 57 60
Note:
See TracChangeset
for help on using the changeset viewer.