@ -1545,28 +1545,22 @@ static void ShowDemoWindowWidgets()
static bool b = false ;
static bool b = false ;
static float col4f [ 4 ] = { 1.0f , 0.5 , 0.0f , 1.0f } ;
static float col4f [ 4 ] = { 1.0f , 0.5 , 0.0f , 1.0f } ;
static char str [ 16 ] = { } ;
static char str [ 16 ] = { } ;
ImGui : : RadioButton ( " Text " , & item_type , 0 ) ;
ImGui : : Combo ( " Item Type " , & item_type , " Text \0 Button \0 Button (w/ repeat) \0 Checkbox \0 SliderFloat \0 InputText \0 InputFloat \0 InputFloat3 \0 ColorEdit4 \0 MenuItem \0 TreeNode (w/ double-click) \0 ListBox \0 " ) ;
ImGui : : RadioButton ( " Button " , & item_type , 1 ) ;
ImGui : : SameLine ( ) ;
ImGui : : RadioButton ( " Checkbox " , & item_type , 2 ) ;
HelpMarker ( " Testing how various types of items are interacting with the IsItemXXX functions. " ) ;
ImGui : : RadioButton ( " SliderFloat " , & item_type , 3 ) ;
ImGui : : RadioButton ( " InputText " , & item_type , 4 ) ;
ImGui : : RadioButton ( " InputFloat3 " , & item_type , 5 ) ;
ImGui : : RadioButton ( " ColorEdit4 " , & item_type , 6 ) ;
ImGui : : RadioButton ( " MenuItem " , & item_type , 7 ) ;
ImGui : : RadioButton ( " TreeNode (w/ double-click) " , & item_type , 8 ) ;
ImGui : : RadioButton ( " ListBox " , & item_type , 9 ) ;
ImGui : : Separator ( ) ;
bool ret = false ;
bool ret = false ;
if ( item_type = = 0 ) { ImGui : : Text ( " ITEM: Text " ) ; } // Testing text items with no identifier/interaction
if ( item_type = = 0 ) { ImGui : : Text ( " ITEM: Text " ) ; } // Testing text items with no identifier/interaction
if ( item_type = = 1 ) { ret = ImGui : : Button ( " ITEM: Button " ) ; } // Testing button
if ( item_type = = 1 ) { ret = ImGui : : Button ( " ITEM: Button " ) ; } // Testing button
if ( item_type = = 2 ) { ret = ImGui : : Checkbox ( " ITEM: Checkbox " , & b ) ; } // Testing checkbox
if ( item_type = = 2 ) { ImGui : : PushButtonRepeat ( true ) ; ret = ImGui : : Button ( " ITEM: Button " ) ; ImGui : : PopButtonRepeat ( ) ; } // Testing button (with repeater)
if ( item_type = = 3 ) { ret = ImGui : : SliderFloat ( " ITEM: SliderFloat " , & col4f [ 0 ] , 0.0f , 1.0f ) ; } // Testing basic item
if ( item_type = = 3 ) { ret = ImGui : : Checkbox ( " ITEM: Checkbox " , & b ) ; } // Testing checkbox
if ( item_type = = 4 ) { ret = ImGui : : InputText ( " ITEM: InputText " , & str [ 0 ] , IM_ARRAYSIZE ( str ) ) ; } // Testing input text (which handles tabbing)
if ( item_type = = 4 ) { ret = ImGui : : SliderFloat ( " ITEM: SliderFloat " , & col4f [ 0 ] , 0.0f , 1.0f ) ; } // Testing basic item
if ( item_type = = 5 ) { ret = ImGui : : InputFloat3 ( " ITEM: InputFloat3 " , col4f ) ; } // Testing multi-component items (IsItemXXX flags are reported merged)
if ( item_type = = 5 ) { ret = ImGui : : InputText ( " ITEM: InputText " , & str [ 0 ] , IM_ARRAYSIZE ( str ) ) ; } // Testing input text (which handles tabbing)
if ( item_type = = 6 ) { ret = ImGui : : ColorEdit4 ( " ITEM: ColorEdit4 " , col4f ) ; } // Testing multi-component items (IsItemXXX flags are reported merged)
if ( item_type = = 6 ) { ret = ImGui : : InputFloat ( " ITEM: InputFloat " , col4f , 1.0f ) ; } // Testing +/- buttons on scalar input
if ( item_type = = 7 ) { ret = ImGui : : MenuItem ( " ITEM: MenuItem " ) ; } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
if ( item_type = = 7 ) { ret = ImGui : : InputFloat3 ( " ITEM: InputFloat3 " , col4f ) ; } // Testing multi-component items (IsItemXXX flags are reported merged)
if ( item_type = = 8 ) { ret = ImGui : : TreeNodeEx ( " ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick " , ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen ) ; } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
if ( item_type = = 8 ) { ret = ImGui : : ColorEdit4 ( " ITEM: ColorEdit4 " , col4f ) ; } // Testing multi-component items (IsItemXXX flags are reported merged)
if ( item_type = = 9 ) { const char * items [ ] = { " Apple " , " Banana " , " Cherry " , " Kiwi " } ; static int current = 1 ; ret = ImGui : : ListBox ( " ITEM: ListBox " , & current , items , IM_ARRAYSIZE ( items ) , IM_ARRAYSIZE ( items ) ) ; }
if ( item_type = = 9 ) { ret = ImGui : : MenuItem ( " ITEM: MenuItem " ) ; } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
if ( item_type = = 10 ) { ret = ImGui : : TreeNodeEx ( " ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick " , ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen ) ; } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
if ( item_type = = 11 ) { const char * items [ ] = { " Apple " , " Banana " , " Cherry " , " Kiwi " } ; static int current = 1 ; ret = ImGui : : ListBox ( " ITEM: ListBox " , & current , items , IM_ARRAYSIZE ( items ) , IM_ARRAYSIZE ( items ) ) ; }
ImGui : : BulletText (
ImGui : : BulletText (
" Return value = %d \n "
" Return value = %d \n "
" IsItemFocused() = %d \n "
" IsItemFocused() = %d \n "