mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Internals: Wired a ImGuiItemStatusFlags_ValueChanged into ItemStatusFlags, for an hypothetical IsItemValueChanged() function. (#2034)
This commit is contained in:
		@@ -2344,7 +2344,9 @@ void ImGui::MarkItemValueChanged(ImGuiID id)
 | 
				
			|||||||
    (void)id; // Avoid unused variable warnings when asserts are compiled out.
 | 
					    (void)id; // Avoid unused variable warnings when asserts are compiled out.
 | 
				
			||||||
    ImGuiContext& g = *GImGui;
 | 
					    ImGuiContext& g = *GImGui;
 | 
				
			||||||
    IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive);
 | 
					    IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive);
 | 
				
			||||||
 | 
					    //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id);
 | 
				
			||||||
    g.ActiveIdValueChanged = true;
 | 
					    g.ActiveIdValueChanged = true;
 | 
				
			||||||
 | 
					    g.CurrentWindow->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ValueChanged;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
 | 
					static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -268,7 +268,8 @@ enum ImGuiItemStatusFlags_
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    ImGuiItemStatusFlags_None               = 0,
 | 
					    ImGuiItemStatusFlags_None               = 0,
 | 
				
			||||||
    ImGuiItemStatusFlags_HoveredRect        = 1 << 0,
 | 
					    ImGuiItemStatusFlags_HoveredRect        = 1 << 0,
 | 
				
			||||||
    ImGuiItemStatusFlags_HasDisplayRect     = 1 << 1
 | 
					    ImGuiItemStatusFlags_HasDisplayRect     = 1 << 1,
 | 
				
			||||||
 | 
					    ImGuiItemStatusFlags_ValueChanged       = 1 << 2    // Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: this is in development, not exposed/functional as a generic feature yet.
 | 
					// FIXME: this is in development, not exposed/functional as a generic feature yet.
 | 
				
			||||||
@@ -648,7 +649,7 @@ struct ImGuiContext
 | 
				
			|||||||
    float                   ActiveIdTimer;
 | 
					    float                   ActiveIdTimer;
 | 
				
			||||||
    bool                    ActiveIdIsJustActivated;            // Set at the time of activation for one frame
 | 
					    bool                    ActiveIdIsJustActivated;            // Set at the time of activation for one frame
 | 
				
			||||||
    bool                    ActiveIdAllowOverlap;               // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
 | 
					    bool                    ActiveIdAllowOverlap;               // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
 | 
				
			||||||
    bool                    ActiveIdValueChanged;
 | 
					    bool                    ActiveIdValueChanged;               // Was the value associated to the widget changed over the course of the Active state.
 | 
				
			||||||
    bool                    ActiveIdPreviousFrameIsAlive;
 | 
					    bool                    ActiveIdPreviousFrameIsAlive;
 | 
				
			||||||
    bool                    ActiveIdPreviousFrameValueChanged;
 | 
					    bool                    ActiveIdPreviousFrameValueChanged;
 | 
				
			||||||
    int                     ActiveIdAllowNavDirFlags;           // Active widget allows using directional navigation (e.g. can activate a button and move away from it)
 | 
					    int                     ActiveIdAllowNavDirFlags;           // Active widget allows using directional navigation (e.g. can activate a button and move away from it)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user