ImGui::Combo("combo scroll",&item2,items,IM_ARRAYSIZE(items));// Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
ImGui::SameLine();ShowHelpMarker("Hold SHIFT or use mouse to select text.\n""CTRL+Left/Right to word jump.\n""CTRL+A or double-click to select all.\n""CTRL+X,CTRL+C,CTRL+V clipboard.\n""CTRL+Z,CTRL+Y undo/redo.\n""ESCAPE to revert.\n");
ImGui::InputInt("input int",&i0);
ImGui::SameLine();ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
ImGui::InputFloat("input float",&f0,0.01f,1.0f);
staticfloatvec4a[4]={0.10f,0.20f,0.30f,0.44f};
ImGui::InputFloat3("input float3",vec4a);
}
{
staticinti1=50,i2=42;
ImGui::DragInt("drag int",&i1,1);
ImGui::SameLine();ShowHelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
ImGui::DragInt("drag int 0..100",&i2,1,0,100,"%.0f%%");
staticfloatf1=1.00f,f2=0.0067f;
ImGui::DragFloat("drag float",&f1,0.005f);
ImGui::DragFloat("drag small float",&f2,0.0001f,0.0f,0.0f,"%.06f ns");
}
{
staticinti1=0;
ImGui::SliderInt("slider int",&i1,-1,3);
ImGui::SameLine();ShowHelpMarker("CTRL+click to input value.");
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
// Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.",wrap_width);
// Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.",wrap_width);
// (needs a suitable font, try Arial Unicode or M+ fonts http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html)
// Most compiler appears to support UTF-8 in source code (with Visual Studio you need to save your file as 'UTF-8 without signature')
// However for the sake for maximum portability here we are *not* including raw UTF-8 character in this source file, instead we encode the string with hexadecimal constants.
// In your own application be reasonable and use UTF-8 in source or retrieve the data from file system!
// Note that characters values are preserved even if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges.");
// (needs a suitable font, try Arial Unicode or M+ fonts http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html)
// - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8
// - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature')
// - HOWEVER, FOR THIS DEMO FILE, BECAUSE WE WANT TO SUPPORT COMPILER, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE.
// Instead we are encoding a few string with hexadecimal constants. Don't do this in your application!
// Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges.");
ImGui::Combo("combo scroll",&item2,items,IM_ARRAYSIZE(items));// Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
ImGui::SameLine();ShowHelpMarker("Hold SHIFT or use mouse to select text.\n""CTRL+Left/Right to word jump.\n""CTRL+A or double-click to select all.\n""CTRL+X,CTRL+C,CTRL+V clipboard.\n""CTRL+Z,CTRL+Y undo/redo.\n""ESCAPE to revert.\n");
ImGui::InputInt("input int",&i0);
ImGui::SameLine();ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
ImGui::InputFloat("input float",&f0,0.01f,1.0f);
staticfloatvec4a[4]={0.10f,0.20f,0.30f,0.44f};
ImGui::InputFloat3("input float3",vec4a);
}
{
staticinti1=50,i2=42;
ImGui::DragInt("drag int",&i1,1);
ImGui::SameLine();ShowHelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
// Create a dummy array of contiguous float values to plot
// Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter.
staticfloatvalues[90]={0};
staticintvalues_offset=0;
staticfloatrefresh_time=0.0f;
if(!animate||refresh_time==0.0f)
refresh_time=ImGui::GetTime();
while(refresh_time<ImGui::GetTime())// Create dummy data at fixed 60 hz rate for the demo
ImGui::DragInt("drag int 0..100",&i2,1,0,100,"%.0f%%");
// Use functions to generate output
// FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count.
ImGui::SameLine();ShowHelpMarker("CTRL+click to input value.");
// Typically we would use ImVec2(-1.0f,0.0f) to use all available width, or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
// Create a dummy array of contiguous float values to plot
// Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter.
staticfloatvalues[90]={0};
staticintvalues_offset=0;
staticfloatrefresh_time=0.0f;
if(!animate||refresh_time==0.0f)
refresh_time=ImGui::GetTime();
while(refresh_time<ImGui::GetTime())// Create dummy data at fixed 60 hz rate for the demo
// FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count.
// Typically we would use ImVec2(-1.0f,0.0f) to use all available width, or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.