mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-28 06:15:13 +00:00
Version 1.92.7 WIP
+ minor demo tweaks.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.92.6
|
||||
// dear imgui, v1.92.7 WIP
|
||||
// (demo code)
|
||||
|
||||
// Help:
|
||||
@@ -731,7 +731,7 @@ struct ExampleTreeNode
|
||||
// Tree structure
|
||||
char Name[28] = "";
|
||||
int UID = 0;
|
||||
ExampleTreeNode* Parent = NULL;
|
||||
ExampleTreeNode* Parent = NULL;
|
||||
ImVector<ExampleTreeNode*> Childs;
|
||||
unsigned short IndexInParent = 0; // Maintaining this allows us to implement linear traversal more easily
|
||||
|
||||
@@ -746,7 +746,7 @@ struct ExampleTreeNode
|
||||
// (this is a minimal version of what a typical advanced application may provide)
|
||||
struct ExampleMemberInfo
|
||||
{
|
||||
const char* Name; // Member name
|
||||
const char* Name; // Member name
|
||||
ImGuiDataType DataType; // Member type
|
||||
int DataCount; // Member count (1 when scalar)
|
||||
int Offset; // Offset inside parent structure
|
||||
@@ -781,7 +781,7 @@ static void ExampleTree_DestroyNode(ExampleTreeNode* node)
|
||||
}
|
||||
|
||||
// Create example tree data
|
||||
// (this allocates _many_ more times than most other code in either Dear ImGui or others demo)
|
||||
// (this allocates _many_ more times than most other code in all of Dear ImGui or others demo)
|
||||
static ExampleTreeNode* ExampleTree_CreateDemoTree()
|
||||
{
|
||||
static const char* root_names[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pear", "Pineapple", "Strawberry", "Watermelon" };
|
||||
@@ -9448,7 +9448,7 @@ static void ShowExampleAppLayout(bool* p_open)
|
||||
struct ExampleAppPropertyEditor
|
||||
{
|
||||
ImGuiTextFilter Filter;
|
||||
ExampleTreeNode* VisibleNode = NULL;
|
||||
ExampleTreeNode* SelectedNode = NULL;
|
||||
|
||||
void Draw(ExampleTreeNode* root_node)
|
||||
{
|
||||
@@ -9477,7 +9477,7 @@ struct ExampleAppPropertyEditor
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::BeginGroup(); // Lock X position
|
||||
if (ExampleTreeNode* node = VisibleNode)
|
||||
if (ExampleTreeNode* node = SelectedNode)
|
||||
{
|
||||
ImGui::Text("%s", node->Name);
|
||||
ImGui::TextDisabled("UID: 0x%08X", node->UID);
|
||||
@@ -9550,7 +9550,7 @@ struct ExampleAppPropertyEditor
|
||||
tree_flags |= ImGuiTreeNodeFlags_NavLeftJumpsToParent; // Left arrow support
|
||||
tree_flags |= ImGuiTreeNodeFlags_SpanFullWidth; // Span full width for easier mouse reach
|
||||
tree_flags |= ImGuiTreeNodeFlags_DrawLinesToNodes; // Always draw hierarchy outlines
|
||||
if (node == VisibleNode)
|
||||
if (node == SelectedNode)
|
||||
tree_flags |= ImGuiTreeNodeFlags_Selected;
|
||||
if (node->Childs.Size == 0)
|
||||
tree_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet;
|
||||
@@ -9560,7 +9560,7 @@ struct ExampleAppPropertyEditor
|
||||
if (node->DataMyBool == false)
|
||||
ImGui::PopStyleColor();
|
||||
if (ImGui::IsItemFocused())
|
||||
VisibleNode = node;
|
||||
SelectedNode = node;
|
||||
if (node_open)
|
||||
{
|
||||
for (ExampleTreeNode* child : node->Childs)
|
||||
|
||||
Reference in New Issue
Block a user