mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
HackStudio: Introduce a Tool class with subs CursorTool and WidgetTool
These will be used to draw out new widgets on a FormWidget, or in the case of CursorTool, to select and manipulate existing widgets.
This commit is contained in:
parent
a04ab219d1
commit
e87756424d
12 changed files with 166 additions and 0 deletions
23
DevTools/HackStudio/WidgetTool.h
Normal file
23
DevTools/HackStudio/WidgetTool.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tool.h"
|
||||
|
||||
class GWidgetClassRegistration;
|
||||
|
||||
class WidgetTool final : public Tool {
|
||||
public:
|
||||
explicit WidgetTool(FormEditorWidget& editor, const GWidgetClassRegistration& meta_class)
|
||||
: Tool(editor)
|
||||
, m_meta_class(meta_class)
|
||||
{
|
||||
}
|
||||
virtual ~WidgetTool() override {}
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "WidgetTool"; }
|
||||
virtual void on_mousedown(GMouseEvent&) override;
|
||||
virtual void on_mouseup(GMouseEvent&) override;
|
||||
virtual void on_mousemove(GMouseEvent&) override;
|
||||
|
||||
const GWidgetClassRegistration& m_meta_class;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue