ArcdpsExtension
 
Loading...
Searching...
No Matches
ImGuiEx Namespace Reference

Typedefs

typedef int32_t KeyCodeInputFlags
 

Enumerations

enum  KeyCodeInputFlags_ : int32_t { KeyCodeInputFlags_NoModifier = 1 << 0 , KeyCodeInputFlags_NoMouse = 1 << 1 , KeyCodeInputFlags_OnlyGW2Keys = 1 << 2 , KeyCodeInputFlags_FixedModifier = 1 << 3 }
 

Functions

bool KeyCodeInputWndHandle (HWND pWindowHandle, UINT pMessage, WPARAM pAdditionalW, LPARAM pAdditionalL)
 Has to be called in mod_wnd or your specific window handler. This function only has to be called once per program.
 
void OpenKeyCodePopupState (const KeyBinds::Key &pKeyContainer, KeyCodeInputFlags pFlags, KeyBinds::Modifier pFixedModifier)
 
void CloseKeyCodePopupState ()
 
void RestartKeyCodePopupState ()
 
void KeyCodeInputActiveFrame ()
 
const KeyBinds::Key & GetKeyCodeInputKeyState ()
 
bool KeyCodeInput (const char *pLabel, KeyBinds::Key &pKeyContainer, Language pLanguage, HKL pHkl, KeyCodeInputFlags pFlags=0, KeyBinds::Modifier pFixedModifier=0)
 Show a keybind on a button. On pressing that button a popup is opened and all keyevents are used to fill the keybind. (Kind of like GW2 does it).
 
bool Spinner (const char *label, float radius, float thickness, const ImU32 &color)
 
bool SpinnerAligned (const char *label, float radius, float thickness, const ImU32 &color, Alignment alignment)
 
void AlignedTextColumn (Alignment alignment, const char *text,...)
 
void TableHeader (const char *label, bool show_label, ImTextureID texture, Alignment alignment)
 
void AlignedProgressBar (float fraction, const ImVec2 &size_arg, const char *overlay, Alignment alignment)
 
bool BeginMenu (const char *label, bool enabled, bool &hoveredPar)
 
void BeginMenuChild (const char *child_str_id, const char *menu_label, std::function< void()> draw_func)
 
void BeginMenu (const char *menu_label, std::function< void()> draw_func)
 
bool BeginPopupContextWindow (const char *str_id, ImGuiPopupFlags popup_flags, ImGuiHoveredFlags hovered_flags)
 
void MenuItemTableColumnVisibility (ImGuiTable *table, int columnIdx)
 
ImRect TableGetCurrentRowRect ()
 
bool TableIsMouseHoveringCurrentRow ()
 
bool WindowReposition (ImGuiWindow *window, Position position, const ImVec2 &cornerVector, CornerPosition cornerPosition, ImGuiID fromWindowID, CornerPosition anchorPanelCornerPosition, CornerPosition selfPanelCornerPosition)
 
bool TreeNodeBehavior (ImGuiID id, ImGuiTreeNodeFlags flags, const char *label, const char *label_end, void *icon)
 
bool TreeNodeEx (const char *label, ImGuiTreeNodeFlags flags, void *icon)
 
ImGuiTableFlags TableFixFlags (ImGuiTableFlags flags, ImGuiWindow *outer_window)
 
bool BeginTableEx (const char *name, ImGuiID id, int columns_count, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, ImGuiWindowFlags child_window_flags)
 
bool BeginTable (const char *str_id, int columns_count, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, ImGuiWindowFlags child_window_flags)
 
void KeyInput (const char *label, const char *id, char *buffer, size_t bufSize, WPARAM &keyContainer, const char *notSetText)
 
template<typename E >
requires std::is_enum_v<E>
bool Selectable (E &storage, E value)
 
template<typename E , std::ranges::range R>
requires (std::is_enum_v<E> && std::same_as<std::ranges::range_value_t<R>, E>)
bool EnumCombo (const char *label, E &storage, const R &values, const std::map< E, std::function< const std::string &()> > &pPopupText={})
 
