admin 发表于 2023-4-7 21:30:56

012-imGui窗口中的单选框RadioBox方式2






郁金香灬外挂技术
       
        https://www.yjxsoft.com/
       
        本教程视频1920*1080分辩率下观看最佳
        VS2017+win10 64位 环境
        郁金香老师:扣扣 150330575
        欢迎大家参加 郁金香灬技术 游戏安全与外挂的研究学习。
       
        兴趣是我们最好的老师
        成长需要过程与循序渐进        
        兴趣+坚持+时间+优秀的教程会帮助你快速成功
   


学习目标:
    imGui窗口中的单选框RadioBox
        RadioBox返回值
       
       
        // use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }
    IMGUI_API bool RadioButton(const char* label, bool active);                  
          
        // shortcut to handle the above pattern when value is an integer
    IMGUI_API bool RadioButton(const char* label, IN OUT int* v, int v_button);         
       
   
   


          void CDX11::单选框测试2()
          {
            //代码块1
            {
                  enum ESEL
                  {
                      模式1=3,
                      模式2,
                      模式3
                  };

                  ImGui::Begin(u8"test RadioButton2");
                  {
                      //"Widgets/Basic/RadioButton"
                      static int 参数2 = 2;
                      BOOL press1 = ImGui::RadioButton(u8"1选择题 a", IN OUT & 参数2, ESEL::模式1); ImGui::SameLine();
                      BOOL press2 = ImGui::RadioButton(u8"2选择题 b", IN OUT & 参数2, 模式2); ImGui::SameLine();
                      BOOL press3 = ImGui::RadioButton(u8"3选择题 c", IN OUT & 参数2, 模式3);
                      if (press1 || press2 || press3)
                      {
                        printf("press<%d,%d,%d> 参数2=%d\r\n", press1, press2, press3, 参数2);
                      }
                  }
                  ImGui::End();


                  ImGui::Begin(u8"test RadioButton3");
                  {
                      //"Widgets/Basic/RadioButton"
                      static int 参数2 = 222;
                      BOOL press1 = ImGui::RadioButton(u8"111111 a", IN OUT & 参数2, 111); ImGui::SameLine();
                      BOOL press2 = ImGui::RadioButton(u8"222222 b", IN OUT & 参数2, 222); ImGui::SameLine();
                      BOOL press3 = ImGui::RadioButton(u8"333333 c", IN OUT & 参数2, 333);
                      if (press1 || press2 || press3)
                      {
                        printf("press<%d,%d,%d> 参数2=%d\r\n", press1, press2, press3, 参数2);
                      }
                  }
                  ImGui::End();



                  

            };

            return;
          }




页: [1]
查看完整版本: 012-imGui窗口中的单选框RadioBox方式2