@ -505,7 +505,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
// Default behavior inherited from item flags
// Note that _both_ ButtonFlags and ItemFlags are valid sources, so copy one into the item_flags and only check that.
ImGuiItemFlags item_flags = ( g . LastItemData . ID = = id ? g . LastItemData . In Flags : g . CurrentItemFlags ) ;
ImGuiItemFlags item_flags = ( g . LastItemData . ID = = id ? g . LastItemData . Item Flags : g . CurrentItemFlags ) ;
if ( flags & ImGuiButtonFlags_AllowOverlap )
item_flags | = ImGuiItemFlags_AllowOverlap ;
@ -1150,7 +1150,7 @@ bool ImGui::Checkbox(const char* label, bool* v)
const ImRect total_bb ( pos , pos + ImVec2 ( square_sz + ( label_size . x > 0.0f ? style . ItemInnerSpacing . x + label_size . x : 0.0f ) , label_size . y + style . FramePadding . y * 2.0f ) ) ;
ItemSize ( total_bb , style . FramePadding . y ) ;
const bool is_visible = ItemAdd ( total_bb , id ) ;
const bool is_multi_select = ( g . LastItemData . In Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
const bool is_multi_select = ( g . LastItemData . Item Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
if ( ! is_visible )
if ( ! is_multi_select | | ! g . BoxSelectState . UnclipMode | | ! g . BoxSelectState . UnclipRect . Overlaps ( total_bb ) ) // Extra layer of "no logic clip" for box-select support
{
@ -1180,7 +1180,7 @@ bool ImGui::Checkbox(const char* label, bool* v)
}
const ImRect check_bb ( pos , pos + ImVec2 ( square_sz , square_sz ) ) ;
const bool mixed_value = ( g . LastItemData . In Flags & ImGuiItemFlags_MixedValue ) ! = 0 ;
const bool mixed_value = ( g . LastItemData . Item Flags & ImGuiItemFlags_MixedValue ) ! = 0 ;
if ( is_visible )
{
RenderNavHighlight ( total_bb , id ) ;
@ -2562,7 +2562,7 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v
}
if ( g . ActiveId ! = id )
return false ;
if ( ( g . LastItemData . In Flags & ImGuiItemFlags_ReadOnly ) | | ( flags & ImGuiSliderFlags_ReadOnly ) )
if ( ( g . LastItemData . Item Flags & ImGuiItemFlags_ReadOnly ) | | ( flags & ImGuiSliderFlags_ReadOnly ) )
return false ;
switch ( data_type )
@ -2609,7 +2609,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
if ( format = = NULL )
format = DataTypeGetInfo ( data_type ) - > PrintFmt ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . In Flags ) ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . Item Flags ) ;
bool temp_input_is_active = temp_input_allowed & & TempInputIsActive ( id ) ;
if ( ! temp_input_is_active )
{
@ -3104,7 +3104,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
}
if ( set_new_value )
if ( ( g . LastItemData . In Flags & ImGuiItemFlags_ReadOnly ) | | ( flags & ImGuiSliderFlags_ReadOnly ) )
if ( ( g . LastItemData . Item Flags & ImGuiItemFlags_ReadOnly ) | | ( flags & ImGuiSliderFlags_ReadOnly ) )
set_new_value = false ;
if ( set_new_value )
@ -3209,7 +3209,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
if ( format = = NULL )
format = DataTypeGetInfo ( data_type ) - > PrintFmt ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . In Flags ) ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . Item Flags ) ;
bool temp_input_is_active = temp_input_allowed & & TempInputIsActive ( id ) ;
if ( ! temp_input_is_active )
{
@ -3375,7 +3375,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
if ( format = = NULL )
format = DataTypeGetInfo ( data_type ) - > PrintFmt ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . In Flags ) ;
const bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . Item Flags ) ;
const bool clicked = hovered & & IsMouseClicked ( 0 , ImGuiInputFlags_None , id ) ;
if ( clicked | | g . NavActivateId = = id )
{
@ -3583,7 +3583,7 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char*
ClearActiveID ( ) ;
g . CurrentWindow - > DC . CursorPos = bb . Min ;
g . LastItemData . In Flags | = ImGuiItemFlags_AllowDuplicateId ;
g . LastItemData . Item Flags | = ImGuiItemFlags_AllowDuplicateId ;
bool value_changed = InputTextEx ( label , NULL , buf , buf_size , bb . GetSize ( ) , flags | ImGuiInputTextFlags_MergedItem ) ;
if ( init )
{
@ -3640,7 +3640,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
void ImGui : : SetNextItemRefVal ( ImGuiDataType data_type , void * p_data )
{
ImGuiContext & g = * GImGui ;
g . NextItemData . Flags | = ImGuiNextItemDataFlags_HasRefVal ;
g . NextItemData . Has Flags | = ImGuiNextItemDataFlags_HasRefVal ;
memcpy ( & g . NextItemData . RefVal , p_data , DataTypeGetInfo ( data_type ) - > Size ) ;
}
@ -3658,7 +3658,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
if ( format = = NULL )
format = DataTypeGetInfo ( data_type ) - > PrintFmt ;
void * p_data_default = ( g . NextItemData . Flags & ImGuiNextItemDataFlags_HasRefVal ) ? & g . NextItemData . RefVal : & g . DataTypeZeroValue ;
void * p_data_default = ( g . NextItemData . Has Flags & ImGuiNextItemDataFlags_HasRefVal ) ? & g . NextItemData . RefVal : & g . DataTypeZeroValue ;
char buf [ 64 ] ;
if ( ( flags & ImGuiInputTextFlags_DisplayEmptyRefVal ) & & DataTypeCompare ( data_type , p_data , p_data_default ) = = 0 )
@ -4465,7 +4465,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
// Ensure mouse cursor is set even after switching to keyboard/gamepad mode. May generalize further? (#6417)
bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . In Flags | ImGuiItemFlags_NoNavDisableMouseHover ) ;
bool hovered = ItemHoverable ( frame_bb , id , g . LastItemData . Item Flags | ImGuiItemFlags_NoNavDisableMouseHover ) ;
if ( hovered )
SetMouseCursor ( ImGuiMouseCursor_TextInput ) ;
if ( hovered & & g . NavDisableMouseHover )
@ -4474,7 +4474,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState * state = GetInputTextState ( id ) ;
if ( g . LastItemData . In Flags & ImGuiItemFlags_ReadOnly )
if ( g . LastItemData . Item Flags & ImGuiItemFlags_ReadOnly )
flags | = ImGuiInputTextFlags_ReadOnly ;
const bool is_readonly = ( flags & ImGuiInputTextFlags_ReadOnly ) ! = 0 ;
const bool is_password = ( flags & ImGuiInputTextFlags_Password ) ! = 0 ;
@ -5300,7 +5300,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if ( g . LastItemData . ID = = 0 | | g . LastItemData . ID ! = GetWindowScrollbarID ( draw_window , ImGuiAxis_Y ) )
{
g . LastItemData . ID = id ;
g . LastItemData . In Flags = item_data_backup . In Flags ;
g . LastItemData . Item Flags = item_data_backup . Item Flags ;
g . LastItemData . StatusFlags = item_data_backup . StatusFlags ;
}
}
@ -5629,7 +5629,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
// Drag and Drop Target
// NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test.
if ( ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) & & ! ( g . LastItemData . In Flags & ImGuiItemFlags_ReadOnly ) & & ! ( flags & ImGuiColorEditFlags_NoDragDrop ) & & BeginDragDropTarget ( ) )
if ( ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) & & ! ( g . LastItemData . Item Flags & ImGuiItemFlags_ReadOnly ) & & ! ( flags & ImGuiColorEditFlags_NoDragDrop ) & & BeginDragDropTarget ( ) )
{
bool accepted_drag_drop = false ;
if ( const ImGuiPayload * payload = AcceptDragDropPayload ( IMGUI_PAYLOAD_TYPE_COLOR_3F ) )
@ -6411,7 +6411,7 @@ bool ImGui::TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags)
ImGuiStorage * storage = window - > DC . StateStorage ;
bool is_open ;
if ( g . NextItemData . Flags & ImGuiNextItemDataFlags_HasOpen )
if ( g . NextItemData . Has Flags & ImGuiNextItemDataFlags_HasOpen )
{
if ( g . NextItemData . OpenCond & ImGuiCond_Always )
{
@ -6457,7 +6457,7 @@ static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags)
ImGuiTreeNodeStackData * tree_node_data = & g . TreeNodeStack . back ( ) ;
tree_node_data - > ID = g . LastItemData . ID ;
tree_node_data - > TreeFlags = flags ;
tree_node_data - > InFlags = g . LastItemData . In Flags ;
tree_node_data - > InFlags = g . LastItemData . Item Flags ;
tree_node_data - > NavRect = g . LastItemData . NavRect ;
window - > DC . TreeHasStackDataDepthMask | = ( 1 < < window - > DC . TreeDepth ) ;
}
@ -6506,7 +6506,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
interact_bb . Max . x = frame_bb . Min . x + text_width + ( label_size . x > 0.0f ? style . ItemSpacing . x * 2.0f : 0.0f ) ;
// Compute open and multi-select states before ItemAdd() as it clear NextItem data.
ImGuiID storage_id = ( g . NextItemData . Flags & ImGuiNextItemDataFlags_HasStorageID ) ? g . NextItemData . StorageId : id ;
ImGuiID storage_id = ( g . NextItemData . Has Flags & ImGuiNextItemDataFlags_HasStorageID ) ? g . NextItemData . StorageId : id ;
bool is_open = TreeNodeUpdateNextOpen ( storage_id , flags ) ;
bool is_visible ;
@ -6559,7 +6559,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
}
ImGuiButtonFlags button_flags = ImGuiTreeNodeFlags_None ;
if ( ( flags & ImGuiTreeNodeFlags_AllowOverlap ) | | ( g . LastItemData . In Flags & ImGuiItemFlags_AllowOverlap ) )
if ( ( flags & ImGuiTreeNodeFlags_AllowOverlap ) | | ( g . LastItemData . Item Flags & ImGuiItemFlags_AllowOverlap ) )
button_flags | = ImGuiButtonFlags_AllowOverlap ;
if ( ! is_leaf )
button_flags | = ImGuiButtonFlags_PressedOnDragDropHold ;
@ -6571,7 +6571,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
const float arrow_hit_x2 = ( text_pos . x - text_offset_x ) + ( g . FontSize + padding . x * 2.0f ) + style . TouchExtraPadding . x ;
const bool is_mouse_x_over_arrow = ( g . IO . MousePos . x > = arrow_hit_x1 & & g . IO . MousePos . x < arrow_hit_x2 ) ;
const bool is_multi_select = ( g . LastItemData . In Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
const bool is_multi_select = ( g . LastItemData . Item Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
if ( is_multi_select ) // We absolutely need to distinguish open vs select so _OpenOnArrow comes by default
flags | = ( flags & ImGuiTreeNodeFlags_OpenOnMask_ ) = = 0 ? ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick : ImGuiTreeNodeFlags_OpenOnArrow ;
@ -6788,7 +6788,7 @@ void ImGui::SetNextItemOpen(bool is_open, ImGuiCond cond)
ImGuiContext & g = * GImGui ;
if ( g . CurrentWindow - > SkipItems )
return ;
g . NextItemData . Flags | = ImGuiNextItemDataFlags_HasOpen ;
g . NextItemData . Has Flags | = ImGuiNextItemDataFlags_HasOpen ;
g . NextItemData . OpenVal = is_open ;
g . NextItemData . OpenCond = ( ImU8 ) ( cond ? cond : ImGuiCond_Always ) ;
}
@ -6799,7 +6799,7 @@ void ImGui::SetNextItemStorageID(ImGuiID storage_id)
ImGuiContext & g = * GImGui ;
if ( g . CurrentWindow - > SkipItems )
return ;
g . NextItemData . Flags | = ImGuiNextItemDataFlags_HasStorageID ;
g . NextItemData . Has Flags | = ImGuiNextItemDataFlags_HasStorageID ;
g . NextItemData . StorageId = storage_id ;
}
@ -6925,7 +6925,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
is_visible = ItemAdd ( bb , id , NULL , extra_item_flags ) ;
}
const bool is_multi_select = ( g . LastItemData . In Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
const bool is_multi_select = ( g . LastItemData . Item Flags & ImGuiItemFlags_IsMultiSelect ) ! = 0 ;
if ( ! is_visible )
if ( ! is_multi_select | | ! g . BoxSelectState . UnclipMode | | ! g . BoxSelectState . UnclipRect . Overlaps ( bb ) ) // Extra layer of "no logic clip" for box-select support (would be more overhead to add to ItemAdd)
return false ;
@ -6953,7 +6953,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if ( flags & ImGuiSelectableFlags_SelectOnClick ) { button_flags | = ImGuiButtonFlags_PressedOnClick ; }
if ( flags & ImGuiSelectableFlags_SelectOnRelease ) { button_flags | = ImGuiButtonFlags_PressedOnRelease ; }
if ( flags & ImGuiSelectableFlags_AllowDoubleClick ) { button_flags | = ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick ; }
if ( ( flags & ImGuiSelectableFlags_AllowOverlap ) | | ( g . LastItemData . In Flags & ImGuiItemFlags_AllowOverlap ) ) { button_flags | = ImGuiButtonFlags_AllowOverlap ; }
if ( ( flags & ImGuiSelectableFlags_AllowOverlap ) | | ( g . LastItemData . Item Flags & ImGuiItemFlags_AllowOverlap ) ) { button_flags | = ImGuiButtonFlags_AllowOverlap ; }
// Multi-selection support (header)
const bool was_selected = selected ;
@ -7035,7 +7035,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
RenderTextClipped ( text_min , text_max , label , NULL , & label_size , style . SelectableTextAlign , & bb ) ;
// Automatically close popups
if ( pressed & & ( window - > Flags & ImGuiWindowFlags_Popup ) & & ! ( flags & ImGuiSelectableFlags_NoAutoClosePopups ) & & ( g . LastItemData . In Flags & ImGuiItemFlags_AutoClosePopups ) )
if ( pressed & & ( window - > Flags & ImGuiWindowFlags_Popup ) & & ! ( flags & ImGuiSelectableFlags_NoAutoClosePopups ) & & ( g . LastItemData . Item Flags & ImGuiItemFlags_AutoClosePopups ) )
CloseCurrentPopup ( ) ;
if ( disabled_item & & ! disabled_global )
@ -9960,7 +9960,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
// Calculate tab contents size
ImVec2 size = TabItemCalcSize ( label , ( p_open ! = NULL ) | | ( flags & ImGuiTabItemFlags_UnsavedDocument ) ) ;
tab - > RequestedWidth = - 1.0f ;
if ( g . NextItemData . Flags & ImGuiNextItemDataFlags_HasWidth )
if ( g . NextItemData . Has Flags & ImGuiNextItemDataFlags_HasWidth )
size . x = tab - > RequestedWidth = g . NextItemData . Width ;
if ( tab_is_new )
tab - > Width = ImMax ( 1.0f , size . x ) ;