Hot Door CORE Forum
Adding a flyout menu to a Tool - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: General discussion (http://hotdoorcore.com/forum/forumdisplay.php?fid=3)
+--- Thread: Adding a flyout menu to a Tool (/showthread.php?tid=314)



Adding a flyout menu to a Tool - zero - 04-19-2022

So i have seen this inside of other tools, where you have one single long click on a tool icon and can see a small flyout menu that has options for the tool type selection, or specific options to take on the tool. 

Even looking through the Tool and Annotator and other sample projects i cannot seem to find an example of this. I have tried using a Popup menu and dialog modal, but neither of these are the functionality that i would like. 

Just an example or any helpful documentation around this would be great, the ability to add this to my tool widget just seems to be alluding me. 

Any assistance is welcome and very much needed! I added some example images below as well.

Thanks everyone


RE: Adding a flyout menu to a Tool - Rick Johnson - 04-19-2022

I think what you're seeing is multiple tools in a set, which you can set up when initializing a tool.

Code:
Tool(
    const Tool& sameGroupAs_,
    const Tool* const sameSetAs_,
    const std::string& title_,
    const std::string& tip_,
    const IconResourceType iconType_,
    const int16_t lightIconID_,
    const int16_t darkIconID_,
    const Options options_ = DefaultOptions
);

 The Tool sample project is a good example of that.

Code:
this->__gearTool = hdi::core::Tool(
    hdi::core::Tool(),    // Not in same set as any other tool
    NULL,            // Not in same group as any other tool
    "Sample Gear Tool",
    "Sample Gear Tool - Used to generate simple gears",
    hdi::core::IconResourceTypePNGI,
    TS_GEAR_PNGI_RSRC_ID,
    TS_GEAR_DARK_PNGI_RSRC_ID
);

I just noticed that the Tool sample comments for group and set are swapped, based on what's in the header. If you wanted to add a second tool to this set, you'd initialize it something like this:

Code:
this->__pivotTool = hdi::core::Tool(
       this->__gearTool,    // in same group as existing tool
       &this->__gearTool,   // in same set as other tool
       "Pivot Tool",        // title
       "Pivot Tool companion to Gear Tool", // tool tip
       etc.

If you have multiple tools in your plugin, you'll probably want them to all be in the same group, even if they are not all "stacked" in the same set. If a users' toolbox is displayed in more than one column, having one tool in a group can result in a blank tool space displayed next to the actual one.

I hope this addresses your question. I'm sure others can add to or clarify this.


RE: Adding a flyout menu to a Tool - zero - 04-20-2022

Oh nice this is what i was looking for. interesting how it is just another tool in the group even though it resembles more of a panel style of presenting information. will give this a try and see what i can get to come out the other side. just want to create a simple menu that supports the tool and this seems like a good way to do it!