FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::ImUtil Namespace Reference

Enumerations

enum class  ButtonRowResult { None , Primary , Secondary , Tertiary }
 Identifies which button was pressed in a button row. More...

Functions

void SetupDefaultLayout ()
 Sets up the default ImGui layout in-case there's no user-defined one.
float ButtonWidth (const char *label)
 Returns the width needed to render a button with the given label.
void AlignButtonsRight (float totalWidth)
 Right-aligns the next row of buttons within the current content region.
bool EnterPressed ()
 Returns true when Enter or keypad Enter is pressed this frame.
bool EscPressed ()
 Returns true when Escape is pressed this frame.
ButtonRowResult ConfirmButtons (const char *primary, const char *secondary, const char *tertiary=nullptr)
 Renders CONFIRM buttons for popups.
ButtonRowResult OkCancelButtons ()
 Renders an OK/Cancel button row.
ButtonRowResult YesNoButtons ()
 Renders a Yes/No button row.
ButtonRowResult YesNoCancelButtons ()
 Renders a Yes/No/Cancel button row.
ButtonRowResult CloseOkButtons ()
 Renders an OK/Close button row.
ButtonRowResult ExportCloseButtons ()
 Renders an Export/Close button row.
bool SingleButtonRow (const char *label)
 Renders a single right-aligned button.
bool OkButton ()
 Renders a single OK button.
bool CloseButton ()
 Renders a single Close button.
ImGuiKey GetAnyReleasedKey ()
 Returns the first non-modifier key released this frame.
const char * GetUsername ()
 Small util function for fetching the current users' username. Used for filling out the animation author field by default.

Variables

constexpr char s_DefaultLayout []

Enumeration Type Documentation

◆ ButtonRowResult

Identifies which button was pressed in a button row.

Enumerator
None 
Primary 
Secondary 
Tertiary 

Function Documentation

◆ AlignButtonsRight()

void FuncDoodle::ImUtil::AlignButtonsRight ( float totalWidth)
inline

Right-aligns the next row of buttons within the current content region.

Parameters
totalWidthTotal width of the button row.

◆ ButtonWidth()

float FuncDoodle::ImUtil::ButtonWidth ( const char * label)
inline

Returns the width needed to render a button with the given label.

Parameters
labelButton text.

◆ CloseButton()

bool FuncDoodle::ImUtil::CloseButton ( )
inline

Renders a single Close button.

Returns
Whether the button was pressed.

◆ CloseOkButtons()

ButtonRowResult FuncDoodle::ImUtil::CloseOkButtons ( )
inline

Renders an OK/Close button row.

Returns
Which button the user pressed.

◆ ConfirmButtons()

ButtonRowResult FuncDoodle::ImUtil::ConfirmButtons ( const char * primary,
const char * secondary,
const char * tertiary = nullptr )
inline

Renders CONFIRM buttons for popups.

Parameters
primaryLabel for the primary action button.
secondaryLabel for the secondary action button.
tertiaryOptional label for the tertiary action button.
Returns
ButtonRowResult corresponding to the button clicked by the user

◆ EnterPressed()

bool FuncDoodle::ImUtil::EnterPressed ( )
inline

Returns true when Enter or keypad Enter is pressed this frame.

Returns
Whether an Enter key was pressed this frame.

◆ EscPressed()

bool FuncDoodle::ImUtil::EscPressed ( )
inline

Returns true when Escape is pressed this frame.

Returns
Whether Escape was pressed this frame.

◆ ExportCloseButtons()

ButtonRowResult FuncDoodle::ImUtil::ExportCloseButtons ( )
inline

Renders an Export/Close button row.

Returns
Which button the user pressed.

◆ GetAnyReleasedKey()

ImGuiKey FuncDoodle::ImUtil::GetAnyReleasedKey ( )
inline

Returns the first non-modifier key released this frame.

Returns
The released key, or ImGuiKey_None if none matched.

◆ GetUsername()

const char * FuncDoodle::ImUtil::GetUsername ( )
inline

Small util function for fetching the current users' username. Used for filling out the animation author field by default.

Returns
Returns the current users' username.
Note
Returns "unknown" if it couldn't fetch the username from known ENV vars.

◆ OkButton()

bool FuncDoodle::ImUtil::OkButton ( )
inline

Renders a single OK button.

Returns
Whether the button was pressed.

◆ OkCancelButtons()

ButtonRowResult FuncDoodle::ImUtil::OkCancelButtons ( )
inline

Renders an OK/Cancel button row.

Returns
Which button the user pressed.

◆ SetupDefaultLayout()

void FuncDoodle::ImUtil::SetupDefaultLayout ( )
inline

Sets up the default ImGui layout in-case there's no user-defined one.

◆ SingleButtonRow()

bool FuncDoodle::ImUtil::SingleButtonRow ( const char * label)
inline

Renders a single right-aligned button.

Parameters
labelButton label.

◆ YesNoButtons()

ButtonRowResult FuncDoodle::ImUtil::YesNoButtons ( )
inline

Renders a Yes/No button row.

Returns
Which button the user pressed.

◆ YesNoCancelButtons()

ButtonRowResult FuncDoodle::ImUtil::YesNoCancelButtons ( )
inline

Renders a Yes/No/Cancel button row.

Returns
Which button the user pressed.

Variable Documentation

◆ s_DefaultLayout

char FuncDoodle::ImUtil::s_DefaultLayout[]
inlineconstexpr
Initial value:
= {
, 0}