5 import "DirectoriesBox"
6 import "CompilersDetectionDialog"
9 FileDialog settingsFileDialog { type = selectDir, text = "Select directory" };
11 FileDialog toolchainFileDialog { type = open, text = "Open"; mayNotExist = true; };
13 class GlobalSettingsDialog : Window
17 background = activeBorder;
19 borderStyle = sizable;
20 text = "Global Settings";
21 minClientSize = { 560, 420 };
22 nativeDecorations = true;
24 IDESettings ideSettings;
25 IDESettingsContainer settingsContainer;
26 String workspaceActiveCompiler;
28 TabControl tabControl { this, background = activeBorder, anchor = { left = 8, top = 8, right = 8, bottom = 40 } };
30 EditorTab editorTab { this, tabControl = tabControl };
31 CompilersTab compilersTab { this, tabControl = tabControl };
32 ProjectOptionsTab projectOptionsTab { this, tabControl = tabControl };
33 WorkspaceOptionsTab workspaceOptionsTab { this, tabControl = tabControl };
35 property bool settingsModified
39 return editorTab.modifiedDocument || compilersTab.modifiedDocument ||
40 projectOptionsTab.modifiedDocument || workspaceOptionsTab.modifiedDocument;
46 parent = this, hotKey = escape, text = "Cancel", id = DialogResult::cancel;
47 position = { 290, 290 }, size = { 80 };
48 anchor = { right = 8, bottom = 8 };
50 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
52 if(!settingsModified || MessageBox {
53 type = okCancel, master = ide,
54 text = "Lose Changes?",
55 contents = "Are you sure you wish to discard changes?"
64 parent = this, isDefault = true, text = "OK";
65 position = { 200, 290 }, size = { 90 };
66 anchor = { right = 96, bottom = 8 };
68 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
72 bool editorSettingsChanged = false;
73 bool compilerSettingsChanged = false;
74 bool projectOptionsChanged = false;
75 bool workspaceOptionsChanged = false;
77 if(editorTab.modifiedDocument)
79 if(editorTab.useFreeCaret.checked != ideSettings.useFreeCaret ||
80 editorTab.showLineNumbers.checked != ideSettings.showLineNumbers ||
81 editorTab.caretFollowsScrolling.checked != ideSettings.caretFollowsScrolling)
83 ideSettings.useFreeCaret = editorTab.useFreeCaret.checked;
84 ideSettings.showLineNumbers = editorTab.showLineNumbers.checked;
85 ideSettings.caretFollowsScrolling = editorTab.caretFollowsScrolling.checked;
86 editorSettingsChanged = true;
90 if(compilersTab.modifiedDocument)
92 ideSettings.compilerConfigs.Free();
93 for(compiler : compilersTab.compilerConfigs)
94 ideSettings.compilerConfigs.Add(compiler.Copy());
95 compilerSettingsChanged = true;
98 if(projectOptionsTab.modifiedDocument)
100 if(strcmp(projectOptionsTab.defaultTargetDir.path, ideSettings.projectDefaultTargetDir)
101 || strcmp(projectOptionsTab.defaultIntermediateObjDir.path, ideSettings.projectDefaultIntermediateObjDir))
103 ideSettings.projectDefaultTargetDir = projectOptionsTab.defaultTargetDir.path;
104 ideSettings.projectDefaultIntermediateObjDir = projectOptionsTab.defaultIntermediateObjDir.path;
105 projectOptionsChanged = true;
109 if(workspaceOptionsTab.modifiedDocument)
111 DataRow row = workspaceOptionsTab.defaultCompilerDropBox.currentRow;
112 if(row && row.string)
114 if(!ideSettings.defaultCompiler || strcmp(row.string, ideSettings.defaultCompiler))
116 ideSettings.defaultCompiler = row.string;
117 workspaceOptionsChanged = true;
122 settingsContainer.Save();
124 if(compilerSettingsChanged)
125 OnGlobalSettingChange(GlobalSettingsChange::compilerSettings);
126 if(editorSettingsChanged)
127 OnGlobalSettingChange(GlobalSettingsChange::editorSettings);
128 if(projectOptionsChanged)
129 OnGlobalSettingChange(GlobalSettingsChange::projectOptions);
132 Destroy(DialogResult::ok);
141 for(c = 0; c < DirTypes::enumSize; c++)
143 CompilerDir compilerDir;
145 for(systemDir : ideSettings.systemDirs[c])
147 compilerDir = CompilerDir { type = c; compilerConfig = null; path = CopyString(systemDir) };
148 dirs.Add(compilerDir);
151 row = compilersTab.dirs[c].AddRow();
152 row.SetData(null, "");
153 compilersTab.dirs[c].currentRow = compilersTab.dirs[c].firstRow;
154 compilersTab.dirs[c].modifiedDocument = false;
161 CompilerConfig activateCompiler = null;
162 CompilerConfig readonlyCompiler = null;
165 editorTab.useFreeCaret.checked = ideSettings.useFreeCaret;
166 editorTab.showLineNumbers.checked = ideSettings.showLineNumbers;
167 editorTab.caretFollowsScrolling.checked = ideSettings.caretFollowsScrolling;
170 if(workspaceActiveCompiler)
172 for(compiler : ideSettings.compilerConfigs)
174 if(!activateCompiler && !strcmp(workspaceActiveCompiler, compiler.name))
175 activateCompiler = compiler;
176 if(!readonlyCompiler && compiler.readOnly)
177 readonlyCompiler = compiler;
178 if(activateCompiler && readonlyCompiler)
182 if(!activateCompiler && readonlyCompiler)
183 activateCompiler = readonlyCompiler;
184 if(!activateCompiler && ideSettings.compilerConfigs.count)
185 activateCompiler = ideSettings.compilerConfigs[0];
187 for(compiler : ideSettings.compilerConfigs)
188 compilersTab.AddCompiler(compiler.Copy(), compiler == activateCompiler);
191 projectOptionsTab.defaultTargetDir.path = ideSettings.projectDefaultTargetDir;
192 projectOptionsTab.defaultIntermediateObjDir.path = ideSettings.projectDefaultIntermediateObjDir;
199 editorTab.modifiedDocument = false;
200 compilersTab.modifiedDocument = false;
201 compilersTab.dirsTab.modifiedDocument = false;
202 compilersTab.toolchainTab.modifiedDocument = false;
203 compilersTab.optionsTab.modifiedDocument = false;
204 compilersTab.activeCompiler = null;
205 compilersTab.compilerConfigs.Free();
206 compilersTab.compilerSelector.Clear();
207 projectOptionsTab.modifiedDocument = false;
208 workspaceOptionsTab.modifiedDocument = false;
211 virtual void OnGlobalSettingChange(GlobalSettingsChange globalSettingsChange);
214 class EditorTab : GlobalSettingsSubTab
216 background = activeBorder;
221 this, text = "Move code editor caret freely past end of line", position = { 16, 68 }, isCheckbox = true;
222 NotifyClicked = NotifyClickedModifiedDocument;
225 Button caretFollowsScrolling
227 this, text = "Keep caret visible (move along) when scrolling", position = { 16, 88 }, isCheckbox = true;
228 NotifyClicked = NotifyClickedModifiedDocument;
231 Button showLineNumbers
233 this, text = "Show line numbers in code editor", position = { 16, 108 }, isCheckbox = true;
234 NotifyClicked = NotifyClickedModifiedDocument;
237 bool NotifyClickedModifiedDocument(Button button, int x, int y, Modifiers mods)
239 modifiedDocument = true;
244 static void DrawStipple(Surface surface, Size clientSize)
248 int x2 = clientSize.w - 1;
249 int y2 = clientSize.h - 1;
250 if((x2 - x1) & 1) x2--;
251 if((y2 - y1) & 1) y2--;
253 surface.LineStipple(0x5555);
254 surface.Rectangle(x1, y1, x2, y2);
255 surface.LineStipple(0);
258 class CompilersTab : GlobalSettingsSubTab
260 background = activeBorder;
263 SelectorBar compilerSelector
265 this, text = "Compiler Configurations:", anchor = { left = 148, top = 8, right = 99 }; size = { 0, 26 };
267 direction = horizontal, scrollable = true;
269 bool OnKeyDown(Key key, unichar ch)
273 ((CompilersTab)parent).createCompiler.NotifyClicked(parent, ((CompilersTab)parent).createCompiler, 0, 0, 0);
278 ((CompilersTab)parent).deleteCompiler.NotifyClicked(parent, ((CompilersTab)parent).deleteCompiler, 0, 0, 0);
281 return SelectorBar::OnKeyDown(key, ch);
284 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
286 ((CompilersTab)master).labelCompilers.Update(null);
292 SelectorBar::OnPostCreate();
293 if(((CompilersTab)parent).selectedButton)
295 ((CompilersTab)parent).selectedButton.Activate();
296 ((CompilersTab)parent).selectedButton.checked = true;
297 ((CompilersTab)parent).selectedButton = null;
303 TabControl tabControl { this, background = activeBorder, anchor = { left = 8, top = 38, right = 8, bottom = 8 } };
305 CompilerDirectoriesTab dirsTab { this, tabControl = tabControl };
306 CompilerToolchainTab toolchainTab { this, tabControl = tabControl };
307 CompilerEnvironmentTab environmentTab { this, tabControl = tabControl };
308 CompilerOptionsTab optionsTab { this, tabControl = tabControl };
310 List<CompilerConfig> compilerConfigs { };
311 CompilerConfig activeCompiler;
315 this, anchor = { left = 8, top = 14 }, labeledWindow = compilerSelector;
317 void OnRedraw(Surface surface)
319 Label::OnRedraw(surface);
320 if(labeledWindow.active)
321 DrawStipple(surface, clientSize);
325 void FindUniqueCompilerName(char * baseName, CompilerConfig compiler/*, bool startWithNumber*/, char * output)
328 char tmp[MAX_F_STRING];
329 /*if(startWithNumber)
330 sprintf(tmp, "%s%d", baseName, num);
332 strcpy(tmp, baseName);
335 CompilerConfig matchingCompiler = null;
336 for(c : compilerConfigs)
337 { // TOFIX: Error when omitting these brackets, c not found
338 if((!compiler || c != compiler) && c.name && !strcmp(c.name, tmp))
340 matchingCompiler = c;
347 sprintf(tmp, "%s%d", baseName, num);
355 Button createCompiler
357 parent = this, bevelOver = true, inactive = true;
359 anchor = { top = 10, right = 77 };
360 hotKey = altC, bitmap = BitmapResource { fileName = ":actions/docNew.png", alphaBlend = true };
362 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
364 char compilerName[MAX_F_STRING];
365 CompilerConfig newCompiler;
366 FindUniqueCompilerName("New Compiler", null, compilerName);
367 newCompiler = MakeDefaultCompiler(compilerName, false);
368 AddCompiler(newCompiler, true);
369 modifiedDocument = true;
373 Button detectCompiler
375 parent = this, bevelOver = true, inactive = true;
377 anchor = { top = 10, right = 54 };
378 hotKey = altC, bitmap = BitmapResource { fileName = ":actions/attach.png", alphaBlend = true };
380 bool NotifyClicked(Button b, int x, int y, Modifiers mods)
382 CompilersDetectionDialog compilersDetectionDialog
387 if(compilersDetectionDialog.Modal())
389 if(compilersDetectionDialog.selectedCompilerType)
391 char uniqueName[MAX_F_STRING];
392 CompilerConfig newCompiler = compilersDetectionDialog.compilerConfig;
393 FindUniqueCompilerName(newCompiler.name, null, uniqueName);
394 newCompiler.name = uniqueName;
395 AddCompiler(newCompiler, true);
396 modifiedDocument = true;
402 Button duplicateCompiler
404 parent = this, bevelOver = true, inactive = true;
406 anchor = { top = 10, right = 31 };
407 hotKey = altU, bitmap = BitmapResource { fileName = ":actions/editCopy.png", alphaBlend = true };
409 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
411 char copyName[MAX_F_STRING];
412 CompilerConfig copyCompiler = activeCompiler.Copy();
413 FindUniqueCompilerName(copyCompiler.name, null, copyName);
414 copyCompiler.readOnly = false;
415 copyCompiler.name = copyName;
416 AddCompiler(copyCompiler, true);
417 modifiedDocument = true;
421 Button deleteCompiler
423 parent = this, bevelOver = true, inactive = true;
425 anchor = { top = 10, right = 8 };
426 hotKey = altD, bitmap = BitmapResource { fileName = ":actions/delete2.png", alphaBlend = true };
428 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
432 CompilerConfig compilerToDelete = activeCompiler;
433 String title = PrintString("Delete ", compilerToDelete.name, " Compiler Configuration");
434 String msg = PrintString("Are you sure you wish to delete the ", compilerToDelete.name, " compiler configuration?");
435 if(MessageBox { type = okCancel, text = title, contents = msg }.Modal() == ok)
437 SelectorButton button = compilerSelector.FindButtonByID((int)compilerToDelete);
439 compilerSelector.RemoveButton(button);
440 //DeleteCompiler(compilerToDelete);
442 Iterator<CompilerConfig> it { compilerConfigs };
443 if(it.Find(compilerToDelete))
444 compilerConfigs.Delete(it.pointer);
446 modifiedDocument = true;
455 void AddCompiler(CompilerConfig compiler, bool load)
457 SelectorButton selectButton;
458 if(compiler.readOnly)
460 SelectorButton button
462 compilerSelector, master = this, text = compiler.name, id = (int)compiler;
463 NotifyClicked = CompilerClicked;
465 selectButton = button;
469 EditableSelectorButton button
471 compilerSelector, master = this, renameable = true, text = compiler.name, id = (int)compiler;
472 NotifyClicked = CompilerClicked;
474 bool OnRename(EditableSelectorButton button, char ** oldName, char ** newName)
476 if(*newName && (*newName)[0])
478 char compilerName[MAX_F_STRING];
479 FindUniqueCompilerName(*newName, activeCompiler, compilerName);
480 if(strcmp(*newName, compilerName))
483 *newName = CopyString(compilerName);
485 activeCompiler.name = compilerName;
486 modifiedDocument = true;
492 selectButton = (SelectorButton)button;
494 compilerConfigs.Add(compiler);
497 LoadCompiler(compiler);
498 selectedButton = selectButton;
499 compilerSelector.Select(selectedButton);
502 SelectorButton selectedButton;
504 void LoadCompiler(CompilerConfig compiler)
506 activeCompiler = compiler;
510 environmentTab.Load();
513 deleteCompiler.disabled = compiler.readOnly;
516 bool CompilerClicked(Button clickedButton, int x, int y, Modifiers mods)
518 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
519 LoadCompiler((CompilerConfig)clickedButton.id);
524 class CompilerDirectoriesTab : CompilersSubTab
526 background = activeBorder;
527 text = "Directories";
529 Button dirTypeTglBtn[DirTypes];
530 DirectoriesBox dirs[DirTypes], currentDirs;
532 ~CompilerDirectoriesTab()
535 for(c = 0; c < DirTypes::enumSize; c++)
538 delete dirTypeTglBtn[c];
541 CompilerDirectoriesTab()
544 for(c = 0; c < DirTypes::enumSize; c++)
546 dirs[c] = DirectoriesBox
548 this;//, alwaysHighLight = true
549 anchor = { left = 8, top = 8, right = 8, bottom = 8 };
552 /* MAKE SURE THINGS ARE DONE PROPERLY IN THE NEW DIRECTORIES BOX WHEN BROWSING FOR A DIR?
553 settingsFileDialog.filePath = directory;
554 if(settingsFileDialog.Modal())
555 row.SetData(null, (s = CopyUnixPath(settingsFileDialog.filePath)));
558 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
560 // DirectoriesBox's NotifyModified isn't working! Or it's not called before this?
561 if(!active && (modifiedDocument || list.modifiedDocument))
563 CompilerDirectoriesTab dirsTab = (CompilerDirectoriesTab)parent;
564 CompilerConfig compiler = dirsTab.loadedCompiler;
567 DirTypes dirType = (DirTypes)id;
568 // TODO ? I think not, see DirectoriesBox.ec: CopyUnixPath() must be called when copying these dirs
570 if(dirType == includes)
571 compiler.includeDirs = strings;
572 else if(dirType == libraries)
573 compiler.libraryDirs = strings;
574 else if(dirType == executables)
575 compiler.executableDirs = strings;
577 //modifiedDocument = true;
578 dirsTab.compilersTab.modifiedDocument = true;
587 dirs[c].visible = false;
589 // (width) Should be 324 for text...
590 //field[c] = { dataType = class(char *), editable = true };
591 //dirs[c].AddField(field[c]);
594 int v = (int)c * 100 + 8;
595 dirTypeTglBtn[c] = Button
597 this, inactive = true, text = settingsDirectoryNames[c], bevelOver = true, isRadio = true, bitmap = null;
601 anchor = { left = v, top = 8 }; // ((int)c) * 100 + 8
603 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
605 DirTypes dirType = (DirTypes)button.id;
606 currentDirs.visible = false;
607 dirs[dirType].visible = true;
608 currentDirs = dirs[dirType];
612 incref dirTypeTglBtn[c];
615 dirTypeTglBtn[c].hotKey = altI;
616 else if(c == libraries)
617 dirTypeTglBtn[c].hotKey = altL;
618 else if(c == executables)
619 dirTypeTglBtn[c].hotKey = altE;
622 currentDirs = dirs[includes];
623 dirTypeTglBtn[includes].checked = true;
631 CompilerConfig compiler = loadedCompiler;
632 dirs[includes].strings = compiler.includeDirs;
633 dirs[libraries].strings = compiler.libraryDirs;
634 dirs[executables].strings = compiler.executableDirs;
639 class CompilerToolchainTab : CompilersSubTab
641 background = activeBorder;
644 Label ecpLabel { this, position = { 8, 12 }, labeledWindow = ecp, tabCycle = false, inactive = true };
647 this, anchor = { left = 120, top = 8, right = 8 };
648 text = "eC Precompiler", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
650 Label eccLabel { this, position = { 8, 38 }, labeledWindow = ecc, tabCycle = false, inactive = true };
653 this, anchor = { left = 120, top = 34, right = 8 };
654 text = "eC Compiler", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
656 Label ecsLabel { this, position = { 8, 64 }, labeledWindow = ecs, tabCycle = false, inactive = true };
659 this, anchor = { left = 120, top = 60, right = 8 };
660 text = "eC Symbol Loader", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
662 Label earLabel { this, position = { 8, 90 }, labeledWindow = ear, tabCycle = false, inactive = true };
665 this, anchor = { left = 120, top = 86, right = 8 };
666 text = "Ecere Archiver", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
668 Label cppLabel { this, position = { 8, 116 }, labeledWindow = cpp, tabCycle = false, inactive = true };
671 this, anchor = { left = 120, top = 112, right = 8 };
672 text = "C Preprocessor", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
674 Label ccLabel { this, position = { 8, 142 }, labeledWindow = cc, tabCycle = false, inactive = true };
677 this, anchor = { left = 120, top = 138, right = 8 };
678 text = "C Compiler", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
680 Label makeLabel { this, position = { 8, 168 }, labeledWindow = make, tabCycle = false, inactive = true };
683 this, anchor = { left = 120, top = 164, right = 8 };
684 text = "GNU Make", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
686 Label execPrefixLabel { this, position = { 8, 194 }, labeledWindow = execPrefix, tabCycle = false, inactive = true };
689 this, anchor = { left = 120, top = 190, right = 8 };
690 text = "Execution Prefix", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
693 bool NotifyModifiedDocument(PathBox pathBox)
697 CompilerConfig compiler = loadedCompiler;
699 compiler.ecpCommand = pathBox.slashPath;
700 else if(pathBox == ecc)
701 compiler.eccCommand = pathBox.slashPath;
702 else if(pathBox == ecs)
703 compiler.ecsCommand = pathBox.slashPath;
704 else if(pathBox == ear)
705 compiler.earCommand = pathBox.slashPath;
706 else if(pathBox == cpp)
707 compiler.cppCommand = pathBox.slashPath;
708 else if(pathBox == cc)
709 compiler.ccCommand = pathBox.slashPath;
710 else if(pathBox == make)
711 compiler.makeCommand = pathBox.slashPath;
712 else if(pathBox == execPrefix)
713 compiler.execPrefixCommand = pathBox.slashPath;
714 modifiedDocument = true;
715 compilersTab.modifiedDocument = true;
724 CompilerConfig compiler = loadedCompiler;
725 bool disabled = compiler.readOnly;
726 bool isVC = compiler.type.isVC;
727 ecp.path = compiler.ecpCommand;
728 ecc.path = compiler.eccCommand;
729 ecs.path = compiler.ecsCommand;
730 ear.path = compiler.earCommand;
731 cpp.path = compiler.cppCommand;
732 cc.path = compiler.ccCommand;
733 make.path = compiler.makeCommand;
734 execPrefix.path = compiler.execPrefixCommand;
736 ecpLabel.disabled = ecp.disabled = disabled;
737 eccLabel.disabled = ecc.disabled = disabled;
738 ecsLabel.disabled = ecs.disabled = disabled;
739 earLabel.disabled = ear.disabled = disabled;
740 cppLabel.disabled = cpp.disabled = isVC || disabled;
741 ccLabel.disabled = cc.disabled = isVC || disabled;
742 makeLabel.disabled = make.disabled = disabled;
743 execPrefixLabel.disabled = execPrefix.disabled = disabled;
745 modifiedDocument = false;
749 class CompilerEnvironmentTab : CompilersSubTab
751 background = activeBorder;
752 text = "Environment";
754 Label labelEnvVars { envVars, labeledWindow = envVars, position = { 0, 6 }; };
755 NamedStringsBox envVars
757 this, size = { 290, 22 }, anchor = { left = 8, top = 8, right = 8, bottom = 8 };
758 text = "Environment Variables", hotKey = altE; //, option = OPTION(postbuildCommands);
760 bool NotifyModified(NamedStringsBox stringsBox)
762 loadedCompiler.environmentVars = stringsBox.namedStrings;
763 modifiedDocument = true;
768 CompilerEnvironmentTab()
776 CompilerConfig compiler = loadedCompiler;
777 envVars.namedStrings = compiler.environmentVars;
779 // Was these meant to be false?
780 modifiedDocument = false;//true;
781 compilersTab.modifiedDocument = false;//true;
786 class CompilerOptionsTab : CompilersSubTab
788 background = activeBorder;
791 Label labelTargetPlatform { this, position = { 8, 12 }, labeledWindow = targetPlatform }; // TOCHECK: nameless instances dissapear when selecting tabs?
792 DropBox targetPlatform
794 this, position = { 110, 8 }, size = { 160 };
795 text = "Target Platform", hotKey = altT;
796 bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
798 CompilerConfig compiler = loadedCompiler;
801 compiler.targetPlatform = (Platform)row.tag;
802 modifiedDocument = true;
803 compilersTab.modifiedDocument = true;
810 Label numJobsLabel { this, position = { 8, 40 }, labeledWindow = numJobsBox };
813 this, text = "Number of parallel build jobs", hotKey = altJ, borderStyle = deep;
814 position = { 184, 36 }, size = { 80, 20 }, type = class(int), data = &numJobs;
816 bool OnKeyDown(Key key, unichar ch)
818 if((SmartKey)key == enter)
820 DataBox::OnKeyDown(key, ch);
824 return DataBox::OnKeyDown(key, ch);
827 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
837 bool NotifyChanged(bool closingDropDown)
839 CompilerConfig compiler = loadedCompiler;
842 compiler.numJobs = numJobs;
843 modifiedDocument = true;
844 compilersTab.modifiedDocument = true;
852 this, text = "Use ccache", hotKey = altC, position = { 8, 68 };
855 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
857 CompilerConfig compiler = loadedCompiler;
860 compiler.ccacheEnabled = button.checked;
861 modifiedDocument = true;
862 compilersTab.modifiedDocument = true;
870 this, text = "Use distcc", hotKey = altD, position = { 8, 96 };
873 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
875 CompilerConfig compiler = loadedCompiler;
878 distccHosts.disabled = !button.checked;
879 compiler.distccEnabled = button.checked;
880 modifiedDocument = true;
881 compilersTab.modifiedDocument = true;
887 Label distccHostsLabel { this, position = { 8, 124 }, labeledWindow = distccHosts };
890 this, text = "distcc hosts", hotKey = altH;
891 position = { 88, 120 }, size = { 300 };
893 bool NotifyModified(EditBox editBox)
897 CompilerConfig compiler = loadedCompiler;
898 compiler.distccHosts = editBox.contents;
899 modifiedDocument = true;
900 compilersTab.modifiedDocument = true;
910 for(p = (Platform)1; p < Platform::enumSize; p++)
912 row = targetPlatform.AddRow();
922 CompilerConfig compiler = loadedCompiler;
923 bool disabled = compiler.readOnly;
924 targetPlatform.currentRow = targetPlatform.FindRow(compiler.targetPlatform);
925 numJobs = compiler.numJobs;
926 numJobsBox.Refresh();
927 ccacheEnabled.checked = compiler.ccacheEnabled;
928 distccEnabled.checked = compiler.distccEnabled;
929 distccHosts.disabled = !compiler.distccEnabled;
930 distccHosts.contents = compiler.distccHosts;
932 labelTargetPlatform.disabled = disabled;
933 targetPlatform.disabled = disabled;
936 modifiedDocument = false;
940 class CompilersSubTab : Tab
942 property CompilersTab compilersTab
946 CompilersTab tab = (CompilersTab)master;
947 while(tab && tab._class != class(CompilersTab))
948 tab = (CompilersTab)tab.master;
953 property CompilerConfig loadedCompiler
957 CompilersTab tab = compilersTab;
958 return tab ? tab.activeCompiler : null;
963 class ProjectOptionsTab : GlobalSettingsSubTab
965 background = activeBorder;
968 Label defaultTargetDirLabel { this, position = { 8, 34 }, labeledWindow = defaultTargetDir };
969 PathBox defaultTargetDir
971 this, size = { 160, 21 }, position = { 8, 52 }, anchor = { left = 8, top = 52, right = 8 };
972 text = "Default Target Directory", hotKey = altT;
974 bool NotifyModified(PathBox editBox)
976 modifiedDocument = true;
981 Label defaultIntermediateObjDirLabel { this, position = { 8, 78 }, labeledWindow = defaultIntermediateObjDir };
982 PathBox defaultIntermediateObjDir
984 this, size = { 160, 21 }, position = { 8, 96 }, anchor = { left = 8, top = 96, right = 8 };
985 text = "Default Intermediate Objects Directory", hotKey = altI;
987 bool NotifyModified(PathBox editBox)
989 modifiedDocument = true;
995 // COMPILER TOFIX: if class GlobalSettingsSubTab is after class WorkspaceOptionsTab the OnPostCreate
996 // of WorkspaceOptionsTab will *not* be called!
997 class GlobalSettingsSubTab : Tab
999 property GlobalSettingsDialog dialog
1003 GlobalSettingsDialog dialog = (GlobalSettingsDialog)master;
1004 while(dialog && dialog._class != class(GlobalSettingsDialog))
1005 dialog = (GlobalSettingsDialog)dialog.master;
1011 class WorkspaceOptionsTab : GlobalSettingsSubTab
1013 background = activeBorder;
1016 Label defaultCompilerLabel { this, position = { 8, 14 }, labeledWindow = defaultCompilerDropBox };
1017 DropBox defaultCompilerDropBox
1019 this, position = { 140, 8 }, size = { 220 };
1020 text = "Default Compiler", hotKey = altA;
1022 bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
1024 modifiedDocument = true;
1031 GlobalSettingsDialog dialog = this.dialog;
1032 if(dialog && dialog.compilersTab.compilerConfigs && dialog.ideSettings)
1035 for(compiler : dialog.ideSettings.compilerConfigs)
1037 row = defaultCompilerDropBox.AddString(compiler.name);
1038 if(dialog.ideSettings.defaultCompiler && dialog.ideSettings.defaultCompiler[0] &&
1039 !strcmp(compiler.name, dialog.ideSettings.defaultCompiler))
1040 defaultCompilerDropBox.currentRow = row;
1042 if(!defaultCompilerDropBox.currentRow && defaultCompilerDropBox)
1043 defaultCompilerDropBox.currentRow = defaultCompilerDropBox.firstRow;
1050 defaultCompilerDropBox.Clear();
1051 modifiedDocument = false;
1055 //static define app = ((GuiApplication)__thisModule);