Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Creating a new tab in a plugin

Hey everyone!

I'm having a problem with creating a tabbed window that appears docked in the level editor, ala the scene outliner. I've gone over some of the relevant source code, but it seems that what happens is that the scene outliner is registered to the level editor's tab manager during the initialization of the level editor (i.e. hardcoded into the source itself, and not created as the result of plugging into an extensibility point).

My understanding of a tab manager is that it is an object that is responsible for the instantiation (via a callback) of each tab, as well as its orientation and "dockedness" in relation to other tabs. It seems you have to register a tab with a unique string and a special callback, then you create the tab by telling the manager to instantiate a certain tab ID. So far so good...

But, since the level editor's tab manager is null when my module starts, I can't register a tab with it. When I try to create a tab using the level editor's tab manager (later, as a result of pressing a button I added to the UI), but that tab is registered with the global tab manager, I get an "unknown tab" tab in the level editor. Which makes sense of course; I wouldn't expect the tab managers to cascade tab definitions (but I had to try anyway).

So I seem to be stuck. I can think of a few possible solutions:

A) Can I create a new tab and parent it to the level editor? I've tried doing something like "newTab.SetParent(LevelManager.GetTab().GetParent())" but that has no effect (perhaps because LevelManager.GetTab().GetParent() returns the parent tab manager, i.e. the global tab manager).

B) Can I run code in my module after the level manager is created and fully loaded?

A third option is that I am completely missing the point somewhere, but I can't seem to find where that may be. Any guidance on this topic would be greatly appreciated.


Product Version: Not Selected
more ▼

asked Jun 25 '14 at 04:57 AM in C++ Programming

avatar image

1 1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Yes, you can run code in your module after the level manager is created and loaded. Though there doesn't appear to be an event you could use outside of a menu item, or button you register. Don't do (A).

You don't appear to be missing anything, you just appear to be the first person to have tried this from a plugin. I'll check in a fix to the level module that adds an event you can hook that will be fired when the tab manager is registered.

more ▼

answered Jun 25 '14 at 04:26 PM

avatar image

Nick Darnell ♦♦ STAFF
6k 77 37 151

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question