admin 发表于 2023-4-7 21:33:27

017-imGui窗口中的页面控件Tab与CheckboxFlags






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


学习目标:
   页面控件Tab
   页面控件标志组合ImGuiTabBarFlags
   复选框CheckboxFlags


    IMGUI_API bool          CheckboxFlags(const char* label, int* flags, int flags_value);
    IMGUI_API bool          CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
       
    // Flags for ImGui::BeginTabBar()
enum ImGuiTabBarFlags_
{
    ImGuiTabBarFlags_None                           = 0,
    ImGuiTabBarFlags_Reorderable                  = 1 << 0,   // Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
    ImGuiTabBarFlags_AutoSelectNewTabs            = 1 << 1,   // Automatically select new tabs when they appear
    ImGuiTabBarFlags_TabListPopupButton             = 1 << 2,   // Disable buttons to open the tab list popup
    ImGuiTabBarFlags_NoCloseWithMiddleMouseButton   = 1 << 3,   // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
    ImGuiTabBarFlags_NoTabListScrollingButtons      = 1 << 4,   // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll)
    ImGuiTabBarFlags_NoTooltip                      = 1 << 5,   // Disable tooltips when hovering a tab
    ImGuiTabBarFlags_FittingPolicyResizeDown      = 1 << 6,   // Resize tabs when they don't fit
    ImGuiTabBarFlags_FittingPolicyScroll            = 1 << 7,   // Add scroll buttons when tabs don't fit
    ImGuiTabBarFlags_FittingPolicyMask_             = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll,
    ImGuiTabBarFlags_FittingPolicyDefault_          = ImGuiTabBarFlags_FittingPolicyResizeDown,
};


   
       
//ImGuiTabBarFlags_TabListPopupButton 带了一个下拉列表
void CDX11::测试页面UI()
{
   ImGui::Begin(u8"测试页面UI");

   if (ImGui::BeginTabBar("MyTabBar", 0))
   {
         if (ImGui::BeginTabItem("1111"))
         {
             //显示页面1的控件
             static bool v1 = 0;
             ImGui::Checkbox("11111", &v1);
             ImGui::EndTabItem();
         };
         if(ImGui::BeginTabItem("2222"))
         {
            // 显示页面2的控件
             static bool v1 = 0;
             ImGui::Checkbox("2222", &v1);
             ImGui::Button("2222" );

             ImGui::EndTabItem();
         };
      if(ImGui::BeginTabItem("3333"))
         {
             ImGui::EndTabItem();
         };

      if( ImGui::BeginTabItem("4444"))
         {
             ImGui::EndTabItem();
         };

         ImGui::EndTabBar();
   }
   ImGui::End();


};

    if (pressed)
    {
      if (all_on)
            *flags |= flags_value;
      else
            *flags &= ~flags_value;
    }
       
       

    if (某个复选框被按下)
    {
      if (某个复选框在选中状态)
            *开关 |= 某个状态;//添加某个标志
      else
            *开关 &= ~某个状态; //去掉某个标志
    }
       
       


页: [1]
查看完整版本: 017-imGui窗口中的页面控件Tab与CheckboxFlags