template<typename E >
requires (std::is_enum_v<E>)
bool EnumCombo (const char *label, E &storage, const std::initializer_list< E > &values, const std::map< E, std::function< const std::string &()> > &pPopupText={})
 
template<typename E >
requires std::is_enum_v<E>
bool EnumCombo (const char *label, E &storage, E lastElement, const std::map< uint64_t, std::function< const std::string &()> > &pPopupText={})
 
template<typename E >
requires std::is_enum_v<E>
bool EnumRadioButton (int &buttonStorage, E value)
 
template<typename E >
requires std::is_enum_v<E>
bool EnumRadioButton (int &buttonStorage, E value, E &storage)
 
template<typename T >
bool RadioButton (const char *label, T &v, T v_button)
 
template<class... Args>
void TextColored (const ImVec4 &col, const std::string &fmt, Args &&... args)
 
template<std::ranges::viewable_range T, typename ValueType = std::ranges::views::all_t<T>>
bool FilteredCombo (const char *pLabel, const T &pContainer, ValueType &pCurrent, bool *pPopupOpen=nullptr)
 
template<std::ranges::common_range T, typename ValueType = std::ranges::range_value_t<T>>
requires (!std::ranges::viewable_range<T>)
bool FilteredCombo (const char *pLabel, const T &pContainer, ValueType &pCurrent, bool *pPopupOpen=nullptr)
 

Detailed Description

How to use:

Call KeyCodeInputWndHandle in mod_wnd or your specific window handler. Call KeyCodeInput whenever you want to have a KeyBind selection. the wndHandler only has to be called once.

Typedef Documentation

◆ KeyCodeInputFlags

typedef int32_t ImGuiEx::KeyCodeInputFlags

Enumeration Type Documentation

◆ KeyCodeInputFlags_

Enumerator
KeyCodeInputFlags_NoModifier 
KeyCodeInputFlags_NoMouse 
KeyCodeInputFlags_OnlyGW2Keys 
KeyCodeInputFlags_FixedModifier 

Function Documentation

◆ AlignedProgressBar()

void ImGuiEx::AlignedProgressBar ( float  fraction,
const ImVec2 &  size_arg,
const char *  overlay,
Alignment  alignment 
)

◆ AlignedTextColumn()

void ImGuiEx::AlignedTextColumn ( Alignment  alignment,
const char *  text,
  ... 
)

◆ BeginMenu() [1/2]

bool ImGuiEx::BeginMenu ( const char *  label,
bool  enabled,
bool &  hoveredPar 
)

Example usage:

// for child windows
ImGui::BeginChild("boonTableSettings", ImVec2(0, ImGui::GetTextLineHeight()));
bool hovered = ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_ChildWindows);
if (ImGui::BeginMenu("##boon-table-settings")) {
if (!hovered) {
ImGui::CloseCurrentPopup();
}
settingsUi.Draw();
ImGui::EndMenu();
}
ImGui::EndChild();
// for menus without child
bool hovered;
if (ImGuiEx::BeginMenu("boon-table-settings", true, hovered)) {
settingsUi.Draw();
if (!(ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_ChildWindows) || hovered) && !ImGui::IsAnyMouseDown()) {
ImGui::CloseCurrentPopup();
}
ImGui::EndMenu();
}
bool BeginMenu(const char *label, bool enabled, bool &hoveredPar)
Definition Widgets.cpp:401

◆ BeginMenu() [2/2]

void ImGuiEx::BeginMenu ( const char *  menu_label,
std::function< void()>  draw_func 
)

◆ BeginMenuChild()

void ImGuiEx::BeginMenuChild ( const char *  child_str_id,
const char *  menu_label,
std::function< void()>  draw_func 
)

◆ BeginPopupContextWindow()

bool ImGuiEx::BeginPopupContextWindow ( const char *  str_id,
ImGuiPopupFlags  popup_flags,
ImGuiHoveredFlags  hovered_flags 
)

