Obsoleted PushTabStop()/PopTabStop() in favor of using new PushItemFlag()/PopItemFlag() with ImGuiItemFlags_NoTabStop.
This commit is contained in:
parent
3de75138d1
commit
0e4dcfa552
@ -49,6 +49,8 @@ Breaking changes:
|
|||||||
- Item flag changes:
|
- Item flag changes:
|
||||||
- Obsoleted PushButtonRepeat()/PopButtonRepeat() in favor of using new PushItemFlag()/PopItemFlag()
|
- Obsoleted PushButtonRepeat()/PopButtonRepeat() in favor of using new PushItemFlag()/PopItemFlag()
|
||||||
with ImGuiItemFlags_ButtonRepeat. Kept inline redirecting functions (will obsolete).
|
with ImGuiItemFlags_ButtonRepeat. Kept inline redirecting functions (will obsolete).
|
||||||
|
- Obsoleted PushTabStop()/PopTabStop() in favor of using new PushItemFlag()/PopItemFlag()
|
||||||
|
with ImGuiItemFlags_NoTabStop. Kept inline redirecting functions (will obsolete).
|
||||||
- Renamed ImGuiSelectableFlags_DontClosePopups to ImGuiSelectableFlags_NoAutoClosePopups for
|
- Renamed ImGuiSelectableFlags_DontClosePopups to ImGuiSelectableFlags_NoAutoClosePopups for
|
||||||
consistency. Kept inline redirecting functions (will obsolete).
|
consistency. Kept inline redirecting functions (will obsolete).
|
||||||
+ Internals: changed/inverted ImGuiItemFlags_SelectableDontClosePopup (default==false) to
|
+ Internals: changed/inverted ImGuiItemFlags_SelectableDontClosePopup (default==false) to
|
||||||
|
14
imgui.cpp
14
imgui.cpp
@ -7624,16 +7624,6 @@ void ImGui::EndDisabledOverrideReenable()
|
|||||||
g.Style.Alpha = g.DisabledAlphaBackup * g.Style.DisabledAlpha;
|
g.Style.Alpha = g.DisabledAlphaBackup * g.Style.DisabledAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::PushTabStop(bool tab_stop)
|
|
||||||
{
|
|
||||||
PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImGui::PopTabStop()
|
|
||||||
{
|
|
||||||
PopItemFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImGui::PushTextWrapPos(float wrap_pos_x)
|
void ImGui::PushTextWrapPos(float wrap_pos_x)
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = GetCurrentWindow();
|
ImGuiWindow* window = GetCurrentWindow();
|
||||||
@ -13773,10 +13763,10 @@ void ImGui::LogButtons()
|
|||||||
#endif
|
#endif
|
||||||
const bool log_to_file = Button("Log To File"); SameLine();
|
const bool log_to_file = Button("Log To File"); SameLine();
|
||||||
const bool log_to_clipboard = Button("Log To Clipboard"); SameLine();
|
const bool log_to_clipboard = Button("Log To Clipboard"); SameLine();
|
||||||
PushTabStop(false);
|
PushItemFlag(ImGuiItemFlags_NoTabStop, true);
|
||||||
SetNextItemWidth(80.0f);
|
SetNextItemWidth(80.0f);
|
||||||
SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL);
|
SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL);
|
||||||
PopTabStop();
|
PopItemFlag();
|
||||||
PopID();
|
PopID();
|
||||||
|
|
||||||
// Start logging at the end of the function so that the buttons don't appear in the log
|
// Start logging at the end of the function so that the buttons don't appear in the log
|
||||||
|
10
imgui.h
10
imgui.h
@ -439,8 +439,6 @@ namespace ImGui
|
|||||||
IMGUI_API void PopStyleVar(int count = 1);
|
IMGUI_API void PopStyleVar(int count = 1);
|
||||||
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); // modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
|
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); // modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
|
||||||
IMGUI_API void PopItemFlag();
|
IMGUI_API void PopItemFlag();
|
||||||
IMGUI_API void PushTabStop(bool tab_stop); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
|
|
||||||
IMGUI_API void PopTabStop();
|
|
||||||
|
|
||||||
// Parameters stacks (current window)
|
// Parameters stacks (current window)
|
||||||
IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
|
IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
|
||||||
@ -3317,19 +3315,21 @@ namespace ImGui
|
|||||||
// OBSOLETED in 1.91.0 (from July 2024)
|
// OBSOLETED in 1.91.0 (from July 2024)
|
||||||
static inline void PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); }
|
static inline void PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); }
|
||||||
static inline void PopButtonRepeat() { PopItemFlag(); }
|
static inline void PopButtonRepeat() { PopItemFlag(); }
|
||||||
|
static inline void PushTabStop(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
|
||||||
|
static inline void PopTabStop() { PopItemFlag(); }
|
||||||
// OBSOLETED in 1.90.0 (from September 2023)
|
// OBSOLETED in 1.90.0 (from September 2023)
|
||||||
static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); }
|
static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); }
|
||||||
static inline void EndChildFrame() { EndChild(); }
|
static inline void EndChildFrame() { EndChild(); }
|
||||||
//static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
//static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
||||||
//static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
//static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, border ? ImGuiChildFlags_Border : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Border
|
||||||
static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); }
|
static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); }
|
||||||
IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1);
|
|
||||||
IMGUI_API bool Combo(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int popup_max_height_in_items = -1);
|
IMGUI_API bool Combo(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int popup_max_height_in_items = -1);
|
||||||
|
IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1);
|
||||||
// OBSOLETED in 1.89.7 (from June 2023)
|
// OBSOLETED in 1.89.7 (from June 2023)
|
||||||
IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item.
|
IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item.
|
||||||
// OBSOLETED in 1.89.4 (from March 2023)
|
// OBSOLETED in 1.89.4 (from March 2023)
|
||||||
static inline void PushAllowKeyboardFocus(bool tab_stop) { PushTabStop(tab_stop); }
|
static inline void PushAllowKeyboardFocus(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
|
||||||
static inline void PopAllowKeyboardFocus() { PopTabStop(); }
|
static inline void PopAllowKeyboardFocus() { PopItemFlag(); }
|
||||||
// OBSOLETED in 1.89 (from August 2022)
|
// OBSOLETED in 1.89 (from August 2022)
|
||||||
IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding)
|
IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding)
|
||||||
// OBSOLETED in 1.87 (from February 2022 but more formally obsoleted April 2024)
|
// OBSOLETED in 1.87 (from February 2022 but more formally obsoleted April 2024)
|
||||||
|
@ -6421,10 +6421,10 @@ static void ShowDemoWindowInputs()
|
|||||||
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
|
||||||
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
||||||
ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
|
||||||
ImGui::PushTabStop(false);
|
ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true);
|
||||||
ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
||||||
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
||||||
ImGui::PopTabStop();
|
ImGui::PopItemFlag();
|
||||||
ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
@ -6446,12 +6446,12 @@ static void ShowDemoWindowInputs()
|
|||||||
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
||||||
if (ImGui::IsItemActive()) has_focus = 2;
|
if (ImGui::IsItemActive()) has_focus = 2;
|
||||||
|
|
||||||
ImGui::PushTabStop(false);
|
ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true);
|
||||||
if (focus_3) ImGui::SetKeyboardFocusHere();
|
if (focus_3) ImGui::SetKeyboardFocusHere();
|
||||||
ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
||||||
if (ImGui::IsItemActive()) has_focus = 3;
|
if (ImGui::IsItemActive()) has_focus = 3;
|
||||||
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
||||||
ImGui::PopTabStop();
|
ImGui::PopItemFlag();
|
||||||
|
|
||||||
if (has_focus)
|
if (has_focus)
|
||||||
ImGui::Text("Item with focus: %d", has_focus);
|
ImGui::Text("Item with focus: %d", has_focus);
|
||||||
|
Loading…
Reference in New Issue
Block a user