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) |
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 int32_t ImGuiEx::KeyCodeInputFlags |
enum ImGuiEx::KeyCodeInputFlags_ : int32_t |
void ImGuiEx::AlignedProgressBar | ( | float | fraction, |
const ImVec2 & | size_arg, | ||
const char * | overlay, | ||
Alignment | alignment | ||
) |
void ImGuiEx::AlignedTextColumn | ( | Alignment | alignment, |
const char * | text, | ||
... | |||
) |
bool ImGuiEx::BeginMenu | ( | const char * | label, |
bool | enabled, | ||
bool & | hoveredPar | ||
) |
Example usage:
void ImGuiEx::BeginMenu | ( | const char * | menu_label, |
std::function< void()> | draw_func | ||
) |
void ImGuiEx::BeginMenuChild | ( | const char * | child_str_id, |
const char * | menu_label, | ||
std::function< void()> | draw_func | ||
) |
bool ImGuiEx::BeginPopupContextWindow | ( | const char * | str_id, |
ImGuiPopupFlags | popup_flags, | ||
ImGuiHoveredFlags | hovered_flags | ||
) |
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).
bool ImGuiEx::BeginTableEx | ( | const char * | name, |
ImGuiID | id, | ||
int | columns_count, | ||
ImGuiTableFlags | flags, | ||
const ImVec2 & | outer_size, | ||
float | inner_width, | ||
ImGuiWindowFlags | child_window_flags | ||
) |
void ImGuiEx::CloseKeyCodePopupState | ( | ) |
bool ImGuiEx::EnumCombo | ( | const char * | label, |
E & | storage, | ||
const R & | values, | ||
const std::map< E, std::function< const std::string &()> > & | pPopupText = {} |
||
) |
bool ImGuiEx::EnumCombo | ( | const char * | label, |
E & | storage, | ||
const std::initializer_list< E > & | values, | ||
const std::map< E, std::function< const std::string &()> > & | pPopupText = {} |
||
) |
bool ImGuiEx::EnumCombo | ( | const char * | label, |
E & | storage, | ||
E | 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!
bool ImGuiEx::EnumRadioButton | ( | int & | buttonStorage, |
E | value | ||
) |
bool ImGuiEx::EnumRadioButton | ( | int & | buttonStorage, |
E | value, | ||
E & | storage | ||
) |
bool ImGuiEx::FilteredCombo | ( | const char * | pLabel, |
const T & | pContainer, | ||
ValueType & | pCurrent, | ||
bool * | pPopupOpen = nullptr |
||
) |
bool ImGuiEx::FilteredCombo | ( | const char * | pLabel, |
const T & | pContainer, | ||
ValueType & | pCurrent, | ||
bool * | pPopupOpen = nullptr |
||
) |
const KeyBinds::Key & ImGuiEx::GetKeyCodeInputKeyState | ( | ) |
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).
pLabel | Shown as text next to the input button. Also shown in the popup header. Will be used as ID for the button. |
pKeyContainer | The container of the original key, when pressing Apply it will be saved in there. |
pLanguage | The language in which this Tool should be shown. |
pHkl | current 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. |
pFlags | Additional flags for the input. |
void ImGuiEx::KeyCodeInputActiveFrame | ( | ) |
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.
pWindowHandle | WndHandle of mod_wnd |
pMessage | Message of mod_wnd |
pAdditionalW | wParam of mod_wnd |
pAdditionalL | lParam of mod_wnd |
true
if the event was consumed. Make sure to stop the event calls to run further. void ImGuiEx::KeyInput | ( | const char * | label, |
const char * | id, | ||
char * | buffer, | ||
size_t | bufSize, | ||
WPARAM & | keyContainer, | ||
const char * | notSetText | ||
) |
void ImGuiEx::MenuItemTableColumnVisibility | ( | ImGuiTable * | table, |
int | columnIdx | ||
) |
void ImGuiEx::OpenKeyCodePopupState | ( | const KeyBinds::Key & | pKeyContainer, |
KeyCodeInputFlags | pFlags, | ||
KeyBinds::Modifier | pFixedModifier | ||
) |
bool ImGuiEx::RadioButton | ( | const char * | label, |
T & | v, | ||
T | v_button | ||
) |
void ImGuiEx::RestartKeyCodePopupState | ( | ) |
bool ImGuiEx::Selectable | ( | E & | storage, |
E | value | ||
) |
bool ImGuiEx::Spinner | ( | const char * | label, |
float | radius, | ||
float | thickness, | ||
const ImU32 & | color | ||
) |
bool ImGuiEx::SpinnerAligned | ( | const char * | label, |
float | radius, | ||
float | thickness, | ||
const ImU32 & | color, | ||
Alignment | alignment | ||
) |
|
inline |
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.
void ImGuiEx::TableHeader | ( | const char * | label, |
bool | show_label, | ||
ImTextureID | texture, | ||
Alignment | alignment | ||
) |
bool ImGuiEx::TableIsMouseHoveringCurrentRow | ( | ) |
This calls TableGetCurrentRowRect
therefore this should also has the same limitations.
void ImGuiEx::TextColored | ( | const ImVec4 & | col, |
const std::string & | fmt, | ||
Args &&... | args | ||
) |
bool ImGuiEx::TreeNodeBehavior | ( | ImGuiID | id, |
ImGuiTreeNodeFlags | flags, | ||
const char * | label, | ||
const char * | label_end, | ||
void * | icon | ||
) |
bool ImGuiEx::TreeNodeEx | ( | const char * | label, |
ImGuiTreeNodeFlags | flags, | ||
void * | icon | ||
) |
bool ImGuiEx::WindowReposition | ( | ImGuiWindow * | window, |
Position | position, | ||
const ImVec2 & | cornerVector, | ||
CornerPosition | cornerPosition, | ||
ImGuiID | fromWindowID, | ||
CornerPosition | anchorPanelCornerPosition, | ||
CornerPosition | selfPanelCornerPosition | ||
) |