The CEditor class is the base class for all the editor windows such as every tool from the Tools menu, every asset editor, and most dockable windows in the Sandbox.
You can find the CEditor interface in the following file: Sandbox/Plugins/EditorCommon/EditorFramework/Editor.h
CEditor provides numerous services and features intended to be used by every tool in the Sandbox. Here is a non-exhaustive list of features it supports:
CEditor and its derivates are the main means of providing a framework to build new tools within Sandbox. While you can choose to operate outside of this framework, we recommend to use it in order to ensure consistency of all the tools, but also because you will benefit from any additions, bugfixes, and improvements we make to this system simply by inheriting from it.
In order to create a new tool window, you must inherit from CEditor, and use its numerous services and advanced features to create your tool. There are however more specialized versions of CEditor for specific purposes that are recommended to use.
One most basic example of a CDockableEditor can be found in PlaygroundDockable.h/cpp
Here is a code sample to demonstrate how to declare and register a new editor window:
class CExampleEditor : public CDockableEditor
{
public:
CExampleEditor()
{
auto exampleContent = new QWidget();
/*build the content of your editor*/
SetContent(exampleContent);
}
~CExampleEditor() {}
virtual const char* GetEditorName() const override { return "Example"; };
};
//Register the Example Editor
//REGISTER_VIEWPANE_FACTORY(CExampleEditor, "Example", "", false);