Initializes a new instance of the class. The editor.
(Editor editor)
| 152 | /// </summary> |
| 153 | /// <param name="editor">The editor.</param> |
| 154 | public ContentWindow(Editor editor) |
| 155 | : base(editor, true, ScrollBars.None) |
| 156 | { |
| 157 | Title = "Content"; |
| 158 | Icon = editor.Icons.Folder32; |
| 159 | var style = Style.Current; |
| 160 | |
| 161 | FlaxEditor.Utilities.Utils.SetupCommonInputActions(this); |
| 162 | |
| 163 | var options = Editor.Options; |
| 164 | options.OptionsChanged += OnOptionsChanged; |
| 165 | |
| 166 | // Toolstrip |
| 167 | _toolStrip = new ToolStrip(34.0f) |
| 168 | { |
| 169 | Parent = this, |
| 170 | }; |
| 171 | _importButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Import64, () => Editor.ContentImporting.ShowImportFileDialog(CurrentViewFolder)).LinkTooltip("Import content."); |
| 172 | _createNewButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Add64, OnCreateNewItemButtonClicked).LinkTooltip("Create a new asset. Shift + left click to create a new folder."); |
| 173 | _toolStrip.AddSeparator(); |
| 174 | _navigateBackwardButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Left64, NavigateBackward).LinkTooltip("Navigate backward."); |
| 175 | _navigateForwardButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Right64, NavigateForward).LinkTooltip("Navigate forward."); |
| 176 | _navigateUpButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Up64, NavigateUp).LinkTooltip("Navigate up."); |
| 177 | _toolStrip.AddSeparator(); |
| 178 | |
| 179 | // Split panel |
| 180 | _split = new SplitPanel(options.Options.Interface.ContentWindowOrientation, ScrollBars.None, ScrollBars.None) |
| 181 | { |
| 182 | AnchorPreset = AnchorPresets.StretchAll, |
| 183 | Offsets = new Margin(0, 0, _toolStrip.Bottom, 0), |
| 184 | SplitterValue = 0.2f, |
| 185 | Parent = this, |
| 186 | }; |
| 187 | |
| 188 | // Tree-only panel (used when showing all content in the tree) |
| 189 | _treeOnlyPanel = new TreeViewPanel |
| 190 | { |
| 191 | AnchorPreset = AnchorPresets.StretchAll, |
| 192 | Offsets = new Margin(0, 0, _toolStrip.Bottom, 0), |
| 193 | Visible = false, |
| 194 | Parent = this, |
| 195 | }; |
| 196 | |
| 197 | // Tree host panel |
| 198 | _treePanelRoot = new ContainerControl |
| 199 | { |
| 200 | AnchorPreset = AnchorPresets.StretchAll, |
| 201 | Offsets = Margin.Zero, |
| 202 | Parent = _split.Panel1, |
| 203 | }; |
| 204 | |
| 205 | // Content structure tree searching query input box |
| 206 | _treeHeaderPanel = new ContainerControl |
| 207 | { |
| 208 | AnchorPreset = AnchorPresets.HorizontalStretchTop, |
| 209 | BackgroundColor = style.Background, |
| 210 | IsScrollable = false, |
| 211 | Offsets = new Margin(0, 0, 0, 18 + 6), |
nothing calls this directly
no test coverage detected