Restore custom toolbar's position in a plugin

Restore custom toolbar's position in a plugin

Anonymous
Not applicable
759 Views
4 Replies
Message 1 of 5

Restore custom toolbar's position in a plugin

Anonymous
Not applicable

What is the best practice for restoring the position of a custom toolbar after Max has been restarted?

I see that the toolbar's config gets written to the user's workspace .cuix file when closing Max. But what do I need to do to restore these settings?

The SDK samples do not really give a hint on how to restore that.

 

It's a GUP-type plugin. The toolbar ist created with these commands

 

CreateCUIFrameWindow()

GetICUIFrame()

CreateWindow(CUSTTOOLBARWINDOWCLASS,....)

LinkToCUIFrame()

Toolbar->AddTool()

DockCUIWindow()

 

Thanks, Elio

 

760 Views
4 Replies
Replies (4)
Message 2 of 5

petkus09
Participant
Participant

I'm currently working with this problem. Looked through .cuix file syntax. The key point lies with the toolbar's <window> tag's attribute 'type'.
To restore the toolbar after the restart, it's value should be set to type="T" .
Currently my custom toolbars have type="N" property, which is not restored after the restart or by loading custom UI file.

The problem is how to change the type property from N to T in code.

 

I hope someone has some insight.

0 Likes
Message 3 of 5

petkus09
Participant
Participant

Wew. Found the answer at http://forums.autodesk.com/t5/programming/custom-toolbar-to-appear-when-right-clicking-on-main-toolb...

 

in C#, you change SystemWindow property to true for frame object.

 

Man Happy

0 Likes
Message 4 of 5

Anonymous
Not applicable

Wow, thank you so much. That did it.

You made my day!

0 Likes
Message 5 of 5

petkus09
Participant
Participant

No problem. Don't forget to close the topic.

0 Likes