Browse Source

Debugger did not always receive mouse input

Michael Ragazzon 6 years ago
parent
commit
a22a8df0bf

+ 3 - 0
Source/Debugger/ElementInfo.cpp

@@ -56,6 +56,9 @@ bool ElementInfo::Initialise()
 	SetInnerRML(info_rml);
 	SetInnerRML(info_rml);
 	SetId("rmlui-debug-info");
 	SetId("rmlui-debug-info");
 
 
+	AddEventListener(Core::EventId::Click, this);
+	AddEventListener(Core::EventId::Mouseover, this);
+
 	Core::StyleSheet* style_sheet = Core::Factory::InstanceStyleSheetString(Core::String(common_rcss) + Core::String(info_rcss));
 	Core::StyleSheet* style_sheet = Core::Factory::InstanceStyleSheetString(Core::String(common_rcss) + Core::String(info_rcss));
 	if (style_sheet == NULL)
 	if (style_sheet == NULL)
 		return false;
 		return false;

+ 2 - 2
Source/Debugger/ElementInfo.h

@@ -47,7 +47,7 @@ class ElementInfo : public Core::ElementDocument, public Core::EventListener
 {
 {
 public:
 public:
 	ElementInfo(const Core::String& tag);
 	ElementInfo(const Core::String& tag);
-	virtual ~ElementInfo();
+	~ElementInfo();
 
 
 	/// Initialises the info element.
 	/// Initialises the info element.
 	/// @return True if the element initialised successfully, false otherwise.
 	/// @return True if the element initialised successfully, false otherwise.
@@ -62,7 +62,7 @@ public:
 	void RenderSourceElement();
 	void RenderSourceElement();
 
 
 protected:
 protected:
-	virtual void ProcessEvent(Core::Event& event) override;
+	void ProcessEvent(Core::Event& event) override;
 
 
 private:
 private:
 	void SetSourceElement(Core::Element* new_source_element);
 	void SetSourceElement(Core::Element* new_source_element);

+ 2 - 0
Source/Debugger/ElementLog.cpp

@@ -99,6 +99,8 @@ bool ElementLog::Initialise()
 	SetStyleSheet(style_sheet);
 	SetStyleSheet(style_sheet);
 	style_sheet->RemoveReference();
 	style_sheet->RemoveReference();
 
 
+	AddEventListener(Core::EventId::Click, this);
+
 	// Create the log beacon.
 	// Create the log beacon.
 	beacon = GetContext()->CreateDocument();
 	beacon = GetContext()->CreateDocument();
 	if (beacon == NULL)
 	if (beacon == NULL)

+ 3 - 3
Source/Debugger/ElementLog.h

@@ -46,7 +46,7 @@ class ElementLog : public Core::ElementDocument, public Core::EventListener
 {
 {
 public:
 public:
 	ElementLog(const Core::String& tag);
 	ElementLog(const Core::String& tag);
-	virtual ~ElementLog();
+	~ElementLog();
 
 
 	/// Initialises the log element.
 	/// Initialises the log element.
 	/// @return True if the element initialised successfully, false otherwise.
 	/// @return True if the element initialised successfully, false otherwise.
@@ -56,8 +56,8 @@ public:
 	void AddLogMessage(Core::Log::Type type, const Core::String& message);
 	void AddLogMessage(Core::Log::Type type, const Core::String& message);
 
 
 protected:
 protected:
-	virtual void OnRender() override;
-	virtual void ProcessEvent(Core::Event& event) override;
+	void OnRender() override;
+	void ProcessEvent(Core::Event& event) override;
 
 
 private:
 private:
 	struct LogMessage
 	struct LogMessage

+ 6 - 7
Source/Debugger/Plugin.h

@@ -57,7 +57,7 @@ class Plugin : public Core::Plugin, public Core::EventListener
 {
 {
 public:
 public:
 	Plugin();
 	Plugin();
-	virtual ~Plugin();
+	~Plugin();
 
 
 	/// Initialises the debugging tools into the given context.
 	/// Initialises the debugging tools into the given context.
 	/// @param[in] context The context to load the tools into.
 	/// @param[in] context The context to load the tools into.
@@ -80,22 +80,22 @@ public:
 	void Render();
 	void Render();
 
 
 	/// Called when RmlUi shuts down.
 	/// Called when RmlUi shuts down.
-	virtual void OnShutdown();
+	void OnShutdown() override;
 
 
 	/// Called whenever a RmlUi context is destroyed.
 	/// Called whenever a RmlUi context is destroyed.
 	/// @param[in] context The destroyed context.
 	/// @param[in] context The destroyed context.
-	virtual void OnContextDestroy(Core::Context* context);
+	void OnContextDestroy(Core::Context* context) override;
 
 
 	/// Called whenever an element is created.
 	/// Called whenever an element is created.
 	/// @param[in] element The created element.
 	/// @param[in] element The created element.
-	virtual void OnElementCreate(Core::Element* element);
+	void OnElementCreate(Core::Element* element) override;
 	/// Called whenever an element is destroyed.
 	/// Called whenever an element is destroyed.
 	/// @param[in] element The destroyed element.
 	/// @param[in] element The destroyed element.
-	virtual void OnElementDestroy(Core::Element* element);
+	void OnElementDestroy(Core::Element* element) override;
 
 
 	/// Event handler for events from the debugger elements.
 	/// Event handler for events from the debugger elements.
 	/// @param[in] event The event to process.
 	/// @param[in] event The event to process.
-	virtual void ProcessEvent(Core::Event& event) override;
+	void ProcessEvent(Core::Event& event) override;
 
 
 	/// Access the singleton instance of the debugger
 	/// Access the singleton instance of the debugger
 	/// @return NULL or an instance of the plugin
 	/// @return NULL or an instance of the plugin
@@ -106,7 +106,6 @@ private:
 	bool LoadMenuElement();
 	bool LoadMenuElement();
 	bool LoadInfoElement();
 	bool LoadInfoElement();
 	bool LoadLogElement();
 	bool LoadLogElement();
-	bool LoadHookElement();
 
 
 	// Release all loaded elements
 	// Release all loaded elements
 	void ReleaseElements();
 	void ReleaseElements();