Maya drop down menu - maya

I've got a pretty complex question for any Maya coders...
I want to utilize a drop down menu similar to that of the cmdScrollFieldExecuter's [script editor's] "Show Tooltip Help". It looks like a window that has been appended to the bottom of the inputted text with a feedback of all relative commands or strings.
Does anyone have experience with appending a similar textbox/ window/ menu to typed input, and if so, can you toss me in the right direction?
Note: I am not talking about "optionMenu".
Alternatively, is there a way to get cmdScrollFieldExecuter to reference a different array or set of strings?

A complete port of that won't be possible in vanilla Maya - You'd need to use python and QT because the built-in GUI objects (such as TextField) don't fire any events on keypresses so you won't be able to live-update as the user types.
You can almost fake the visual appearance with a window whose title bar is set to off. Use a formLayout to dock a TextScrollField inside it. You'll need to hack up some way of dismissing it since it won't have a close box -- you could put it on a timer or add an invisible button covering the whole thing which closed the window when clicked

Related

GTK+3 disable the close icon present in a window (c program)

I'm developing a GUI in Linux (Ubuntu 16.04 - WM: Gnome) using GTK+3 and the graphic library cairo.
After clicked on a push button (Plot), using the instruction of cairo I draw a red square on a new top window where I put a GtkDrawingArea.
In this window I also put a push button (Cancel) that clicked, hide the window. In this way, if I re-push "Plot", the red square reappear.
The issue is the "x" icon present in the top bar of the window.
If (no me) a user push this x, the window disapper and if he re-push the "Plot" an error is reported.
The question is: it is possible avoid this possible cause of error?
(remove this "x" from the top bar of the window or in some way disable its functionality).
I tryed to find alone a solution and the possibility found are:
1 - Remove from the window the property of "decorated".
The top bar disapper (so also the x) but is not possible move the window on the screen
2 - Using the function gtk_window_set_deletable(window, FALSE) (used before to show the window), but the x is always there and pushing it the window is destroyed.
If you think that can be useful, I can report the code.
I'm waiting your suggestion.
Edit:
Now we know what you want to achieve: display a separate window but avoid destroying it so you can display it again. You already have in the "Cancel" button of your secondary window the logic to hide it.
The cleanest solution is to just do the same: when the user tries to close the secondary window, hide it instead. This way the user is not frustrated of seeing something that apparently doesn't work as expected. Hidden or closed, it's different for you but it's the same for the user.
So you just need to connect to the delete-event of that secondary window, and hide it. There's even no need to create a specific callback for that, GTK+ provides it for you: you just need to connect the delete-event to gtk_widget_hide_on_delete. To display the window again, just call gtk_widget_show_all on it.
Original answer:
I realize the plot
"realize" is a term that has a defined meaning in GTK+. Don't use it out of context, and try to use an alternate term if you're not talking about widget realization.
What I would like is to remove this "x" from the top bar of the window
or in some way disable its functionality.
Do you understand this is ultra annoying for a user and defeats a unified user experience? Would you like to use applications that do random different things?
Anyway, one way of disabling the closing button is to connect to the delete-event and return TRUE there to stop the propagation of the event. The button will still be there but do nothing, so you will have to kill the app to exit it.
To make the button disappear, gtk_window_set_deletable will ask the Window Manager to do that, but we'd need some code to know what's wrong with your attempt.

Maya for animation - Can you manipulate a selected object without clicking?

I'm getting into animation in Maya, and I'd really love to speed up my ability to manipulate controls so that I can quickly get my rigs posed. I hope that there would be a way to select with one click, and either rotate, scale, or grab it with one keypress(currently I feel forced to mouse over and middle click the manipulator).
Is there a way to accomplish this kind of efficiency?
What do you use to quickly pose your rigs during animation?
Yes, there is a option in preferences under Settings → Selection called click drag select. Which eliminates the need to select then manipulate. Dragging after initial click now manipulates with whatever manipulator you have enabled. Because this is a programming resource, lets discuss how to do this in your code. You can toggle this attribute with following mel snippet:
selectPref -clickDrag (!`selectPref -q -clickDrag`);
Drag the above to your shelf from the command line or script editor. Now you can enable or disable it whenever you want.

Ext.js 4.x Dock-able window as tab

Has anyone seen an implementation or plugin for extjs where you can "pull off" or "dock" tabs/windows the way you can with a browser? Is it even possible?
Searching has not revealed much but I did come across a proposed solution in an older version:
http://www.sencha.com/forum/showthread.php?16842-Dockable-floatable-panels-in-ExtJS
#DmitryB
To clarify, in chrome if I have multiple tabs in the same window like so:
And I "drag" one of the tabs, it pops off into a new window:
I imagine you might accomplish this by moving the content of the tab panel into a window but not sure how to go about it.
In a nutshell:
- Make the tabs draggable, watch for the drag event and mark the
tab-strip as your "safe" zone
- When a tab is dragged and then "dropped" (as in, the drag event ends) you do a check:
> Is the tab within the safe area?
No: Create a new Ext.Window at the x/y of the mouse, copy the components/HTML
out of the original panel and insert them into the new window. Destroy the
original panel.
Yes: Do nothing.
Unfortunately, I am still quite jaded from learning D&D in ExtJS3, so I can't offer any help with this and real code pertaining to ExtJS 4, however the concept seems relatively straightforward to me. I would say you're going to probably want to do your best to NOT have this be flashy - unless you REALLY REALLY need to, I wouldn't worry about showing the panel's contents while you drag the tab - much less show the panel itself. Just let the tab element get dragged around the screen and copy when it's released outside of the safe zone.

How can I create personalized menus in WPF?

I'm working on an XmlEditor (similar to XmlNotepad, but using WPF) in which I want to implement personalized menus. I.e. only show the most popular MenuItems on first open, and show all MenuItems when the user explicitly asks for it, either by clicking on the double arrow at the bottom or waiting for a certain amount of time.
I'm specifically looking for feedback on how I should approach this problem: any thoughts are appreciated!
Since you're working on an XmlEditor. It will be a problem for this case. Try using a different editor.

How to create a shape acting like a textbox?

Please refer this control
http://www.charlespetzold.com/blog/2009/10/Using-Text-Outlines-in-Silverlight.html
The formattedtext control is a shape which helps to generate the shape of the text with proper geometry. I would like to make this control act like a text box with cursors and features like typing in from keyboard.
Right now I use an invisible text box with a formattedtext control to act like that. But the cursor position always creates a problem when the size of the text is not equal to the size of the rendered text as shape.
Can anyone please show the way to achieve this.
Well, I built a syntax highlighting textbox using the method you describes.
Actually, at first I wanted to rebuilt everything too, but I thought : I have to build the caret fonctionnalities, the selection brush, manage a lot of different events, like selection with mouse or keyboard, deletion, Copy/Cut/Paste, etc etc...
That's a LOT of work, and windows users are used to select text in textboxes for instance, so this complex implementation cannot be left unimplemented. We must follow some Microsoft guidance on how a textbox must feel.
Actually, I think that building a new textbox from scratch is not the way to go. I suggest you to continue on your current method. If you have different fonts in the same textbox, use a RichTextBox, and handle the font changes in the textbox as well as in the formatted text.
Also, a good think to implement is to only draw the visible text with the formattedtext (but only if the user can write several hundreds of text lines).

Resources