Example #1
0
        /// <summary>
        /// Signals that the window is now loaded, which means we can load our graphics now.
        /// </summary>
        protected override void OnLoad()
        {
            base.OnLoad();
            MasterRenderer.Load();

            if (Settings.UseSystemUIScaling)
            {
                if (TryGetCurrentMonitorDpi(out float hdpi, out _))
                {
                    Settings.UIScaling = hdpi / 100;
                }
                else
                {
                    Log.WriteInfo("Failed to fetch system dpi scaling.");
                }
            }

            controller = new ImGuiController(ClientSize.X, ClientSize.Y);
            controller.SetScale(Settings.UIScaling);
            window = new ImGuiWindow(this, controller);

            var minimum = ClientRectangle.Min;

            ClientRectangle = new Box2i(minimum.X, minimum.Y, Settings.GraphWidth + minimum.X, Settings.GraphHeight + minimum.Y);

            IsLoaded = true;
        }
Example #2
0
        internal int FocusIdxTabRequestNext;             // "

        internal ImGuiWindow(string name)
        {
            DC           = new ImGuiDrawContext();
            IDStack      = new ImVector <uint>();
            StateStorage = new ImGuiStorage();
            MenuColumns  = new ImGuiSimpleColumns();
            DrawList     = new ImDrawList();

            Name = name;

            ID = ImGui.Hash(0, name);
            IDStack.push_back(ID);
            MoveID = GetID("#MOVE");

            Flags                    = 0;
            PosFloat                 = Pos = new ImVec2(0.0f, 0.0f);
            Size                     = SizeFull = new ImVec2(0.0f, 0.0f);
            SizeContents             = SizeContentsExplicit = new ImVec2(0.0f, 0.0f);
            WindowPadding            = new ImVec2(0.0f, 0.0f);
            Scroll                   = new ImVec2(0.0f, 0.0f);
            ScrollTarget             = new ImVec2(float.MaxValue, float.MaxValue);
            ScrollTargetCenterRatio  = new ImVec2(0.5f, 0.5f);
            ScrollbarX               = ScrollbarY = false;
            ScrollbarSizes           = new ImVec2(0.0f, 0.0f);
            BorderSize               = 0.0f;
            Active                   = WasActive = false;
            Accessed                 = false;
            Collapsed                = false;
            SkipItems                = false;
            BeginCount               = 0;
            PopupID                  = 0;
            AutoFitFramesX           = AutoFitFramesY = -1;
            AutoFitOnlyGrows         = false;
            AutoPosLastDirection     = -1;
            HiddenFrames             = 0;
            SetWindowPosAllowFlags   = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = (int)(ImGuiSetCond.ImGuiSetCond_Always | ImGuiSetCond.ImGuiSetCond_Once | ImGuiSetCond.ImGuiSetCond_FirstUseEver | ImGuiSetCond.ImGuiSetCond_Appearing);
            SetWindowPosCenterWanted = false;

            LastFrameActive  = -1;
            ItemWidthDefault = 0.0f;
            FontWindowScale  = 1.0f;

            RootWindow         = null;
            RootNonPopupWindow = null;

            FocusIdxAllCounter        = FocusIdxTabCounter = -1;
            FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = int.MaxValue;
            FocusIdxAllRequestNext    = FocusIdxTabRequestNext = int.MaxValue;
        }
Example #3
0
 public void AddLegacyWindow(ImGuiWindow oldWin)
 {
     LegacyWindowManager.AddWindow(oldWin);
 }
Example #4
0
        internal ImVec2 MousePosOnOpen; // Copy of mouse position at the time of opening popup

        internal ImGuiPopupRef(uint id, ImGuiWindow parent_window, uint parent_menu_set, ImVec2 mouse_pos)
        {
            PopupID = id; Window = null; ParentWindow = parent_window; ParentMenuSet = parent_menu_set; MousePosOnOpen = mouse_pos;
        }