1 #ifndef STANDARDMODULEGUI_HPP
2 #define STANDARDMODULEGUI_HPP
33 static std::shared_ptr<StandardModuleGUI>
CreateFromXML(std::shared_ptr<Window> w, std::string xml_data, std::shared_ptr<Module> mod);
34 static std::shared_ptr<StandardModuleGUI>
CreateFromTemplate(std::shared_ptr<Window> w, std::shared_ptr<Module> mod);
54 virtual std::shared_ptr<UIWidget>
CustomFindChild(
ID id)
const override{
return main_margin->FindChild(
id);}
58 virtual inline std::shared_ptr<UIWidget>
Widget()
override{
59 return shared_from_this();
65 void LoadFromXML(std::string xml_data, std::shared_ptr<ModuleTemplate> templ);
66 void LoadFromTemplate(std::shared_ptr<ModuleTemplate> templ);
67 void UpdateMinimalSize();
69 bool highlight =
false;
70 std::shared_ptr<UILabel> caption;
72 std::shared_ptr<UIMarginBox> main_margin;
73 std::shared_ptr<UIVBox> main_box;
74 std::shared_ptr<UIHBox> inlets_box;
75 std::shared_ptr<UIHBox> outlets_box;
76 std::shared_ptr<UIVBox> params_box;
78 std::shared_ptr<SDLTextTexture> id_texture =
nullptr;
83 std::string iolet_name;
92 static std::shared_ptr<IOConn> Create(std::weak_ptr<Window> w, std::string
id, std::string name,
VertAlignment align,
Color c);
94 void SetBorderColor(
Color c);
100 static const int width, height;
103 IOConn(std::weak_ptr<Window> w, std::string id_, std::string name,
VertAlignment align_,
Color c);
105 inline Size2D GetRectSize()
const {
return Size2D(width,height);}
110 std::map<UIWidget::ID, std::shared_ptr<IOConn>> inlets;
111 std::map<UIWidget::ID, std::shared_ptr<IOConn>> outlets;
112 std::map<UIWidget::ID, std::shared_ptr<UISlider>> param_sliders;
115 void UpdateWhatIsHereCache();
116 std::list<std::pair<Rect, WhatIsHere>> rect_cache;
122 #endif //STANDARDMODULEGUI_HPP
virtual void CustomMouseLeave(Point2D pos) override
Definition: StandardModuleGUI.hpp:43
VertAlignment
Definition: Utilities.hpp:149
void OnChildRequestedSizeChanged() override
Definition: UIContainer.hpp:27
Definition: DrawContext.hpp:65
Point2D_< int > Point2D
Definition: Utilities.hpp:35
MouseButton
Definition: Utilities.hpp:190
virtual Point2D GetChildPos() const
Definition: StandardModuleGUI.hpp:56
virtual Point2D WhereIsParamRelativeOutlet(std::string outlet) override
virtual Point2D WhereIsParamAbsoluteOutlet(std::string outlet) override
virtual void SliderDragStart(UIWidget::ID id) override
Definition: ModuleGUI.hpp:40
void CustomResize(Size2D s) override
virtual Point2D WhereIsParamInlet(std::string inlet) override
Definition: Alertable.hpp:26
virtual void SliderDragStep(UIWidget::ID id, Point2D_< float > current_offset) override
virtual void CustomMouseMotion(Point2D pos1, Point2D pos2) override
Definition: StandardModuleGUI.hpp:41
Definition: StandardModuleGUI.hpp:31
virtual bool CustomMousePress(bool down, MouseButton b, Point2D pos) override
Definition: StandardModuleGUI.hpp:40
virtual std::shared_ptr< UIWidget > Widget() override
Definition: StandardModuleGUI.hpp:58
static std::shared_ptr< StandardModuleGUI > CreateFromXML(std::shared_ptr< Window > w, std::string xml_data, std::shared_ptr< Module > mod)
virtual WhatIsHere GetWhatIsHere(Point2D) const override
virtual void OnInletsChanged()
static std::shared_ptr< StandardModuleGUI > CreateFromTemplate(std::shared_ptr< Window > w, std::shared_ptr< Module > mod)
virtual Point2D WhereIsInlet(std::string inlet) override
virtual std::string GetIoletParamID(UIWidget::ID) const override
virtual Point2D WhereIsOutlet(std::string outlet) override
StandardModuleGUI(std::shared_ptr< Window > w, std::shared_ptr< Module > mod)
Definition: StandardModuleGUI.hpp:63
void SetHighlight(bool) override
virtual void SliderDragEnd(UIWidget::ID id) override
void CustomDraw(DrawContext &c) override
virtual void CustomMouseEnter(Point2D pos) override
Definition: StandardModuleGUI.hpp:42
virtual std::shared_ptr< UIWidget > CustomFindChild(ID id) const override
Definition: StandardModuleGUI.hpp:54
Definition: Utilities.hpp:40
void OnChildVisibilityChanged() override