Skip to content

Commit bbfcc18

Browse files
committed
Separate control managers handling from EditorApp and refactor
1 parent 9856c1b commit bbfcc18

File tree

7 files changed

+660
-483
lines changed

7 files changed

+660
-483
lines changed

Editor/EditorApp.cpp

Lines changed: 0 additions & 372 deletions
Large diffs are not rendered by default.

Editor/EditorApp.h

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ namespace RTEGUI {
9696
BITMAP *m_ZoomBuffer = nullptr;
9797
std::unique_ptr<AllegroScreen> m_Screen = nullptr;
9898
std::unique_ptr<AllegroInput> m_Input = nullptr;
99-
std::unique_ptr<GUIControlManager> m_ControlManager = nullptr;
100-
std::unique_ptr<GUIControlManager> m_EditorManager = nullptr;
101-
std::unique_ptr<GUIPropertyPage> m_PropertyPage = nullptr;
102-
std::unique_ptr<GUIListBox> m_CollectionBoxList = nullptr;
103-
std::unique_ptr<GUIListBox> m_ControlsInActiveCollectionBoxList = nullptr;
104-
std::unique_ptr<GUICollectionBox> m_EditorBase = nullptr;
105-
std::unique_ptr<GUICollectionBox> m_LeftColumn = nullptr;
106-
std::unique_ptr<GUICollectionBox> m_RightColumn = nullptr;
10799

108100
std::array<int, KEY_MAX> m_KeyStates;
109101
std::array<int, KEY_MAX> m_PrevKeyStates;
@@ -115,109 +107,6 @@ namespace RTEGUI {
115107
// Editor setup
116108
bool m_UnsavedChanges = false;
117109
bool m_Zoom = false;
118-
int m_WorkspacePosX = 320;
119-
int m_WorkspacePosY = 60;
120-
int m_WorkspaceWidth = 640;
121-
int m_WorkspaceHeight = 480;
122-
123-
#pragma region Creation
124-
/// <summary>
125-
/// Create all the editor's GUI elements and makes it ready for use.
126-
/// </summary>
127-
void CreateEditorLayout();
128-
#pragma endregion
129-
130-
/// <summary>
131-
///
132-
/// </summary>
133-
void AddItemToCollectionBoxList(GUIControl *control, const std::string &indent) const;
134-
135-
/// <summary>
136-
///
137-
/// </summary>
138-
void PopulateCollectionBoxList() const;
139-
140-
/// <summary>
141-
///
142-
/// </summary>
143-
void PopulateCollectionBoxChildrenList(GUICollectionBox *collectionBox) const;
144-
145-
/// <summary>
146-
///
147-
/// </summary>
148-
void SelectActiveControlInList() const;
149-
150-
/// <summary>
151-
/// Checks if a control is under the mouse point.
152-
/// </summary>
153-
/// <param name="Parent"></param>
154-
/// <param name="MouseX"></param>
155-
/// <param name="MouseY"></param>
156-
/// <returns>GUIControl. NULL if no control under the mouse.</returns>
157-
GUIControl *ControlUnderMouse(GUIControl *parent, int mousePosX, int mousePosY);
158-
159-
/// <summary>
160-
/// Checks if a control's handle is under the mouse point.
161-
/// </summary>
162-
/// <param name="Control"></param>
163-
/// <param name="MouseX"></param>
164-
/// <param name="MouseY"></param>
165-
/// <returns>Handle index. -1 if no handle under the mouse.</returns>
166-
int HandleUnderMouse(GUIControl *control, int mousePosX, int mousePosY) const;
167-
168-
/// <summary>
169-
/// Checks if the mouse point is inside a box.
170-
/// </summary>
171-
/// <param name="MouseX"></param>
172-
/// <param name="MouseY"></param>
173-
/// <param name="X"></param>
174-
/// <param name="Y"></param>
175-
/// <param name="Width"></param>
176-
/// <param name="Height"></param>
177-
/// <returns>True/False.</returns>
178-
bool MouseInsideBox(int mousePosX, int mousePosY, int xPos, int yPos, int width, int height) const;
179-
180-
181-
#pragma region GUI Element Creation
182-
/// <summary>
183-
/// Create a new GUI element in the workspace.
184-
/// </summary>
185-
/// <param name="editorEvent">The editor event (button press) to create the element from.</param>
186-
void AddNewControl(GUIEvent &editorEvent);
187-
188-
/// <summary>
189-
/// Generates a name for a new GUI element based on the element type.
190-
/// </summary>
191-
/// <param name="strControlType">Control Type.</param>
192-
/// <returns></returns>
193-
std::string GenerateControlName(std::string controlType) const;
194-
#pragma endregion
195-
196-
#pragma region Updates
197-
/// <summary>
198-
/// Updates the list of active top and sub level CollectionBoxes found in the workspace.
199-
/// </summary>
200-
void UpdateCollectionBoxList();
201-
202-
/// <summary>
203-
/// Updates the snap grid size.
204-
/// </summary>
205-
/// <param name="editorEvent">The editor event to get update info from.</param>
206-
void UpdateGridSize(GUIEvent &editorEvent);
207-
208-
/// <summary>
209-
/// Updates the properties of an element in the workspace.
210-
/// </summary>
211-
/// <param name="control">The element to update properties for.</param>
212-
/// <param name="setUnsavedChanges">Whether the editor should ask to save changes before quitting.</param>
213-
void UpdateControlProperties(GUIControl *control, bool setUnsavedChanges = true);
214-
215-
/// <summary>
216-
/// Updates the property page in the left column with all the properties of the currently selected element.
217-
/// </summary>
218-
/// <param name="editorEvent">The editor event to get update info from.</param>
219-
void UpdatePropertyPage(GUIEvent &editorEvent);
220-
#pragma endregion
221110

222111
#pragma region Input Handling
223112
/// <summary>

0 commit comments

Comments
 (0)