2 import "WorkspaceSettings"
3 import "ProjectTabSettings"
5 // import "SelectorBar"
7 static ProjectConfig config;
8 static Platform platform;
9 static ProjectNode currentNode;
10 static Project project;
12 static String MakeString(char * s, int len)
14 String string = new char[len+1];
15 memcpy(string, s, len);
20 class StringListBox : EditBox
22 textHorzScroll = true;
24 property Array<String> strings
34 bool quoted = strchr(item, ' ') != null;
48 Array<String> array { };
50 char * contents = property::contents;
54 for(c = 0; (ch = contents[c]); c++)
56 if(ch == ' ' && !quoted)
59 array.Add(MakeString(contents + start, c - start));
67 array.Add(MakeString(contents + start, c - start));
79 array.Add(MakeString(contents + start, c - start));
85 define dialogTitle = $"Project Settings";
86 static Color unfocusedSelectorColor { 70, 96, 166 };
87 class ProjectSettings : Window
90 background = activeBorder;
91 borderStyle = sizable;
92 minClientSize = { 650, 490 };
97 property Project project
102 projectTab.project = value;
105 buildTab.SelectNode(project.topNode, false);
107 if(project && project.topNode && project.topNode.name && project.topNode.name[0])
110 get { return ::project; }
113 property ProjectNode projectNode
115 set { buildTab.SelectNode(value, false); }
116 get { return currentNode; }
119 void UpdateDialogTitle()
121 //char * s = PrintString("Project Settings - ", project.topNode.fileName);
123 char * projectName = new char[strlen(project.topNode.name) + 1];
124 char * nodeName = currentNode && currentNode != project.topNode ? currentNode.name : "";
125 char * config = buildTab.selectedConfigName;
126 char * platform = buildTab.selectedPlatformName;
127 char * label = new char[strlen(dialogTitle) + 3 + strlen(project.topNode.name) + 3 +
128 strlen(nodeName) + 2 + strlen(config) + 1 + strlen(platform) + 1 + 1];
129 strcpy(label, dialogTitle);
130 strcat(label, " - ");
131 strcpy(projectName, project.topNode.name);
132 StripExtension(projectName);
133 strcat(label, projectName);
134 if(currentNode && currentNode.type != project)
136 strcat(label, " - ");
137 strcat(label, nodeName);
139 if(strlen(config) || strlen(platform))
143 strcat(label, config);
144 if(strlen(config) && strlen(platform))
147 strcat(label, platform);
160 TabControl prjTabControl
162 this, background = activeBorder, anchor = { left = 8, top = 4, right = 8, bottom = 38 };
164 ProjectTab projectTab { this, tabControl = prjTabControl };
165 BuildTab buildTab { this, tabControl = prjTabControl };
166 WorkspaceTab workspaceTab { this, tabControl = prjTabControl };
170 this, size = { 80, 22 };
171 anchor = { right = 8, bottom = 8 };
172 text = $"Cancel", hotKey = escape, id = DialogResult::cancel;
174 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
176 if(prjTabControl.curTab.modifiedDocument)
178 DialogResult diagRes = MessageBox
180 type = okCancel, master = ide,
181 text = $"Lose Changes?",
182 contents = $"Are you sure you wish to discard changes made to the build options?"
186 if(prjTabControl.curTab == buildTab)
188 buildTab.RevertChanges();
189 buildTab.modifiedDocument = false;
191 if(prjTabControl.curTab == workspaceTab)
193 workspaceTab.modifiedDocument = false;
195 if(prjTabControl.curTab == projectTab)
197 projectTab.modifiedDocument = false;
199 Destroy(DialogResult::cancel);
203 Destroy(DialogResult::cancel);
209 this, size = { 80, 22 };
210 anchor = { right = 96, bottom = 8 };
211 text = $"OK", isDefault = true;
213 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
215 if(prjTabControl.curTab == buildTab && buildTab.modifiedDocument)
217 buildTab.modifiedDocument = false;
219 project.topNode.modified = true;
220 project.MarkChanges(buildTab.backupNode);
221 ide.projectView.modifiedDocument = true;
222 ide.projectView.Update(null);
224 if(prjTabControl.curTab == workspaceTab && workspaceTab.modifiedDocument)
226 workspaceTab.SaveChanges();
227 workspaceTab.modifiedDocument = false;
229 if(prjTabControl.curTab == projectTab && projectTab.modifiedDocument)
231 projectTab.SaveChanges();
232 projectTab.modifiedDocument = false;
234 Destroy(DialogResult::ok);
242 prjTabControl.curTab = buildTab;
247 #define OPTION(x) ((uint)(&((ProjectOptions)0).x))
249 // TOFIX: USING T INSTEAD OF Z HERE CAUSED US SOME CONFLICTS WITH T IN Array TEMPLATES
251 class OptionBox<class Z> : CommonControl
253 bool mergeValues, configReplaces;
262 property Window editor
268 editor.OnRightButtonDown = OptionBox_OnRightButtonDown;
269 chainKeyDown = (void *)editor.OnKeyDown;
270 editor.OnKeyDown = OptionBox_OnKeyDown;
274 property bool visible { set { editor.visible = value; } get { return editor.visible; } }
275 property Window parent { set { editor.parent = value; Window::parent = value; master = value; editor.id = (int)this; } }
276 property Point position { set { editor.position = value; } }
277 property Size size { set { editor.size = value; } }
278 property Anchor anchor { set { editor.anchor = value; } }
279 property Key hotKey { set { editor.hotKey = value; } }
280 property char * text { set { editor.text = value; Window::text = value; } }
290 bool NotifySelect(MenuItem selection, Modifiers mods)
292 OptionBox ob = (OptionBox)id;
298 bool Window::OptionBox_OnRightButtonDown(int x, int y, Modifiers mods)
300 OptionBox ob = (OptionBox)id;
301 GuiApplication app = ((GuiApplication)__thisModule.application);
303 PopupMenu { null, this, menu = ob.clearMenu,
304 position = { absPosition.x + clientStart.x + x - app.desktop.position.x, absPosition.y + clientStart.y + y - app.desktop.position.y } }.Create();
308 bool Window::OptionBox_OnKeyDown(Key key, unichar ch)
310 OptionBox ob = (OptionBox)id;
311 if(key == Key { del, ctrl = true } || key == Key { keyPadDelete, ctrl = true })
316 return (((bool(*)(Window, Key, unichar)) ob.chainKeyDown)(this, key, ch);
319 void SetAttribs(int code)
324 for(c = Window::parent.firstChild; c; c = c.next)
326 if(eClass_IsDerived(c._class, class(Label)))
329 if(label.labeledWindow == this)
337 for(c = editor.firstChild; c; c = c.next)
339 if(eClass_IsDerived(c._class, class(Label)))
346 // control.foreground = foreground;
348 if(code == 0 || code == 1)
350 editor.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
351 editor.background = white;
355 Color foreground = 0x0F3F66;
356 int r = foreground.r, g = foreground.g, b = foreground.b;
360 editor.font = { editor.font.faceName, editor.font.size };
362 r = (int)(alpha * r + src.r * (1 - alpha));
363 g = (int)(alpha * g + src.g * (1 - alpha));
364 b = (int)(alpha * b + src.b * (1 - alpha));
366 r = Max(0,Min(255,r));
367 g = Max(0,Min(255,g));
368 b = Max(0,Min(255,b));
370 editor.background = Color { (byte) r, (byte) g, (byte) b };
375 label.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
376 //label.foreground = foreground;
380 virtual void FinalizeLoading();
382 virtual void LoadOption(ProjectOptions options);
383 virtual void RetrieveOption(ProjectOptions options, bool isCfgOrPlt);
384 virtual void UnsetOption(ProjectOptions options)
387 *(Z*)((byte *)options + option) = value;
390 virtual bool OptionSet(ProjectOptions options)
392 // TOFIX: If you get a crash here, it might be because JSON.ec must be after ProjectConfig.ec in the project files
393 // JSON.ec must also be before ProjectSettings.ec in the project files
394 if(*(Z*)((byte *)options + option))
398 // BUG: OptionCheck = OptionSet; // Overrides derived classes OptionCheck ?
400 virtual bool OptionCheck(ProjectOptions options)
402 return OptionSet(options);
405 void MarkBuildTabModified()
407 BuildTab buildTab = (BuildTab)master;
408 while(buildTab && buildTab._class != class(BuildTab))
409 buildTab = (BuildTab)buildTab.master;
410 if(buildTab) buildTab.modifiedDocument = true;
415 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
416 MarkBuildTabModified();
420 ProjectConfig c = null;
421 if(currentNode.configurations)
423 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
428 PlatformOptions p = null;
431 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
434 if(p.options && OptionSet(p.options))
435 UnsetOption(p.options);
436 if(p.options && p.options.isEmpty)
440 Iterator<PlatformOptions> it { c.platforms };
448 if(!c.platforms.count)
454 if(c.options && OptionSet(c.options))
455 UnsetOption(c.options);
456 if(c.options && c.options.isEmpty)
459 // DON'T DELETE PROJECT CONFIGS HERE!
460 if(!c.options && currentNode != project.topNode)
462 Iterator<ProjectConfig> it { currentNode.configurations };
470 if(!currentNode.configurations.count)
471 currentNode.configurations = null;
478 PlatformOptions p = null;
479 if(currentNode.platforms)
481 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
484 if(p.options && OptionSet(p.options))
485 UnsetOption(p.options);
486 if(p.options && p.options.isEmpty)
490 Iterator<PlatformOptions> it { currentNode.platforms };
498 if(!currentNode.platforms.count)
499 currentNode.platforms = null;
505 if(currentNode.options && OptionSet(currentNode.options))
506 UnsetOption(currentNode.options);
507 if(currentNode.options && currentNode.options.isEmpty)
508 delete currentNode.options;
513 void FigureOutInherited()
516 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
517 bool skipped = false;
518 for(node = currentNode; node; node = node.parent)
520 if(config && node.configurations)
522 for(c : node.configurations; !strcmpi(c.name, config.name))
524 if(platform && c.platforms)
526 for(p : c.platforms; !strcmpi(p.name, platformName))
528 if(skipped && p.options && OptionSet(p.options))
529 LoadOption(p.options);
535 if(skipped && c.options && OptionSet(c.options))
537 LoadOption(c.options);
538 if(configReplaces) return;
544 if(platform && node.platforms)
546 for(p : node.platforms; !strcmpi(p.name, platformName))
548 if(skipped && p.options && OptionSet(p.options))
549 LoadOption(p.options);
554 if(skipped && node.options && OptionSet(node.options))
555 LoadOption(node.options);
556 else if(skipped && !node.parent)
564 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
565 MarkBuildTabModified();
568 ProjectConfig c = null;
569 if(!currentNode.configurations) currentNode.configurations = { };
570 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
572 currentNode.configurations.Add(c = ProjectConfig { name = CopyString(config.name) });
575 PlatformOptions p = null;
576 if(!c.platforms) c.platforms = { };
578 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
580 c.platforms.Add(p = PlatformOptions { CopyString(platformName) });
582 if(!p.options) p.options = { };
583 RetrieveOption(p.options, true);
584 if(!mergeValues) SetAttribs(1);
587 if(!c.options) c.options = { };
588 RetrieveOption(c.options, true);
589 if(!mergeValues) SetAttribs(1);
594 PlatformOptions p = null;
595 if(!currentNode.platforms) currentNode.platforms = { };
596 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
598 currentNode.platforms.Add(p = PlatformOptions { CopyString(platformName) });
600 if(!p.options) p.options = { };
601 RetrieveOption(p.options, true);
602 if(!mergeValues) SetAttribs(1);
606 if(!currentNode.options) currentNode.options = { };
607 RetrieveOption(currentNode.options, false);
608 if(!mergeValues) SetAttribs((currentNode.parent || OptionCheck(currentNode.options)) ? 1 : 0);
614 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
615 bool setAttribs = false;
616 for(node = currentNode; node; node = node.parent)
618 ProjectConfig nodeConfig = null;
619 if(config && node.configurations)
621 for(c : node.configurations; !strcmpi(c.name, config.name))
623 if(platform && c.platforms)
625 for(p : c.platforms; !strcmpi(p.name, platformName))
627 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
629 LoadOption(p.options);
630 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode) ? 1 : 2); }
631 if(!mergeValues) { FinalizeLoading(); return; }
641 if(platform && node.platforms)
643 for(p : node.platforms; !strcmpi(p.name, platformName))
645 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
647 LoadOption(p.options);
648 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config) ? 1 : 2); }
649 if(!mergeValues) { FinalizeLoading(); return; }
655 if(nodeConfig && nodeConfig.options && ((mergeValues && !configReplaces) ? OptionCheck(nodeConfig.options) : OptionSet(nodeConfig.options)))
657 LoadOption(nodeConfig.options);
658 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !platform) ? 1 : 2); }
659 if(!mergeValues || configReplaces) { FinalizeLoading(); return; }
662 if(node.options && (mergeValues ? OptionCheck(node.options) : OptionSet(node.options)))
664 LoadOption(node.options);
665 if(!node.parent && !OptionCheck(node.options))
667 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
671 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config && !platform) ? 1 : 2); }
673 if(!mergeValues) { FinalizeLoading(); return; }
675 else if(!node.parent)
678 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
679 if(!mergeValues) { FinalizeLoading(); return; }
686 class StringOptionBox : OptionBox<String>
690 bool NotifyModified(EditBox editBox)
692 ((OptionBox)editBox.id).Retrieve();
696 textHorzScroll = true;
699 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
701 String * string = (String*)((byte *)options + option);
702 if(*string) delete *string;
703 *string = CopyString(((EditBox)editor).contents);
706 void LoadOption(ProjectOptions options)
708 ((EditBox)editor).contents = options ? *(String*)((byte *)options + option) : "";
709 ((EditBox)editor).Deselect();
712 bool OptionCheck(ProjectOptions options)
714 String string = *(String*)((byte *)options + option);
715 return string && string[0];
718 void UnsetOption(ProjectOptions options)
720 delete *(String*)((byte *)options + option);
724 class PathOptionBox : OptionBox<String>
726 bool Window::EditBoxORB(int x, int y, Modifiers mods)
728 Window parent = this.parent;
729 x += clientStart.x + position.x;
730 y += clientStart.y + position.y;
731 return ((OptionBox)this).OptionBox_OnRightButtonDown(parent, x, y, mods);
736 typeExpected = directory, browseDialog = { };
737 editBox.OnRightButtonDown = (void *)EditBoxORB;
739 bool NotifyModified(PathBox pathBox)
741 ((OptionBox)pathBox.id).Retrieve();
746 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
748 String * string = (String*)((byte *)options + option);
749 String slashPath = ((PathBox)editor).slashPath;
750 if(*string) delete *string;
751 *string = CopyString(slashPath);//(slashPath && slashPath[0]) ? CopyString(slashPath) : null;
754 void LoadOption(ProjectOptions options)
756 ((PathBox)editor).path = options ? *(String*)((byte *)options + option) : "";
757 ((PathBox)editor).Deselect();
760 bool OptionCheck(ProjectOptions options)
762 String string = *(String*)((byte *)options + option);
763 return string && string[0];
766 void UnsetOption(ProjectOptions options)
768 delete *(String*)((byte *)options + option);
772 class MultiStringOptionBox : OptionBox<Array<String>>
777 caseSensitive = true;
779 virtual Array<String> GetStrings();
780 virtual void SetStrings(Array<String> value);
782 Array<String> tempStrings;
784 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
786 Array<String> newStrings = GetStrings();
787 Array<String> * strings = (Array<String>*)((byte *)options + option);
788 if(*strings) { strings->Free(); delete *strings; }
792 Iterator<String> it { newStrings };
794 FigureOutInherited();
798 Array<String> ts = tempStrings;
803 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
804 if(found && (!configReplaces || platform)) // ADDED || platform here...
814 *strings = newStrings;
819 void LoadOption(ProjectOptions options)
823 Array<String> strings = options ? *((Array<String>*)((byte *)options + option) : null;
831 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
832 if(!found) tempStrings.Add(s);
838 SetStrings(options ? *(Array<String>*)((byte *)options + option) : null);
842 void FinalizeLoading()
846 SetStrings(tempStrings);
851 bool OptionSet(ProjectOptions options)
853 Array<String> strings = *(Array<String>*)((byte *)options + option);
854 if(mergeValues && !configReplaces)
856 return strings && strings.count;
859 return strings != null;
862 bool OptionCheck(ProjectOptions options)
864 Array<String> strings = *(Array<String>*)((byte *)options + option);
865 return strings && strings.count;
868 void UnsetOption(ProjectOptions options)
870 Array<String> * strings = (Array<String>*)((byte *)options + option);
871 if(*strings) { strings->Free(); delete *strings; }
875 class StringArrayOptionBox : MultiStringOptionBox
877 editor = StringListBox
879 bool NotifyModified(EditBox editBox)
881 ((OptionBox)editBox.id).Retrieve();
886 // NO VIRTUAL PROPERTIES YET...
887 Array<String> GetStrings() { return ((StringListBox)editor).strings; }
888 void SetStrings(Array<String> value) { ((StringListBox)editor).strings = value; }
891 class StringsArrayOptionBox : MultiStringOptionBox
901 bool NotifyModified(StringsBox stringsBox)
903 ((OptionBox)stringsBox.id).Retrieve();
908 Array<String> GetStrings() { return ((StringsBox)editor).strings; }
909 void SetStrings(Array<String> value) { ((StringsBox)editor).strings = value; }
912 class DirsArrayOptionBox : MultiStringOptionBox
914 editor = DirectoriesBox
916 bool NotifyModified(DirectoriesBox dirsBox)
918 ((OptionBox)dirsBox.id).Retrieve();
922 bool OnChangedDir(char * * directory)
924 char fixedDirectory[MAX_LOCATION] = "";
925 if(PathCat(fixedDirectory, *directory))
927 char cwdBackup[MAX_LOCATION];
930 GetWorkingDir(cwdBackup, sizeof(cwdBackup));
931 ChangeWorkingDir(project.topNode.path);
933 FileFixCase(fixedDirectory);
935 ChangeWorkingDir(cwdBackup);
937 *directory = CopyString(fixedDirectory);
943 bool OnPrepareBrowseDir(char * * directory)
945 char dir[MAX_LOCATION];
948 GetSystemPathBuffer(dir, project.topNode.path);
950 PathCat(dir, *directory);
953 strcpy(dir, *directory);
958 *directory = CopyString(dir);
960 // GCC 4.4 bug: ----- path becomes *directory
961 //strcpy(dir, path ? path : "");
965 bool OnBrowsedDir(char * * directory)
969 char path[MAX_LOCATION];
970 MakePathRelative(*directory, project.topNode.path, path);
972 *directory = CopyString(path);
978 Array<String> GetStrings() { return ((DirectoriesBox)editor).strings; }
979 void SetStrings(Array<String> value) { ((DirectoriesBox)editor).strings = value; }
982 class BoolOptionBox : OptionBox<SetBool>
988 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
990 ((OptionBox)button.id).Retrieve();
995 bool OptionCheck(ProjectOptions options)
997 return *(SetBool*)((byte *)options + option) == true;
1000 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1002 bool checked = ((Button)editor).checked;
1003 *(SetBool*)((byte *)options + option) = checked ? true :
1004 ((currentNode.parent || isCfgOrPlt) ? false : unset);
1007 void LoadOption(ProjectOptions options)
1009 ((Button)editor).checked = options && (*(SetBool*)((byte *)options + option) == true);
1013 class DropOptionBox : OptionBox
1017 bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
1019 ((OptionBox)dropBox.id).Retrieve();
1024 void LoadOption(ProjectOptions options)
1026 DropBox dropBox = (DropBox)editor;
1027 Z value = options ? *(Z*)((byte *)options + option) : (Z)0;
1028 dropBox.currentRow = value ? dropBox.FindRow((int)value) : dropBox.firstRow;
1031 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1033 DropBox dropBox = (DropBox)editor;
1034 DataRow row = dropBox.currentRow;
1035 Z value = (Z)(row ? row.tag : 0);
1036 *(Z*)((byte *)options + option) = value;
1040 class TargetTypeDB : DropOptionBox<TargetTypes>
1046 row = ((DropBox)editor).AddRow();
1047 row.tag = TargetTypes::executable;
1048 row.SetData(null, $"Executable");
1050 row = ((DropBox)editor).AddRow();
1051 row.tag = TargetTypes::sharedLibrary;
1052 row.SetData(null, $"Shared Library");
1054 row = ((DropBox)editor).AddRow();
1055 row.tag = TargetTypes::staticLibrary;
1056 row.SetData(null, $"Static Library");
1059 bool OptionCheck(ProjectOptions options)
1061 TargetTypes value = *(TargetTypes*)((byte *)options + option);
1062 return value && value != executable;
1066 class OptimizationDB : DropOptionBox<OptimizationStrategy>
1071 row = ((DropBox)editor).AddRow();
1072 row.tag = OptimizationStrategy::none;
1073 row.SetData(null, $"None");
1075 row = ((DropBox)editor).AddRow();
1076 row.tag = OptimizationStrategy::speed;
1077 row.SetData(null, $"For Speed (-O2)");
1079 row = ((DropBox)editor).AddRow();
1080 row.tag = OptimizationStrategy::size;
1081 row.SetData(null, $"For Size (-Os)");
1084 bool OptionCheck(ProjectOptions options)
1086 OptimizationStrategy value = *(OptimizationStrategy*)((byte *)options + option);
1087 return value && value != none;
1091 class WarningsDB : DropOptionBox<WarningsOption>
1096 row = ((DropBox)editor).AddRow();
1097 row.tag = WarningsOption::normal;
1098 row.SetData(null, $"Normal");
1100 row = ((DropBox)editor).AddRow();
1101 row.tag = WarningsOption::none;
1102 row.SetData(null, $"None");
1104 row = ((DropBox)editor).AddRow();
1105 row.tag = WarningsOption::all;
1106 row.SetData(null, $"All");
1109 bool OptionCheck(ProjectOptions options)
1111 WarningsOption value = *(WarningsOption*)((byte *)options + option);
1112 return value && value != none;
1116 void DrawStipple(Surface surface, Size clientSize)
1120 int x2 = clientSize.w - 1;
1121 int y2 = clientSize.h - 1;
1122 if((x2 - x1) & 1) x2--;
1123 if((y2 - y1) & 1) y2--;
1125 surface.LineStipple(0x5555);
1126 surface.Rectangle(x1, y1, x2, y2);
1127 surface.LineStipple(0);
1130 class BuildTab : Tab
1133 background = activeBorder;
1136 ProjectNode backupNode;
1137 String activeConfigName;
1139 ProjectNode lastSelectedNode;
1141 property char * selectedConfigName
1147 SelectorButton button = (SelectorButton)configSelector.selectedButton;
1148 if(button && button.id)
1150 ProjectConfig config = (ProjectConfig)button.id;
1158 property char * selectedPlatformName
1164 SelectorButton button = (SelectorButton)platformSelector.selectedButton;
1165 if(button && button.id)
1167 Platform platform = (Platform)button.id;
1168 char * platformName = platform ? platform.OnGetString(0,0,0) : null; // all these platformName are leaking, no?
1169 return platformName;
1176 Label labelConfigurations
1178 this, anchor = { left = 8, top = 14 }, labeledWindow = configSelector;
1180 void OnRedraw(Surface surface)
1182 Label::OnRedraw(surface);
1183 if(labeledWindow.active) DrawStipple(surface, clientSize);
1186 SelectorBar configSelector
1188 this, text = $"Configurations: ", anchor = { left = 98, top = 8, right = 54 }; size = { 0, 26 };
1190 direction = horizontal, scrollable = true;
1192 bool OnKeyDown(Key key, unichar ch)
1196 ((BuildTab)parent).createConfig.NotifyClicked(parent, ((BuildTab)parent).createConfig, 0, 0, 0);
1201 ((BuildTab)parent).deleteConfig.NotifyClicked(parent, ((BuildTab)parent).deleteConfig, 0, 0, 0);
1204 return SelectorBar::OnKeyDown(key, ch);
1207 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1209 ((BuildTab)master).labelConfigurations.Update(null);
1216 parent = this, bevelOver = true, inactive = true;
1218 anchor = { top = 10, right = 31 };
1219 hotKey = altC, bitmap = BitmapResource { fileName = ":actions/docNew.png", alphaBlend = true };
1221 bool NotifyClicked(Button b, int x, int y, Modifiers mods)
1223 char tmp[MAX_F_STRING];
1224 ProjectConfig config;
1225 EditableSelectorButton button;
1227 FindUniqueConfigName("NewConfig", false, tmp);
1231 makingModified = true;
1232 compilingModified = true;
1233 linkingModified = true;
1234 name = CopyString(tmp);
1237 // objectsDirectory = /*CopyString(*/defaultObjDirExpression/*)*/;
1240 if(!project.topNode.configurations) project.topNode.configurations = { };
1241 project.topNode.configurations.Add(config);
1243 targetType = project.config.options.targetType;
1245 config.options.targetFileName = project.moduleName;
1246 config.options.targetDir.dir = "";
1247 config.options.objectsDirectory = defaultObjDirExpression);
1248 config.options.debug = true;
1249 config.options.optimization = none;
1250 config.options.warnings = all;
1255 configSelector, renameable = true, master = this, text = config.name, id = (int)config;
1256 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1259 configSelector.Select(button);
1260 modifiedDocument = true;
1264 /*Button duplicateConfig
1266 parent = this, bevelOver = true, inactive = true;
1268 anchor = { top = 10, right = 31 };
1269 hotKey = altU, bitmap = BitmapResource { fileName = ":actions/editCopy.png", alphaBlend = true };
1273 parent = this, bevelOver = true, inactive = true;
1275 anchor = { top = 10, right = 8 };
1276 hotKey = altD, bitmap = BitmapResource { fileName = ":actions/delete2.png", alphaBlend = true };
1278 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1282 String title = PrintString($"Delete ", config.name, $" Configuration");
1283 String msg = PrintString($"Are you sure you wish to delete the ", config.name, $" configuration?");
1284 if(MessageBox { type = okCancel, text = title, contents = msg }.Modal() == ok)
1286 Iterator<Window> it { configSelector.controls };
1287 ProjectConfig configToDelete = config;
1291 SelectorButton button = (SelectorButton)it.data;
1292 if((ProjectConfig)button.id == config)
1294 button.visible = false;
1299 button = (SelectorButton)it.data;
1300 config = (ProjectConfig)button.id;
1301 configSelector.Select(button);
1307 SelectorButton button = configSelector.FindButtonByID((int)configToDelete);
1309 configSelector.RemoveButton(button);
1311 project.topNode.DeleteConfig(configToDelete);
1313 modifiedDocument = true;
1322 Label labelPlatforms
1324 this, anchor = { left = 8, top = 44 }, labeledWindow = platformSelector;
1326 void OnRedraw(Surface surface)
1328 Label::OnRedraw(surface);
1329 if(labeledWindow.active) DrawStipple(surface, clientSize);
1332 SelectorBar platformSelector
1334 this, text = $"Platforms: ", anchor = { left = 64, top = 38, right = 54 }; size = { 0, 26 };
1336 direction = horizontal, scrollable = true;
1338 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1340 ((BuildTab)master).labelPlatforms.Update(null);
1345 TabControl buildTabControl
1347 this, background = activeBorder, anchor = { left = 8, top = 64, right = 8, bottom = 8 };
1348 curTab = compilerTab;
1350 CompilerTab compilerTab { this, tabControl = buildTabControl };
1351 LinkerTab linkerTab { this, tabControl = buildTabControl };
1352 BuilderTab builderTab { this, tabControl = buildTabControl };
1355 this, font = { font.faceName, font.size, italic = true }, stayOnTop = true,
1356 text = $"(Right click or press Ctrl-Del to revert an option to inherited value)", anchor = { top = 72, right = 16 }
1359 void FindUniqueConfigName(char * baseName, bool startWithNumber, char * output)
1362 char tmp[MAX_F_STRING];
1364 sprintf(tmp, "%s%d", baseName, num);
1366 strcpy(tmp, baseName);
1369 ProjectConfig config = null;
1370 for(c : project.topNode.configurations)
1371 { // TOFIX: Error when omitting these brackets, c not found
1372 if(c.name && !strcmp(c.name, tmp))
1381 sprintf(tmp, "%s%d", baseName, num);
1386 strcpy(output, tmp);
1389 bool PlatformClicked(Button clickedButton, int x, int y, Modifiers mods)
1391 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1393 platform = (Platform)clickedButton.id;
1395 // Load Settings Into Dialog
1396 compilerTab.LoadSettings();
1397 linkerTab.LoadSettings();
1398 builderTab.LoadSettings();
1401 buildTabControl.Activate();
1403 if(compilerTab.rightPaneHeader.visible)
1404 compilerTab.rightPaneHeader.Update(null);
1405 ((ProjectSettings)master).UpdateDialogTitle();
1412 platformSelector.DestroyChildren();
1413 configSelector.DestroyChildren();
1415 delete activeConfigName;
1418 bool ConfigOnRename(EditableSelectorButton button, char * * oldName, char * * newName)
1423 for(c = 0; (ch = (*newName)[c]); c++)
1425 if(ch == '_' || isalpha(ch) || (isdigit(ch) && d))
1426 (*newName)[d++] = ch;
1432 for(c : project.topNode.configurations; c != config)
1434 if(!strcmpi(c.name, *newName))
1440 if(found || !(*newName)[0])
1442 char tmp[MAX_F_STRING];
1443 char * tmpName = config.name;
1445 FindUniqueConfigName("NewConfig", false, tmp);
1446 config.name = tmpName;
1448 *newName = CopyString(tmp);
1452 if(activeConfigName && !strcmp(activeConfigName, *oldName))
1454 delete activeConfigName;
1455 activeConfigName = CopyString(*newName);
1458 project.topNode.RenameConfig(config.name, *newName);
1460 modifiedDocument = true;
1464 bool ConfigClicked(Button clickedButton, int x, int y, Modifiers mods)
1466 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1468 config = (ProjectConfig)clickedButton.id;
1470 // Load Settings Into Dialog
1471 compilerTab.LoadSettings();
1472 linkerTab.LoadSettings();
1473 builderTab.LoadSettings();
1475 deleteConfig.disabled = (clickedButton._class == class(SelectorButton));
1478 buildTabControl.Activate();
1480 if(compilerTab.rightPaneHeader.visible)
1481 compilerTab.rightPaneHeader.Update(null);
1482 ((ProjectSettings)master).UpdateDialogTitle();
1487 void SelectNode(ProjectNode node, bool ignoreAsLastSelection)
1489 if(node != currentNode)
1491 Window ac = compilerTab.rightPane.activeChild;
1492 bool prevNodeRes = currentNode ? currentNode.isInResources : false;
1495 if(!node) node = project.topNode;
1497 newNodeRes = node.isInResources;
1500 if(!ignoreAsLastSelection)
1501 lastSelectedNode = node;
1503 ((ProjectSettings)master).UpdateDialogTitle();
1504 if(node.type == project)
1506 compilerTab.rightPaneHeader.visible = false;
1510 compilerTab.rightPaneHeader.id = (int)node;
1511 compilerTab.rightPaneHeader.Update(null);
1512 compilerTab.rightPaneHeader.visible = true;
1516 DataRow row = compilerTab.fileList.FindSubRow((int)currentNode);
1519 compilerTab.fileList.currentRow = row;
1520 while((row = row.parent))
1521 row.collapsed = false;
1525 if(prevNodeRes != newNodeRes)
1527 compilerTab.labelObjDir.visible = !newNodeRes;
1528 compilerTab.objDir.visible = !newNodeRes;
1529 compilerTab.excludeFromBuild.visible = !newNodeRes;
1530 compilerTab.labelPreprocessorDefs.visible = !newNodeRes;
1531 compilerTab.preprocessorDefs.visible = !newNodeRes;
1532 compilerTab.labelDefaultNameSpace.visible = !newNodeRes;
1533 compilerTab.defaultNameSpace.visible = !newNodeRes;
1534 compilerTab.strictNameSpaces.visible = !newNodeRes;
1535 compilerTab.memoryGuard.visible = !newNodeRes;
1536 compilerTab.noLineNumbers.visible = !newNodeRes;
1537 compilerTab.debug.visible = !newNodeRes;
1538 compilerTab.labelWarnings.visible = !newNodeRes;
1539 compilerTab.warnings.visible = !newNodeRes;
1540 compilerTab.profiling.visible = !newNodeRes;
1541 compilerTab.labelOptimization.visible = !newNodeRes;
1542 compilerTab.optimization.visible = !newNodeRes;
1543 compilerTab.labelIncludeDirs.visible = !newNodeRes;
1544 compilerTab.includeDirs.visible = !newNodeRes;
1547 if(node == project.topNode)
1549 compilerTab.objDir.visible = true;
1550 compilerTab.labelObjDir.visible = true;
1552 compilerTab.excludeFromBuild.visible = false;
1556 compilerTab.objDir.visible = false;
1557 compilerTab.labelObjDir.visible = false;
1559 compilerTab.excludeFromBuild.visible = (node != project.resNode);
1562 // Load Settings Into Dialog
1563 compilerTab.LoadSettings();
1564 linkerTab.LoadSettings();
1565 builderTab.LoadSettings();
1571 if(ac == compilerTab.excludeFromBuild.editor)
1572 ac = compilerTab.objDir.editor;
1573 else if(compilerTab.excludeFromBuild.editor.visible)
1574 ac = compilerTab.excludeFromBuild.editor;
1581 void CreateConfigButtons()
1583 SelectorButton commonButton;
1585 // Create Config Buttons
1586 commonButton = SelectorButton
1588 configSelector, master = this, text = $"Common", id = (int)null; font = { font.faceName, font.size, true };
1590 NotifyClicked = ConfigClicked;
1595 if(project.topNode.configurations)
1597 for(c : project.topNode.configurations)
1599 EditableSelectorButton button
1601 configSelector, master = this, renameable = true, text = c.name, id = (int)c;
1602 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1611 SelectorButton button;
1613 activeConfigName = project.config ? CopyString(project.config.name) : null;
1615 compilerTab.AddNode(project.topNode, null);
1617 CreateConfigButtons();
1619 platformButton = button =
1621 platformSelector, master = this, text = $"Common", id = 0; font = { font.faceName, font.size, true };
1622 NotifyClicked = PlatformClicked; checked = true;
1627 for(p = (Platform)1; p < Platform::enumSize; p++)
1629 SelectorButton button
1631 platformSelector, master = this, text = p.OnGetString(0,0,0), id = (int)p;
1632 NotifyClicked = PlatformClicked;
1636 SelectorButton platformButton;
1640 // Backup Current Settings
1641 backupNode = project.topNode.Backup();
1643 buildTabControl.Activate();
1646 Iterator<Window> it { configSelector.controls };
1649 SelectorButton configButton = (SelectorButton)it.data;
1650 ProjectConfig buttonConfig = (ProjectConfig)configButton.id;
1651 if(buttonConfig == project.config)
1653 configButton.Activate();
1654 configButton.checked = true;
1655 ConfigClicked(configButton, 0, 0, (Modifiers)null);
1662 platformButton.MakeActive();
1663 platformButton = null;
1672 lastSelectedNode = null;
1674 project.config = null;
1676 /* // THIS IS NOW AUTOMATED WITH A project CHECK IN ProjectNode
1677 project.configurations = project.topNode.configurations;
1678 project.platforms = project.topNode.platforms;
1679 project.options = project.topNode.options;
1682 if(project.topNode.configurations)
1684 for(c : project.topNode.configurations)
1686 if(!strcmpi(c.name, activeConfigName))
1695 void RevertChanges()
1697 String configName = config ? CopyString(config.name) : null;
1699 // Revert to saved project options
1700 project.topNode.Revert(backupNode);
1702 configSelector.DestroyChildren();
1703 CreateConfigButtons();
1705 // Reselect Configuration
1708 Iterator<Window> it { configSelector.controls };
1711 Button button = (Button)it.data;
1712 ProjectConfig c = (ProjectConfig)button.id;
1713 if(c && !strcmp(c.name, configName))
1717 button.checked = true;
1718 ConfigClicked(button, 0,0, 0);
1724 SelectNode(project.topNode, false);
1729 bool OnClose(bool parentClosing)
1731 if(modifiedDocument)
1733 DialogResult diagRes = MessageBox
1735 type = yesNoCancel, master = ide,
1736 text = $"Save changes to project settings?",
1737 contents = $"Would you like to save changes made to the build options?"
1741 if(diagRes == cancel)
1745 project.MarkChanges(backupNode);
1746 project.topNode.modified = true;
1747 ide.projectView.modifiedDocument = true;
1748 ide.projectView.Update(null);
1750 modifiedDocument = false;
1756 class CompilerTab : Tab
1758 background = activeBorder;
1761 Window leftPane { this, size = { 180 }, anchor = { left = 0, top = 0, bottom = 0 }, background = activeBorder };
1763 Label labelFileList { leftPane, this, position = { 8, 8 }, labeledWindow = fileList };
1766 leftPane, this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
1767 // THIS WOULD BE EVEN MORE FUN: multiSelect = true,
1768 fullRowSelect = false, collapseControl = true, treeBranches = true;
1769 alwaysHighLight = true;
1770 selectionColor = unfocusedSelectorColor;
1772 anchor = Anchor { left = 8, top = 24, right = 4, bottom = 8 };
1775 bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
1777 BuildTab buildTab = (BuildTab)master;
1778 ProjectNode node = (ProjectNode)row.tag;
1779 buildTab.SelectNode(node, false);
1783 void OnRedraw(Surface surface)
1785 ide.projectView.drawingInProjectSettingsDialog = true;
1786 ListBox::OnRedraw(surface);
1787 ide.projectView.drawingInProjectSettingsDialog = false;
1790 bool NotifyActivate(Window window, bool active, Window previous)
1794 //subclass(Skin) skinClass = (subclass(Skin))eSystem_FindClass(app, app.skin);
1795 fileList.selectionColor = Color { 10, 36, 106 }; //skinClass.selectionColor; // darkBlue;
1797 else if(fileList.currentRow)
1799 DataRow currentRow = fileList.currentRow;
1800 //int headerSize = ((fileList.style.header) ? fileList.rowHeight : 0);
1801 int height = fileList.clientSize.h + 1;// - fileList.headerSize;
1802 fileList.selectionColor = unfocusedSelectorColor;
1803 if(currentRow && currentRow.index * fileList.rowHeight > fileList.scroll.y + height - fileList.rowHeight)
1804 fileList.SetScrollPosition(fileList.scroll.x, currentRow.index * fileList.rowHeight - height + fileList.rowHeight);
1805 else if(!currentRow || currentRow.index * fileList.rowHeight < fileList.scroll.y)
1806 fileList.SetScrollPosition(fileList.scroll.x, currentRow ? currentRow.index * fileList.rowHeight : 0);
1816 this, anchor = { left = 196, top = 0, right = 0, bottom = 0 }, background = activeBorder, tabCycle = true;
1819 Window rightPaneHeader
1821 rightPane, this, size = { h = 21 }, anchor = { left = 0, top = 0, right = 0 }, background = Color { 70, 96, 166 };//0x0F3F66;
1822 foreground = white; visible = false;
1824 void OnRedraw(Surface surface)
1828 ide.projectView.drawingInProjectSettingsDialogHeader = true;
1829 class(ProjectNode)._vTbl[__ecereVMethodID_class_OnDisplay](class(ProjectNode),
1830 id, surface, 8, 2, clientSize.w, ide.projectView, Alignment::left, DataDisplayFlags { selected = true });
1831 ide.projectView.drawingInProjectSettingsDialogHeader = false;
1836 PaneSplitter splitter
1838 this, leftPane = leftPane, rightPane = rightPane, split = 188
1841 Label labelObjDir { rightPane, this, position = { 8, 8 }, labeledWindow = objDir };
1842 PathOptionBox objDir
1844 rightPane, this, size = { 250, 22 }, anchor = { left = 8, top = 24, right = 8 };
1845 text = $"Intermediate Objects Directory", hotKey = altJ, option = OPTION(objectsDirectory);
1848 BoolOptionBox excludeFromBuild
1850 rightPane, this, position = { 8, 28 },
1851 text = $"Exclude from Build", visible = false, option = OPTION(excludeFromBuild);
1854 Label labelPreprocessorDefs { rightPane, this, position = { 8, 50 }, labeledWindow = preprocessorDefs };
1855 StringArrayOptionBox preprocessorDefs
1857 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
1858 text = $"Preprocessor Definitions", hotKey = altD, option = OPTION(preprocessorDefinitions);
1861 Label labelDefaultNameSpace { rightPane, this, position = { 8, 92 }, labeledWindow = defaultNameSpace };
1862 StringOptionBox defaultNameSpace
1864 rightPane, this, size = { 160, 22 }, position = { 8, 108 };
1865 text = $"Default Name Space", option = OPTION(defaultNameSpace);
1867 BoolOptionBox strictNameSpaces
1869 rightPane, this, position = { 172, 112 },
1870 text = $"Strict Name Spaces", option = OPTION(strictNameSpaces);
1873 BoolOptionBox memoryGuard
1875 rightPane, this, position = { 8, 154 };
1876 text = $"MemoryGuard", hotKey = altM, option = OPTION(memoryGuard);
1879 Label labelWarnings { rightPane, position = { 116, 138 }, labeledWindow = warnings };
1882 rightPane, this, position = { 116, 154 };
1883 text = $"Warnings", hotKey = altW, option = OPTION(warnings);
1886 Label labelOptimization { rightPane, position = { 244, 138 }, labeledWindow = optimization };
1887 OptimizationDB optimization
1889 rightPane, this, position = { 244, 154 }, size = { 120, 22 };
1890 text = $"Optimization", hotKey = altO, option = OPTION(optimization);
1895 rightPane, this, position = { 8, 188 };
1896 text = $"Debuggable", hotKey = altG, option = OPTION(debug);
1899 BoolOptionBox profiling
1901 rightPane, this, position = { 116, 188 };
1902 text = $"Profiling Data", hotKey = altP, option = OPTION(profile);
1905 BoolOptionBox noLineNumbers
1907 rightPane, this, position = { 244, 188 };
1908 text = $"No Line Numbers", hotKey = altN, option = OPTION(noLineNumbers);
1911 Label labelIncludeDirs { includeDirs.editor, labeledWindow = includeDirs, position = { 0, 6 }; };
1912 DirsArrayOptionBox includeDirs
1914 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 208, right = 8, bottom = 8 };
1915 text = $"Additional Include Directories", hotKey = altI, option = OPTION(includeDirs);
1920 fileList.AddField(DataField { dataType = class(ProjectNode), freeData = false,
1921 userData = null /* Now set in the ProjectNode directly to know we're in ProjectSettings Dialog -- ide.projectView*/ });
1926 BuildTab buildTab = (BuildTab)master;
1927 buildTab.SelectNode(buildTab.lastSelectedNode, true);
1931 void AddNode(ProjectNode node, DataRow addTo)
1933 DataRow row = addTo ? addTo.AddRow() : fileList.AddRow();
1935 row.tag = (int)node;
1937 row.SetData(null, node);
1939 if(node.files && node.files.first && node.parent &&
1940 !(!node.parent.parent &&
1941 (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
1942 !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
1943 row.collapsed = true;
1944 else if(node.type == folder)
1945 node.icon = openFolder;
1949 for(child : node.files)
1950 AddNode(child, row);
1957 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
1958 if(eClass_IsDerived(ob._class, class(OptionBox)))
1961 if(activeChild && activeChild.active)
1963 Window control = activeChild;
1964 control.Deactivate();
1971 objDir.editor.Activate();
1976 class LinkerTab : Tab
1978 background = activeBorder;
1981 Label labelTargetName { this, position = { 8, 8 }, labeledWindow = targetName };
1982 StringOptionBox targetName
1984 this, position = { 8, 24 }, size = { 200, 22 };
1985 text = $"Target Name", hotKey = altN, option = OPTION(targetFileName);
1988 Label labelTargetType { this, position = { 216, 8 }, labeledWindow = targetType };
1989 TargetTypeDB targetType
1991 this, position = { 216, 24 }, size = { 120, 22 };
1992 text = $"Target Type", hotKey = altT, option = OPTION(targetType);
1995 Label labelTargetDirectory { this, position = { 344, 8 }, labeledWindow = targetDirectory };
1996 PathOptionBox targetDirectory
1998 this, size = { 270, 22 }, anchor = { left = 344, top = 24, right = 8 };
1999 hotKey = altR, text = $"Target Directory", option = OPTION(targetDirectory);
2002 Label labelLibraries { this, position = { 8, 50 }, labeledWindow = libraries };
2003 StringArrayOptionBox libraries
2005 this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
2006 text = $"Additional Libraries", hotKey = altL, option = OPTION(libraries);
2007 configReplaces = true;
2010 Label labelLinkerOptions { this, position = { 8, 92 }, labeledWindow = linkerOptions };
2011 StringArrayOptionBox linkerOptions
2013 this, size = { 290, 22 }, anchor = { left = 8, top = 108, right = 8 };
2014 text = $"Linker Options", hotKey = altO, option = OPTION(linkerOptions);
2015 configReplaces = true;
2018 BoolOptionBox console
2020 this, position = { 8, 138 };
2021 text = $"Console Application", hotKey = altC, option = OPTION(console);
2024 BoolOptionBox compress
2026 this, position = { 8, 162 };
2027 text = $"Compress", hotKey = altW, option = OPTION(compress);
2030 Label labelLibraryDirs { libraryDirs.editor, labeledWindow = libraryDirs, position = { 0, 6 }; };
2031 DirsArrayOptionBox libraryDirs
2033 this, size = { 290, 22 }, anchor = { left = 8, top = 182, right = 8, bottom = 8 };
2034 text = $"Additional Library Directories", hotKey = altY, option = OPTION(libraryDirs);
2039 ((BuildTab)master).SelectNode(project.topNode, true);
2046 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2047 if(eClass_IsDerived(ob._class, class(OptionBox)))
2049 compress.disabled = (config && config.options && config.options.debug == true) || project.topNode.options.debug == true;
2051 if(activeChild && activeChild.active)
2053 Window control = activeChild;
2054 control.Deactivate();
2060 class BuilderTab : Tab
2062 background = activeBorder;
2065 Label labelPrebuildCommands { prebuildCommands.editor, labeledWindow = prebuildCommands, position = { 0, 6 }; };
2066 StringsArrayOptionBox prebuildCommands
2068 this, size = { 290, 100 }, anchor = { left = 8, top = 52, right = 8 };
2069 text = $"Pre-build Commands", hotKey = altE, option = OPTION(prebuildCommands);
2072 Label labelPostbuildCommands { postbuildCommands.editor, labeledWindow = postbuildCommands, position = { 0, 6 }; };
2073 StringsArrayOptionBox postbuildCommands
2075 this, size = { 290, 100 }, anchor = { left = 8, top = 160, right = 8 };
2076 text = $"Post-build Commands", hotKey = altT, option = OPTION(postbuildCommands);
2081 bool disabled = strlen(((BuildTab)master).selectedPlatformName) > 0;
2083 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2084 if(eClass_IsDerived(ob._class, class(OptionBox)))
2087 if(activeChild && activeChild.active)
2089 Window control = activeChild;
2090 control.Deactivate();