Changeset 6497 for branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
- Timestamp:
- 06/29/11 13:08:43 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
r6494 r6497 32 32 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { 33 33 [View("Symbolic Expression Grammar Editor")] 34 [Content(typeof(ISymbolicExpressionGrammar), false)]34 [Content(typeof(ISymbolicExpressionGrammar), true)] 35 35 public partial class SymbolicExpressionGrammarEditorView : NamedItemView { 36 36 public SymbolicExpressionGrammarEditorView() { … … 220 220 private void symbolsTreeView_MouseDown(object sender, MouseEventArgs e) { 221 221 // enables deselection of treeNodes 222 if (symbolsTreeView.SelectedNode == null) return;223 222 Point coordinates = new Point(e.X, e.Y); 224 if (e.Button == System.Windows.Forms.MouseButtons.Left && symbolsTreeView.GetNodeAt(coordinates) == null) { 223 TreeNode node = symbolsTreeView.GetNodeAt(coordinates); 224 if (e.Button == System.Windows.Forms.MouseButtons.Left && node == null) { 225 225 symbolsTreeView.SelectedNode = null; 226 226 symbolDetailsViewHost.Content = null; … … 256 256 ISymbol symbol = (ISymbol)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 257 257 ChangeDuplicateSymbolNames(symbol); 258 259 var selectedNode = symbolsTreeView.SelectedNode; 260 GroupSymbol groupSymbol = selectedNode.Tag as GroupSymbol; 261 if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol; 262 258 GroupSymbol groupSymbol = null; 259 260 TreeNode selectedNode = symbolsTreeView.SelectedNode; 261 if (selectedNode != null) { 262 groupSymbol = selectedNode.Tag as GroupSymbol; 263 if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol; 264 } 263 265 if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(symbol); 264 266 else Content.AddSymbol(symbol); … … 300 302 splitContainer1.Panel2Collapsed = !showDetailsCheckBox.Checked; 301 303 } 304 305 private void showSampleTreeButton_Click(object sender, EventArgs e) { 306 SymbolicExpressionGrammarSampleExpressionTreeView view = new SymbolicExpressionGrammarSampleExpressionTreeView(); 307 view.Content = Content; 308 view.Show(); 309 } 310 302 311 #endregion 303 312
Note: See TracChangeset
for help on using the changeset viewer.