◆ BeginTable()

bool ImGuiEx::BeginTable ( const char *  str_id,
int  column,
ImGuiTableFlags  flags = 0,
const ImVec2 &  outer_size = ImVec2(0.0f, 0.0f),
float  inner_width = 0.0f,
ImGuiWindowFlags  child_window_flags = 0 
)

Same as ImGui::BeginTable() with additional parameter child_window_flags That parameter are flags for the child window to allow further personalization. It is only used if the table uses a child window to render (ScrollX or ScrollY set).

◆ BeginTableEx()

bool ImGuiEx::BeginTableEx ( const char *  name,
ImGuiID  id,
int  columns_count,
ImGuiTableFlags  flags,
const ImVec2 &  outer_size,
float  inner_width,
ImGuiWindowFlags  child_window_flags 
)

◆ CloseKeyCodePopupState()

void ImGuiEx::CloseKeyCodePopupState ( )

◆ EnumCombo() [1/3]

template<typename E , std::ranges::range R>
requires (std::is_enum_v<E> && std::same_as<std::ranges::range_value_t<R>, E>)
bool ImGuiEx::EnumCombo ( const char *  label,
E &  storage,
const R &  values,
const std::map< E, std::function< const std::string &()> > &  pPopupText = {} 
)
Returns
A new element was selected

◆ EnumCombo() [2/3]

template<typename E >
requires (std::is_enum_v<E>)
bool ImGuiEx::EnumCombo ( const char *  label,
E &  storage,
const std::initializer_list< E > &  values,
const std::map< E, std::function< const std::string &()> > &  pPopupText = {} 
)

◆ EnumCombo() [3/3]

template<typename E >
requires std::is_enum_v<E>
bool ImGuiEx::EnumCombo ( const char *  label,
E &  storage,
lastElement,
const std::map< uint64_t, std::function< const std::string &()> > &  pPopupText = {} 
)

This is not really save and also iterates over values, that are not defined! Be really careful, when using this!

Returns
A new element was selected

◆ EnumRadioButton() [1/2]

template<typename E >
requires std::is_enum_v<E>
bool ImGuiEx::EnumRadioButton ( int &  buttonStorage,
value 
)

◆ EnumRadioButton() [2/2]

template<typename E >
requires std::is_enum_v<E>
bool ImGuiEx::EnumRadioButton ( int &  buttonStorage,
value,
E &  storage 
)

◆ FilteredCombo() [1/2]

template<std::ranges::viewable_range T, typename ValueType = std::ranges::views::all_t<T>>
bool ImGuiEx::FilteredCombo ( const char *  pLabel,
const T &  pContainer,
ValueType &  pCurrent,
bool *  pPopupOpen = nullptr 
)

◆ FilteredCombo() [2/2]

template<std::ranges::common_range T, typename ValueType = std::ranges::range_value_t<T>>
requires (!std::ranges::viewable_range<T>)
bool ImGuiEx::FilteredCombo ( const char *  pLabel,
const T &  pContainer,
ValueType &  pCurrent,
bool *  pPopupOpen = nullptr 
)

◆ GetKeyCodeInputKeyState()

const KeyBinds::Key & ImGuiEx::GetKeyCodeInputKeyState ( )

◆ KeyCodeInput()

bool ImGuiEx::KeyCodeInput ( const char *  pLabel,
KeyBinds::Key &  pKeyContainer,
Language  pLanguage,
HKL  pHkl,
KeyCodeInputFlags  pFlags = 0,
KeyBinds::Modifier  pFixedModifier = 0 
)

Show a keybind on a button. On pressing that button a popup is opened and all keyevents are used to fill the keybind. (Kind of like GW2 does it).

Parameters
pLabelShown as text next to the input button. Also shown in the popup header. Will be used as ID for the button.
pKeyContainerThe container of the original key, when pressing Apply it will be saved in there.
pLanguageThe language in which this Tool should be shown.
pHklcurrent Keyboardlayout, has to be tracked, cause GetKeyboardLayout is thread dependent. You can get it by tracking window events or by calling GetKeyboardLayout with the correct threadId as param.
pFlagsAdditional flags for the input.

