Quantcast
Channel: Latest Questions by Kerihobo
Viewing all articles
Browse latest Browse all 74

Customize the context menu of a GraphView's BlackboardField?

$
0
0
Hi, I've been exploring the GraphView and am stuck with customizing the context menu for a VisualElement held within a Blackboard.

![alt text][1]
I have a vague understanding of how to register the callbacks and add manipulators to things but I seem to have hit a dead-end on customizing the context menu that appears when I right-click on one of my blackboard properties. I would like to add **Remove** or **Delete** to the context menu, as currently, only **Rename** is an option.

***How would I do that?***

**Bonus question:** Despite setting my blackboardFields' capabilities to selectable, deletable, drag/droppable etc, I can't seem to pick them up to rearrange or drag them to the graph itself. Are capabilities not the correct way to make them draggable?

This is how I'm adding these property fields in the first place:

VisualElement container = new VisualElement(); BlackboardField blackboardField = new BlackboardField { text = newProperty.name , typeText = "string" }; container.Add(blackboardField); TextField textPropertyValue = new TextField("Value") { value = localPropertyValue }; textPropertyValue.RegisterValueChangedCallback(e => { int changingPropertyIndex = exposedProperties.FindIndex(x => x.name == newProperty.name); exposedProperties[changingPropertyIndex].value = e.newValue; }); var blackboardValueRow = new BlackboardRow(blackboardField, textPropertyValue); container.Add(blackboardValueRow); StyleSheet st = Resources.Load("StyleSheets/Blackboard"); container.styleSheets.Add(st); blackboard.Add(container);
Am I doin it wrong? :S [1]: /storage/temp/170259-graphex.png

Viewing all articles
Browse latest Browse all 74

Latest Images

Trending Articles





Latest Images