public DirectoryWidget(Control parent, string id, int width = 14, int height = 1) : base(parent, width, height) { id_ = id; label_ = new SaneLabel(this, id); label_.SaneCoords.SaneScale(12, 1); button_ = new SaneButton(this, "Browse..."); button_.SaneClick += Browse; button_.SaneCoords.SanePosition(label_.SaneCoords.Width, 0); GlobalSave += SaveData; GlobalLoad += LoadData; //hacky solution SUCKS allDirs[id] = this; }
public AssetDirectoryMonitorWidget(Control parent, string id, Importer importer, SaneTabs namerTabs, int width = 14, int height = 1) : base(parent, id, width, height) { label_.SaneCoords.SanePosition(2, 0); label_.SaneCoords.SaneScale(10, 1); switch_ = new SaneToggleButton(this); switch_.SaneClick += b => { StateChanged(); }; importer_ = importer; importer.Id = id; //shader editor var page = namerTabs.NewPage(id); new SaneLabel(page, id + " Naming Processor"); var minihelp = new SaneLabel(page, "input vars: file, path, folder", 8); minihelp.SaneCoords.SanePosition(6, 0); minihelp.TextAlign = ContentAlignment.BottomRight; minihelp.Font = new Font(FontFamily.GenericMonospace, 8); namerBox_ = new SaneTextBox(page, 14, 12); namerBox_.SaneCoords.SanePosition(0, 1); namerBox_.Text = "return file;"; namerBox_.Font = new Font(FontFamily.GenericMonospace, 10); var previewNamerButton = new SaneButton(page, "Preview Results (Output Below)", 8); previewNamerButton.SaneCoords.SanePosition(3, 13); previewNamerButton.SaneClick += button => { PreviewNamer(); }; namerPreviewBox_ = new SaneTextBox(page, 14, 6); namerPreviewBox_.SaneCoords.SanePosition(0, 14); namerPreviewBox_.ReadOnly = true; PathChanged += StateChanged; MasterSwitch.SaneClick += button => { StateChanged(); }; GlobalTick += Tick; GlobalBuild += BuildAll; }