MeshLib Documentation
Loading...
Searching...
No Matches
MR::RibbonButtonDrawer Class Reference

class for drawing ribbon menu buttons More...

#include <MRRibbonButtonDrawer.h>

Classes

struct  ButtonItemWidth
 

Public Types

enum class  TextureType { Mono , Gradient , RainbowRect , Count }
 

Public Member Functions

MRVIEWER_API bool GradientCheckboxItem (const MenuItemInfo &item, bool *value) const
 draw gradient checkbox with icon (for menu item)
 
MRVIEWER_API ButtonItemWidth calcItemWidth (const MenuItemInfo &item, DrawButtonParams::SizeType sizeType) const
 
MRVIEWER_API void drawButtonItem (const MenuItemInfo &item, const DrawButtonParams &params) const
 draw item button
 
MRVIEWER_API void drawCustomButtonItem (const MenuItemInfo &item, const CustomButtonParameters &customParam, const DrawButtonParams &params) const
 draw item button
 
MRVIEWER_API void drawButtonIcon (const MenuItemInfo &item, const DrawButtonParams &params) const
 draw item button icon
 
MRVIEWER_API bool drawTabArrawButton (const char *icon, const ImVec2 &size, float iconSize)
 draw custom styled button
 
MRVIEWER_API void setMonochrome (const std::optional< Color > &color)
 if set color then instead of multicolored icons will be drawn with this color
 
void setOnPressAction (std::function< void(std::shared_ptr< RibbonMenuItem >, const std::string &)> action)
 set reaction on press item button
 
void setGetterRequirements (std::function< std::string(std::shared_ptr< RibbonMenuItem >)> getterRequirements)
 set function to get requirements for activate item
 
void setMenu (RibbonMenu *menu)
 
void setShortcutManager (const ShortcutManager *shortcutManager)
 
void setScaling (float scaling)
 

Static Public Member Functions

static MRVIEWER_API void InitGradientTexture ()
 
static MRVIEWER_API std::unique_ptr< ImGuiImage > & GetTexture (TextureType type)
 
static MRVIEWER_API bool CustomCollapsingHeader (const char *label, ImGuiTreeNodeFlags flags=0, int issueCount=0)
 

Detailed Description

class for drawing ribbon menu buttons

Member Enumeration Documentation

◆ TextureType

Enumerator
Mono 
Gradient 
RainbowRect 
Count 

Member Function Documentation

◆ calcItemWidth()

MRVIEWER_API ButtonItemWidth MR::RibbonButtonDrawer::calcItemWidth ( const MenuItemInfo & item,
DrawButtonParams::SizeType sizeType ) const

◆ CustomCollapsingHeader()

static MRVIEWER_API bool MR::RibbonButtonDrawer::CustomCollapsingHeader ( const char * label,
ImGuiTreeNodeFlags flags = 0,
int issueCount = 0 )
static

draw custom collapsing header if issueCount is greater than zero, so many red dots will be displayed after text

◆ drawButtonIcon()

MRVIEWER_API void MR::RibbonButtonDrawer::drawButtonIcon ( const MenuItemInfo & item,
const DrawButtonParams & params ) const

draw item button icon

◆ drawButtonItem()

MRVIEWER_API void MR::RibbonButtonDrawer::drawButtonItem ( const MenuItemInfo & item,
const DrawButtonParams & params ) const

draw item button

◆ drawCustomButtonItem()

MRVIEWER_API void MR::RibbonButtonDrawer::drawCustomButtonItem ( const MenuItemInfo & item,
const CustomButtonParameters & customParam,
const DrawButtonParams & params ) const

draw item button

◆ drawTabArrawButton()

MRVIEWER_API bool MR::RibbonButtonDrawer::drawTabArrawButton ( const char * icon,
const ImVec2 & size,
float iconSize )

draw custom styled button

◆ GetTexture()

static MRVIEWER_API std::unique_ptr< ImGuiImage > & MR::RibbonButtonDrawer::GetTexture ( TextureType type)
static

◆ GradientCheckboxItem()

MRVIEWER_API bool MR::RibbonButtonDrawer::GradientCheckboxItem ( const MenuItemInfo & item,
bool * value ) const

draw gradient checkbox with icon (for menu item)

◆ InitGradientTexture()

static MRVIEWER_API void MR::RibbonButtonDrawer::InitGradientTexture ( )
static

◆ setGetterRequirements()

void MR::RibbonButtonDrawer::setGetterRequirements ( std::function< std::string(std::shared_ptr< RibbonMenuItem >)> getterRequirements)
inline

set function to get requirements for activate item

◆ setMenu()

void MR::RibbonButtonDrawer::setMenu ( RibbonMenu * menu)
inline

◆ setMonochrome()

MRVIEWER_API void MR::RibbonButtonDrawer::setMonochrome ( const std::optional< Color > & color)

if set color then instead of multicolored icons will be drawn with this color

◆ setOnPressAction()

void MR::RibbonButtonDrawer::setOnPressAction ( std::function< void(std::shared_ptr< RibbonMenuItem >, const std::string &)> action)
inline

set reaction on press item button

◆ setScaling()

void MR::RibbonButtonDrawer::setScaling ( float scaling)
inline

◆ setShortcutManager()

void MR::RibbonButtonDrawer::setShortcutManager ( const ShortcutManager * shortcutManager)
inline

The documentation for this class was generated from the following file: