Add a newly created/custom component on the palette - eclipse-gef

I am wondering if it is possible to add a newly created diagram component on the palette.
I am adding components on the diagram programmatically (with a wizard to ask the user which variables he would like to add in/on the component). And i would like to give the user the possibility to make a similar component by dragging and dropping from the palette.
(say you created a component "wheel" with some variables, it would be nice to be able to create 4 of them without having to use the wizard every time)

Related

Drag/marquee selection inside custom maya UI

Is there a way to select several buttons inside a formLayout (or any other layout) with a drag selection?
Like how you would do with maya objects in viewport, but inside a custom MEL UI
i know you can use getModifiers to know if Shift is pressed to not and thus mimick shift selection etc
but drag/marquee selection seems, very hard, to replicate...
I don't think you can use Maya's standard interface objects to achieve that, but yes, you can absolutely do it with PySide in Python.
Check out examples for QtWidgets.QGraphicsView and QtWidgets.QGraphicsScene. Their framework is setup so that you can create items inside their view, and be able to select multiple with a marquee. They can also support moving via dragging the items, so you can even go as far as having a body picker creator without having to hard-code it. You could even be fancy as to create path items with beziers handles (like Photoshop) so that the user can create their own custom shapes, though you would have to manually make that framework.

Creating event triggers dynamically with Unity 4.6 UI tools

I'm having a bit of trouble with Unity 4.6's new UI tools.
On the canvas I have a list of toggles that are created dynamically at runtime (I'm following the instructions of this tutorial https://www.youtube.com/watch?v=TRLsmuYMs8Q more or less). I'm trying to add a trigger to every one of the toggles, that would call a function ListManager.LoadModel(int), when the toggle is clicked. Every toggle's event would have a different int assigned to it (the first one would call LoadModel(0), the second LoadModel(1) and so on).
It's easy to create a list of toggles manually and hardcode the calls to every one of them in Inspector but I cannot figure out how add the triggers to the toggles as I'm creating them dynamically with the script. Any suggestions?

Is it somehow possible to insert an EditorArea into a View in Eclipse RCP?

Is it somehow possible to insert an EditorArea into a View in Eclipse RCP?
I would like to define a restricted area, inside of which the Editors may be moved.
Not easily - in general, there is 'one' EditorArea for an Eclipse application.
You could use a custom presentation layer to put that EditorArea over one of your views, but that would be it.
A potential (high-level) solution would likely involve passing an EditorPart instance to a custom view, which will then call createPartControl to render the editor contents inside the view, and manage any necessary initialization of the editor.
Since this editor would be a child control of the view, you might also need to do special hookups for selection/editorsite/actionbars/shortcut keys, etc, so that they continue to work when that editor is being run from within the view.

Copying control components

I have a C++/CLI project which has a child form with some control components. I would like to copy all the control components with their codes on a new Tab control on the main form. How can I do that?
You can select all of the controls in the designer (hold down the Shift key to make multiple selections), and then cut and paste them to their new location: Ctrl+X, Ctrl+V
Alternatively, you can open up the *.Designer file that is generated automatically by the Windows Forms designer and copy the relevant lines of code out of that file into your other code file. Look for the code that creates and sets properties on the controls you're interested in. For every property of the control that you have set to its non-default value in the designer, there will be a line for it in this file.
If, instead of moving (cutting) the controls from one place to another, you want to copy the controls so that they appear in multiple places, I strongly suggest creating a UserControl that contains all of the child controls and encapsulates the relevant code. Then, you can just drop an instance of this custom UserControl out of your toolbox into whatever form you want, or even dynamically create instances at runtime. This is consistent with the general programming/design principle that you should seek to keep code duplication to a minimum while encapsulating as much as possible.

Generate a Window from Core Data

To start, I put my info into Core Data and I have my table showing up in Interface Builder. It has 20 atributes that are the same except for the number after them ie. example1, example2, etc. Each of these atributes has 12 items for the user to change with 3 variables each(on,off or random).
I want these choices for the user to change to come up in a new window. I don't want to bind each of these variables by hand! Is there a way to bind the whole window?
And should I use an interface builder plugin and make a master window or make 20 windows or ??? I'm a complete novice, but would like to do this the best way.
It sounds like you just need to change UI labels/column-titles. If so, you can bind the text of the label to either data or an attribute of the controller that configures the label for the current state of the data.
If you have repeating units of data, you can define a cell which is bound to a controller and then use as many instances of the cell as needed. See NSMatrix and related containers.

Resources