4 class SettingsDialog : Window
7 background = activeBorder;
14 anchor = { horz = -83, vert = -104 };
16 Label docLabel { this, text = $"Documentation Path:", anchor = { left = 16, top = 16 }, labeledWindow = pathEditBox };
20 this, text = "...", font = { "Tahoma", 8.25f, bold = true }, hotKey = f2;
21 anchor = { right = 20, top = 16 };
22 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
24 if(settingsFileDialog.Modal() == ok) // open the file dialog box, and wait for confirmation that all is okay.
26 pathEditBox.contents = settingsFileDialog.filePath; // display the selected directory in the edit box
32 FileDialog settingsFileDialog
34 type = selectDir, text = $"Select a path"; // set the file dialog box to choose a directory instead of a file.
39 this, text = $"Save", size = { 68, 21 }, position = { 224, 56 }, isDefault = true;
41 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
43 delete settings.docDir;
44 settings.docDir = CopyString(pathEditBox.contents); // Store the path entered into the edit box
45 settingsContainer.Save(); // write that path to the ini file
46 Destroy(0); // close the window
53 this, text = $"Cancel", size = { 68, 21 }, position = { 304, 56 }, hotKey = escape;
55 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
57 Destroy(0); // close the window without making any changes
61 EditBox pathEditBox { this, size = { 214, 19 }, contents = settings.docDir, anchor = { right = 41, top = 16 } };