3 class WorkspaceTab : Tab
5 background = formColor;
8 Label labelDebugDirectory { this, position = { 8, 8 }, labeledWindow = debugDirectory };
11 this, size = { 290, 22 }, position = { 8, 24 }, anchor = { left = 8, top = 24, right = 8 };
12 text = $"Debug Working Directory", hotKey = altU;
13 typeExpected = directory;
15 NotifyModified = WorkspaceControlModified;
18 Label labelCommandLineArgs { this, position = { 8, 50 }, labeledWindow = commandLineArgs };
19 EditBox commandLineArgs
21 this, size = { 290, 22 }, position = { 8, 66 }, anchor = { left = 8, top = 66, right = 8 };
22 text = $"Command Line Arguments", hotKey = altA;
23 NotifyModified = WorkspaceControlModified;
25 Label labelEnvironmentVars { environmentVars, this, position = { 0, 6 }, labeledWindow = environmentVars };
26 NamedStringsBox environmentVars
28 this, size = { 290, 100 }, anchor = { left = 8, top = 96, right = 8 };
29 text = $"Environment Variables", hotKey = altV;
30 NotifyModified = WorkspaceControlModified;
33 Label labelSourceDirs { sourceDirs, this, position = { 0, 6 }, labeledWindow = sourceDirs };
34 DirectoriesBox sourceDirs
36 this, size = { 290, 100 }, anchor = { left = 8, top = 204, right = 8 };
37 text = $"Source Files Directories", hotKey = altI;
38 NotifyModified = WorkspaceControlModified;
43 // This is required to be here because the label is labeling its parent, which otherwise has issues
44 labelSourceDirs.labeledWindow = sourceDirs;
48 Array<String> strings { };
50 for(dir : ide.workspace.sourceDirs)
52 sourceDirs.strings = strings;
54 debugDirectory.path = ide.workspace.debugDir;
55 commandLineArgs.contents = ide.workspace.commandLineArgs;
56 environmentVars.namedStrings = ide.workspace.environmentVars;
63 bool WorkspaceControlModified(CommonControl control)
65 modifiedDocument = true;
71 if(debugDirectory.modifiedDocument)
72 ide.workspace.debugDir = debugDirectory.slashPath;
73 if(commandLineArgs.modifiedDocument)
74 ide.workspace.commandLineArgs = commandLineArgs.line.text;
75 if(environmentVars.modifiedDocument)
77 ide.workspace.environmentVars.Free();
78 delete ide.workspace.environmentVars;
79 ide.workspace.environmentVars = environmentVars.namedStrings;
81 if(sourceDirs.modifiedDocument)
82 ide.workspace.UpdateSourceDirsArray(sourceDirs.strings);
84 if(debugDirectory.modifiedDocument || sourceDirs.modifiedDocument || commandLineArgs.modifiedDocument)
85 ide.workspace.modified = true;
88 bool OnClose(bool parentClosing)
92 DialogResult diagRes = MessageBox
94 type = yesNoCancel, master = rootWindow,
95 text = $"Save changes to workspace options?",
96 contents = $"Would you like to save changes made to the workspace options?"
102 modifiedDocument = false;