Ejemplo n.º 1
0
 internal static void EndGUILayer(GUILayer layer)
 {
     if (m_layer != layer)
     {
         throw new Exception();
     }
     m_layer = null;
 }
Ejemplo n.º 2
0
 internal static void StartGUILayer(GUILayer layer)
 {
     if (m_layer != null)
     {
         throw new Exception();
     }
     m_layer = layer;
 }
Ejemplo n.º 3
0
        public void AddView(GUIView view, GUILayerType layertype)
        {
            startFrameAction.Call(() =>
            {
                var layer = GetLayer(layertype);
                if (layer == null)
                {
                    layer = new GUILayer(this, layertype);
                    m_layers.Add(layer);

                    m_layers.Sort((a, b) => { return(a.Order.CompareTo(b.Order)); });
                }
                layer.AddView(view);
            });
        }
Ejemplo n.º 4
0
        private void CheckFocused(RigelGUIEvent e)
        {
            if ((!e.IsMouseDragEvent() || !Frame.OnDragDrop) && !e.IsMouseActiveEvent())
            {
                return;
            }

            GUILayer lastFocusedLayer = m_focusedLayer;

            m_focusedLayer = null;

            foreach (var layer in m_layers)
            {
                if (layer.CheckFocused(e, Frame))
                {
                    m_focusedLayer = layer;
                    if (!Frame.OnDragDrop)
                    {
                        break;
                    }
                }
                else
                {
                    if (lastFocusedLayer == layer)
                    {
                        lastFocusedLayer = null;
                    }
                }
            }

            if (lastFocusedLayer != null && lastFocusedLayer != m_focusedLayer)
            {
                lastFocusedLayer.RemoveFocus(e);

                Console.WriteLine("remove focus");
                return;
            }
        }