Exemple #1
0
        internal static bool Begin(string Title, LGuiRect Rect)
        {
            var ID = LGuiHash.CalculateID(Title);

            LGuiContext.SetPreviousControlID(ID);

            if (!LGuiMisc.CheckVisible(ref Rect))
            {
                return(false);
            }

            var IsOpen = LGuiContextCache.GetPopupOpen(Title);

            if (IsOpen)
            {
                if (LGuiContext.IO.IsMouseClick(LGuiMouseButtons.Left) && !LGuiMisc.Contains(ref Rect, ref LGuiContext.IO.MousePos))
                {
                    LGuiContextCache.SetPopupOpen(Title, false);
                    return(false);
                }

                LGuiGraphics.SetCurrentLevel(LGuiCommandLevel.Popup);
                LGuiGraphics.DrawRect(Rect, LGuiStyleColorIndex.Frame, true);
                LGuiFrame.Begin(Title, Rect, false);
            }

            return(IsOpen);
        }
Exemple #2
0
 internal static void Open(string Title, LGuiVec2 Pos)
 {
     LGuiContextCache.SetPopupOpen(Title, true);
     LGuiContextCache.SetPopupPos(Title, Pos);
 }
Exemple #3
0
 internal static void Close(string Title)
 {
     LGuiContextCache.SetPopupOpen(Title, false);
 }