Merge branch 'master' into 2016-07-navigation
This commit is contained in:
+23
-11
@@ -1592,7 +1592,7 @@ void ImGui::ShowTestWindow(bool* p_open)
|
||||
|
||||
if (ImGui::TreeNode("Dragging"))
|
||||
{
|
||||
ImGui::TextWrapped("You can use ImGui::GetItemActiveDragDelta() to query for the dragged amount on any widget.");
|
||||
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
|
||||
ImGui::Button("Drag Me");
|
||||
if (ImGui::IsItemActive())
|
||||
{
|
||||
@@ -1751,7 +1751,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
ImFont* font = atlas->Fonts[i];
|
||||
ImGui::BulletText("Font %d: \'%s\', %.2f px, %d glyphs", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size);
|
||||
ImGui::TreePush((void*)(intptr_t)i);
|
||||
if (i > 0) { ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { atlas->Fonts[i] = atlas->Fonts[0]; atlas->Fonts[0] = font; } }
|
||||
ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) ImGui::GetIO().FontDefault = font;
|
||||
ImGui::PushFont(font);
|
||||
ImGui::Text("The quick brown fox jumps over the lazy dog");
|
||||
ImGui::PopFont();
|
||||
@@ -1822,6 +1822,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
ImGui::PopItemWidth();
|
||||
}
|
||||
|
||||
// Demonstrate creating a fullscreen menu bar and populating it.
|
||||
static void ShowExampleAppMainMenuBar()
|
||||
{
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
@@ -1902,6 +1903,7 @@ static void ShowExampleMenuFile()
|
||||
if (ImGui::MenuItem("Quit", "Alt+F4")) {}
|
||||
}
|
||||
|
||||
// Demonstrate creating a window which gets auto-resized according to its content.
|
||||
static void ShowExampleAppAutoResize(bool* p_open)
|
||||
{
|
||||
if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
@@ -1918,6 +1920,7 @@ static void ShowExampleAppAutoResize(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate creating a window with custom resize constraints.
|
||||
static void ShowExampleAppConstrainedResize(bool* p_open)
|
||||
{
|
||||
struct CustomConstraints // Helper functions to demonstrate programmatic constraints
|
||||
@@ -1955,6 +1958,7 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate creating a simple static window with no decoration.
|
||||
static void ShowExampleAppFixedOverlay(bool* p_open)
|
||||
{
|
||||
ImGui::SetNextWindowPos(ImVec2(10,10));
|
||||
@@ -1969,10 +1973,12 @@ static void ShowExampleAppFixedOverlay(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate using "##" and "###" in identifiers to manipulate ID generation.
|
||||
// Read section "How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on the purpose of labels/IDs." about ID.
|
||||
static void ShowExampleAppManipulatingWindowTitle(bool*)
|
||||
{
|
||||
// By default, Windows are uniquely identified by their title.
|
||||
// You can use the "##" and "###" markers to manipulate the display/ID. Read FAQ at the top of this file!
|
||||
// You can use the "##" and "###" markers to manipulate the display/ID.
|
||||
|
||||
// Using "##" to display same title but have unique identifier.
|
||||
ImGui::SetNextWindowPos(ImVec2(100,100), ImGuiSetCond_FirstUseEver);
|
||||
@@ -1994,6 +2000,7 @@ static void ShowExampleAppManipulatingWindowTitle(bool*)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate using the low-level ImDrawList to draw custom shapes.
|
||||
static void ShowExampleAppCustomRendering(bool* p_open)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(350,560), ImGuiSetCond_FirstUseEver);
|
||||
@@ -2061,21 +2068,21 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
||||
|
||||
bool adding_preview = false;
|
||||
ImGui::InvisibleButton("canvas", canvas_size);
|
||||
ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y);
|
||||
if (adding_line)
|
||||
{
|
||||
adding_preview = true;
|
||||
points.push_back(mouse_pos_in_canvas);
|
||||
if (!ImGui::GetIO().MouseDown[0])
|
||||
adding_line = adding_preview = false;
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y);
|
||||
if (!adding_line && ImGui::IsMouseClicked(0))
|
||||
{
|
||||
points.push_back(mouse_pos_in_canvas);
|
||||
adding_line = true;
|
||||
}
|
||||
if (adding_line)
|
||||
{
|
||||
adding_preview = true;
|
||||
points.push_back(mouse_pos_in_canvas);
|
||||
if (!ImGui::GetIO().MouseDown[0])
|
||||
adding_line = adding_preview = false;
|
||||
}
|
||||
if (ImGui::IsMouseClicked(1) && !points.empty())
|
||||
{
|
||||
adding_line = adding_preview = false;
|
||||
@@ -2093,6 +2100,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrating creating a simple console window, with scrolling, filtering, completion and history.
|
||||
// For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions.
|
||||
struct ExampleAppConsole
|
||||
{
|
||||
@@ -2445,6 +2453,7 @@ struct ExampleAppLog
|
||||
}
|
||||
};
|
||||
|
||||
// Demonstrate creating a simple log window with basic filtering.
|
||||
static void ShowExampleAppLog(bool* p_open)
|
||||
{
|
||||
static ExampleAppLog log;
|
||||
@@ -2462,6 +2471,7 @@ static void ShowExampleAppLog(bool* p_open)
|
||||
log.Draw("Example: Log", p_open);
|
||||
}
|
||||
|
||||
// Demonstrate create a window with multiple child windows.
|
||||
static void ShowExampleAppLayout(bool* p_open)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiSetCond_FirstUseEver);
|
||||
@@ -2507,6 +2517,7 @@ static void ShowExampleAppLayout(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate create a simple property editor.
|
||||
static void ShowExampleAppPropertyEditor(bool* p_open)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(430,450), ImGuiSetCond_FirstUseEver);
|
||||
@@ -2579,6 +2590,7 @@ static void ShowExampleAppPropertyEditor(bool* p_open)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
// Demonstrate/test rendering huge amount of text, and the incidence of clipping.
|
||||
static void ShowExampleAppLongText(bool* p_open)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
|
||||
|
||||
Reference in New Issue
Block a user