◆ KeyCodeInputActiveFrame()

void ImGuiEx::KeyCodeInputActiveFrame ( )

◆ KeyCodeInputWndHandle()

bool ImGuiEx::KeyCodeInputWndHandle ( HWND  pWindowHandle,
UINT  pMessage,
WPARAM  pAdditionalW,
LPARAM  pAdditionalL 
)

Has to be called in mod_wnd or your specific window handler. This function only has to be called once per program.

Parameters
pWindowHandleWndHandle of mod_wnd
pMessageMessage of mod_wnd
pAdditionalWwParam of mod_wnd
pAdditionalLlParam of mod_wnd
Returns
true if the event was consumed. Make sure to stop the event calls to run further.

◆ KeyInput()

void ImGuiEx::KeyInput ( const char *  label,
const char *  id,
char *  buffer,
size_t  bufSize,
WPARAM &  keyContainer,
const char *  notSetText 
)

◆ MenuItemTableColumnVisibility()

void ImGuiEx::MenuItemTableColumnVisibility ( ImGuiTable *  table,
int  columnIdx 
)

◆ OpenKeyCodePopupState()

void ImGuiEx::OpenKeyCodePopupState ( const KeyBinds::Key &  pKeyContainer,
KeyCodeInputFlags  pFlags,
KeyBinds::Modifier  pFixedModifier 
)

◆ RadioButton()

template<typename T >
bool ImGuiEx::RadioButton ( const char *  label,
T &  v,
v_button 
)

◆ RestartKeyCodePopupState()

void ImGuiEx::RestartKeyCodePopupState ( )

◆ Selectable()

template<typename E >
requires std::is_enum_v<E>
bool ImGuiEx::Selectable ( E &  storage,
value 
)
Returns
if element was freshly selected.

◆ Spinner()

bool ImGuiEx::Spinner ( const char *  label,
float  radius,
float  thickness,
const ImU32 &  color 
)

◆ SpinnerAligned()

bool ImGuiEx::SpinnerAligned ( const char *  label,
float  radius,
float  thickness,
const ImU32 &  color,
Alignment  alignment 
)

◆ TableFixFlags()

ImGuiTableFlags ImGuiEx::TableFixFlags ( ImGuiTableFlags  flags,
ImGuiWindow *  outer_window 
)
inline

◆ TableGetCurrentRowRect()

ImRect ImGuiEx::TableGetCurrentRowRect ( )

Only call this function at the end of a table row. If done before, it will not return the rect of the full table, but only the rect from beginning to the end of the current column.

◆ TableHeader()

void ImGuiEx::TableHeader ( const char *  label,
bool  show_label,
ImTextureID  texture,
Alignment  alignment 
)

◆ TableIsMouseHoveringCurrentRow()

bool ImGuiEx::TableIsMouseHoveringCurrentRow ( )

This calls TableGetCurrentRowRect therefore this should also has the same limitations.

◆ TextColored()

template<class... Args>
void ImGuiEx::TextColored ( const ImVec4 &  col,
const std::string &  fmt,
Args &&...  args 
)

◆ TreeNodeBehavior()

bool ImGuiEx::TreeNodeBehavior ( ImGuiID  id,
ImGuiTreeNodeFlags  flags,
const char *  label,
const char *  label_end,
void *  icon 
)

◆ TreeNodeEx()

bool ImGuiEx::TreeNodeEx ( const char *  label,
ImGuiTreeNodeFlags  flags,
void *  icon 
)

◆ WindowReposition()

bool ImGuiEx::WindowReposition ( ImGuiWindow *  window,
Position  position,
const ImVec2 &  cornerVector,
CornerPosition  cornerPosition,
ImGuiID  fromWindowID,
CornerPosition  anchorPanelCornerPosition,
CornerPosition  selfPanelCornerPosition 
)