TDME2  1.9.200
FontTabView.cpp
Go to the documentation of this file.
2 
3 #include <memory>
4 #include <string>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/engine/Engine.h>
9 #include <tdme/gui/GUI.h>
14 #include <tdme/utilities/Console.h>
16 
17 using std::unique_ptr;
18 using std::string;
19 using std::make_unique;
20 
22 
25 using tdme::gui::GUI;
31 
32 FontTabView::FontTabView(EditorView* editorView, const string& tabId, GUIScreenNode* screenNode)
33 {
34  this->editorView = editorView;
35  this->tabId = tabId;
36  this->screenNode = screenNode;
37  this->popUps = editorView->getPopUps();
38  engine = unique_ptr<Engine>(Engine::createOffScreenInstance(512, 512, true, false, false));
39  engine->setSceneColor(Color4(39.0f / 255.0f, 39.0f / 255.0f, 39.0f / 255.0f, 1.0f));
40  engine->getGUI()->addScreen(screenNode->getId(), screenNode);
41  engine->getGUI()->addRenderScreen(screenNode->getId());
42 }
43 
45 }
46 
48 {
49  engine->getGUI()->handleEvents();
50 }
51 
53 {
54  engine->display();
55  engine->getGUI()->render();
56 }
57 
59 {
60  try {
61  fontTabController = make_unique<FontTabController>(this);
64  } catch (Exception& exception) {
65  Console::println("FontTabView::initialize(): An error occurred: " + string(exception.what()));
66  }
67  // TODO: load settings
68  // TODO: reloadTabOutliner
69 }
70 
72 {
73  engine->dispose();
74 }
75 
77 }
78 
80  return engine.get();
81 }
82 
84  fontTabController->setOutlinerAddDropDownContent();
85  fontTabController->setOutlinerContent();
88 }
89 
92 }
93 
95  fontTabController->setOutlinerContent();
97 }
98 
Color 4 definition class.
Definition: Color4.h:18
Engine main class.
Definition: Engine.h:131
GUI module class.
Definition: GUI.h:64
const string & getId()
Definition: GUINode.h:339
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
void addTooltipRequestListener(GUITooltipRequestListener *listener)
Add tooltip request listener.
void restoreOutlinerState(const TabView::OutlinerState &outlinerState)
Restore outliner state.
void storeOutlinerState(TabView::OutlinerState &outlinerState)
Store outliner state.
void setDetailsContent(const string &xml)
Set details content.
void dispose() override
Disposes the view.
Definition: FontTabView.cpp:71
void display() override
Renders the view.
Definition: FontTabView.cpp:52
void reloadOutliner() override
Reload outliner.
Definition: FontTabView.cpp:94
void initialize() override
Initiates the view.
Definition: FontTabView.cpp:58
void deactivate() override
Deactivate.
Definition: FontTabView.cpp:90
void handleInputEvents() override
Handle input events that have not yet been processed.
Definition: FontTabView.cpp:47
void updateRendering() override
Update rendering.
Definition: FontTabView.cpp:76
unique_ptr< FontTabController > fontTabController
Definition: FontTabView.h:44
EditorScreenController * getScreenController()
Definition: EditorView.h:69
Console class.
Definition: Console.h:29
std::exception Exception
Exception base class.
Definition: Exception.h:18