Initializes a new instance of the class. The initialization info data.
(InitInfo info)
| 154 | /// </summary> |
| 155 | /// <param name="info">The initialization info data.</param> |
| 156 | public VisjectCM(InitInfo info) |
| 157 | { |
| 158 | if (info.Groups == null) |
| 159 | throw new ArgumentNullException(nameof(info.Groups)); |
| 160 | if (info.CanSpawnNode == null) |
| 161 | throw new ArgumentNullException(nameof(info.CanSpawnNode)); |
| 162 | _parametersGetter = info.ParametersGetter; |
| 163 | _parameterGetNodeArchetype = info.ParameterGetNodeArchetype ?? Archetypes.Parameters.Nodes[0]; |
| 164 | if (info.CanSetParameters) |
| 165 | _parameterSetNodeArchetype = info.ParameterSetNodeArchetype ?? Archetypes.Parameters.Nodes[3]; |
| 166 | _useDescriptionPanel = info.UseDescriptionPanel; |
| 167 | _surfaceStyle = info.Style; |
| 168 | |
| 169 | // Context menu dimensions |
| 170 | Size = new Float2(_useDescriptionPanel ? DefaultWidth + 50f : DefaultWidth, DefaultHeight); |
| 171 | |
| 172 | var headerPanel = new Panel(ScrollBars.None) |
| 173 | { |
| 174 | Parent = this, |
| 175 | Height = 20, |
| 176 | Width = Width - 4, |
| 177 | X = 2, |
| 178 | Y = 1, |
| 179 | }; |
| 180 | |
| 181 | // Title bar |
| 182 | var titleFontReference = new FontReference(Style.Current.FontLarge.Asset, 10); |
| 183 | var titleLabel = new Label |
| 184 | { |
| 185 | Width = Width * 0.5f - 8f, |
| 186 | Height = 20, |
| 187 | X = 4, |
| 188 | Parent = headerPanel, |
| 189 | Text = "Select Node", |
| 190 | HorizontalAlignment = TextAlignment.Near, |
| 191 | Font = titleFontReference, |
| 192 | }; |
| 193 | |
| 194 | // Context sensitive toggle |
| 195 | var contextSensitiveLabel = new Label |
| 196 | { |
| 197 | Width = Width * 0.5f - 28, |
| 198 | Height = 20, |
| 199 | X = Width * 0.5f, |
| 200 | Parent = headerPanel, |
| 201 | Text = "Context Sensitive", |
| 202 | TooltipText = "Should the nodes be filtered to only show those that can be connected in the current context?", |
| 203 | HorizontalAlignment = TextAlignment.Far, |
| 204 | Font = titleFontReference, |
| 205 | }; |
| 206 | |
| 207 | _contextSensitiveToggle = new CheckBox |
| 208 | { |
| 209 | Width = 20, |
| 210 | Height = 20, |
| 211 | X = Width - 24, |
| 212 | Parent = headerPanel, |
| 213 | Checked = _contextSensitiveSearchEnabled, |
nothing calls this directly
no test coverage detected