Changeset 77 for branches/Transpascal/Forms/UMainForm.pas
- Timestamp:
- Oct 22, 2010, 9:22:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Transpascal/Forms/UMainForm.pas
r76 r77 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 9 Dialogs, StdCtrls, UCompiler, UProducerAsm8051, Registry, 10 UProducer C, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView,10 UProducerDynamicC, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView, 11 11 UProducerPascal, Contnrs, UProject, FileUtil, Menus, ActnList, UCoolDocking, 12 12 UCompiledForm, UCodeTreeForm, URegistry, ULastOpenedList, UApplicationInfo, … … 84 84 85 85 procedure TMainForm.ButtonCompileClick(Sender: TObject); 86 var 87 I: Integer; 88 begin 89 if ComboBoxTargetSelection.ItemIndex = 0 then begin 90 Compiler.Producer.Free; 91 Compiler.Producer := TProducerPascal.Create; 92 end else 93 if ComboBoxTargetSelection.ItemIndex = 1 then begin 94 Compiler.Producer.Free; 95 Compiler.Producer := TProducerC.Create; 96 end else 97 if ComboBoxTargetSelection.ItemIndex = 2 then begin 98 Compiler.Producer.Free; 99 Compiler.Producer := TProducerAsm8051.Create; 100 end else 101 if ComboBoxTargetSelection.ItemIndex = 3 then begin 102 Compiler.Producer.Free; 103 Compiler.Producer := TProducerTreeView.Create; 104 end; 105 86 begin 106 87 // Compile project file 88 Compiler.ProducerType := TProducerType(ComboBoxTargetSelection.ItemIndex); 107 89 Compiler.Init; 108 90 Compiler.Parser.OnGetSource := GetSource; … … 173 155 OpenKey(RegistryKey, True); 174 156 ReopenLastOpenedFile := ReadBoolWithDefault('ReopenLastOpenedFile', True); 157 ComboBoxTargetSelection.ItemIndex := 158 ReadIntegerWithDefault('ProducerType', 0); 175 159 finally 176 160 Free; … … 186 170 OpenKey(RegistryKey, True); 187 171 WriteBool('ReopenLastOpenedFile', ReopenLastOpenedFile); 172 WriteInteger('ProducerType', ComboBoxTargetSelection.ItemIndex); 188 173 finally 189 174 Free; … … 209 194 210 195 procedure TMainForm.FormCreate(Sender: TObject); 196 var 197 ProducerType: TProducerType; 211 198 begin 212 199 DebugLog.FileName := 'DebugLog.txt'; … … 218 205 LastOpenedFiles.MenuItem := MenuItemOpenRecent; 219 206 LastOpenedFiles.ClickAction := OpenRecentClick; 207 208 ComboBoxTargetSelection.Clear; 209 for ProducerType := Low(ProducerType) to High(ProducerType) do 210 ComboBoxTargetSelection.AddItem(ProducerTypeName[ProducerType], nil); 220 211 end; 221 212
Note:
See TracChangeset
for help on using the changeset viewer.