30 struct CustomNode :
public ImFlow::BaseNode
35 setStyle(ImFlow::NodeStyle::brown());
36 addIN<int>(
"in<int>",
"int", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
38 addOUT<int>(
"out<int>",
"int", ImFlow::PinStyle::blue())
47 struct Custom2Node :
public ImFlow::BaseNode
49 explicit Custom2Node()
52 setStyle(ImFlow::NodeStyle::brown());
53 addIN<int>(
"in<int>",
"int", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
54 addIN<float>(
"in<float>",
"float", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
56 addOUT<int>(
"out<int>",
"int", ImFlow::PinStyle::blue())
62 addOUT<float>(
"out<float>",
"float", ImFlow::PinStyle::blue())
73 ImGui::Text(
"%s",
"some text here");
79 auto callback = [
this]()
84 static ImGuiTextFilter filter_;
87 ImGui::DrawItemActivityOutline();
90 ImGui::BeginChild(
"COMPONENT_MENU_CONTEXT", ImVec2(ImGui::GetContentRegionAvail().
x,
size));
95 std::function<void()> factory;
98 std::vector<node_factory> nodes{
102 flow_.placeNode<CustomNode>();
107 flow_.placeNode<Custom2Node>();
111 for(
const auto& factory : nodes)
113 if(!filter_.PassFilter(factory.name.c_str()))
116 if(ImGui::Selectable(factory.name.c_str()))
120 ImGui::CloseCurrentPopup();
127 flow_.rightClickPopUpContent(
128 [
this, callback](ImFlow::BaseNode* node)
133 flow_.droppedLinkPopUpContent(
134 [
this, callback](ImFlow::Pin* dragged)
139 flow_.addNode<CustomNode>({});