Object with editing windows (2nd attempt)
May 5, 2011 at 1:00pm
Object with editing windows (2nd attempt)
I did a quick search in the archives and I found a few threads asking the same information, but all with no answer.
I have an object that displays an editing window, pretty much like coll.
I would like to achieve the same behavior, but unfortunately when my window is open the New View, Presentation, Zoom In and Zoom Out items are still editable.
How to dim those out as well. ?
The relevant code snippet is:
Thanks for any help.
May 5, 2011 at 4:01pm
Here (Max 5.1.8, OSX 10.6.7), simpletext and coll behave exactly the same way with respect to the patcher buttons – they’re grayed out when the patcher window is in background, and get editable again when the patcher goes to foreground…
May 5, 2011 at 4:37pm
I don’t understand your reply…
I am creating an object with an editing window. You open the editing window by double-clicking on the object. It’s the same behavior implemented in the coll object. You probably know already that to create an editing window, you basically create a new patcher window. Coll does that but with the exception that – in order to avoid any type of user editing operation – the new patcher window has some attributes set that make it uneditable. When I say uneditable I mean that the usual operations that you can perform in a patcher such as creating a new object, create a new view, zooming in or out, etc.. all those operation are unavailable in this patcher window. You can only type text in it. In the case of coll that’s achieved with the help of a textfield, but in my case I don’t even need that. I just want to make my patcher window uneditable. I would like to know the messages I need to send to the patcher or attributes I need to set in order to achieve that.
More specifically, the items I want to gray out are in the View menu and are:
Those items are always grayed out in the coll editing window, no matter if the window is in the background or foreground. But in my window they are not grayed out, so the user could potentially zoom in, zoom out, create a new view, etc… I don’t want to give that option to the user.
Hope this clarifies my question but if it doesn’t please don’t hesitate to let me know.
May 5, 2011 at 6:27pm
Now I see what you mean, actually it was quite clear from your code. My bad, I looked at it too hastily – I was assuming you were talking about a text editor window (which is what coll displays), not a patcher window.
In this case I can’t really help you. The only suggestion I can give you is to try looking inside the c_messlist and c_attributes fields of the t_class of jpatcher… I have found some interesting things this way!
May 5, 2011 at 6:40pm
Don’t worry, no problem at all.
Yes, your suggestion is what I have done already and – even if sometimes it works – this time around I couldn’t find anything.
In any case, thanks anyway…
May 10, 2011 at 9:15pm
Here is a small snippet from the File Browser:
sprintf(parsebuf,"@defrect %.6f %.6f %.6f %.6f @title "File Browser" @bgcolor %.6f %.6f %.6f %.6f @presentation 0 @toolbarid browserwindow", x->windowrect.x, x->windowrect.y, s_browserwindow_rect.width, s_browserwindow_rect.height, bg.red, bg.green, bg.blue, bg.alpha); atom_setparse(&ac, &av, parsebuf); attr_args_dictionary(d, ac, av);
The key here is that the @toolbarid attribute is set to something other than patcher. Max’s menus will then no longer treat your patcher as a patcher.
We haven’t documented any of this material about creating custom editor windows like this, and we’re quite busy at the moment, so you are mostly going to be on your own for this custom-editor endeavor. Hopefully this small snippet will help though!
May 18, 2011 at 5:05pm
thank you, but I can’t produce the behavior you described.
What the @toolbarid attribute does is to change the small action icons at the bottom of various windows according to the “toolbars” category described in the maxinterface.json file, but the Max menu does not gray out any items.
Here is the relevant code I have:
Sorry to keep bothering, I feel I am very close…
Thanks a lot.
You must be logged in to reply to this topic.