예제 #1
0
        protected override void initVulkan()
        {
            base.initVulkan();

            iFace = new Crow.Interface((int)Width, (int)Height, WindowHandle);
            iFace.Init();

            initUISurface();
        }
예제 #2
0
 public void Init(Crow.Interface iFace)
 {
 }
예제 #3
0
 public VerticalStack(Interface iface) : base(iface)
 {
 }
예제 #4
0
        public override void onMouseMove(object sender, MouseMoveEventArgs e)
        {
            base.onMouseMove(sender, e);

            Interface otkgw = CurrentInterface;

            if (!hoverBorder)
            {
                currentDirection             = Direction.None;
                CurrentInterface.MouseCursor = XCursor.Default;
                return;
            }

            if (this.HasFocus && _movable)
            {
                if (e.Mouse.IsButtonDown(MouseButton.Left))
                {
                    int currentLeft = this.Left;
                    int currentTop = this.Top;
                    int currentWidth, currentHeight;

                    if (currentLeft == 0)
                    {
                        currentLeft = this.Slot.Left;
                        this.Left   = currentLeft;
                    }
                    if (currentTop == 0)
                    {
                        currentTop = this.Slot.Top;
                        this.Top   = currentTop;
                    }
                    if (this.Width.IsFixed)
                    {
                        currentWidth = this.Width;
                    }
                    else
                    {
                        currentWidth = this.Slot.Width;
                    }

                    if (this.Height.IsFixed)
                    {
                        currentHeight = this.Height;
                    }
                    else
                    {
                        currentHeight = this.Slot.Height;
                    }

                    switch (currentDirection)
                    {
                    case Direction.None:
                        this.Left = currentLeft + e.XDelta;
                        this.Top  = currentTop + e.YDelta;
                        break;

                    case Direction.N:
                        this.Height = currentHeight - e.YDelta;
                        if (this.Height == currentHeight - e.YDelta)
                        {
                            this.Top = currentTop + e.YDelta;
                        }
                        break;

                    case Direction.S:
                        this.Height = currentHeight + e.YDelta;
                        break;

                    case Direction.W:
                        this.Width = currentWidth - e.XDelta;
                        if (this.Width == currentWidth - e.XDelta)
                        {
                            this.Left = currentLeft + e.XDelta;
                        }
                        break;

                    case Direction.E:
                        this.Width = currentWidth + e.XDelta;
                        break;

                    case Direction.NW:
                        this.Height = currentHeight - e.YDelta;
                        if (this.Height == currentHeight - e.YDelta)
                        {
                            this.Top = currentTop + e.YDelta;
                        }
                        this.Width = currentWidth - e.XDelta;
                        if (this.Width == currentWidth - e.XDelta)
                        {
                            this.Left = currentLeft + e.XDelta;
                        }
                        break;

                    case Direction.NE:
                        this.Height = currentHeight - e.YDelta;
                        if (this.Height == currentHeight - e.YDelta)
                        {
                            this.Top = currentTop + e.YDelta;
                        }
                        this.Width = currentWidth + e.XDelta;
                        break;

                    case Direction.SW:
                        this.Width = currentWidth - e.XDelta;
                        if (this.Width == currentWidth - e.XDelta)
                        {
                            this.Left = currentLeft + e.XDelta;
                        }
                        this.Height = currentHeight + e.YDelta;
                        break;

                    case Direction.SE:
                        this.Height = currentHeight + e.YDelta;
                        this.Width  = currentWidth + e.XDelta;
                        break;
                    }
                    return;
                }
            }
//			GraphicObject firstFocusableAncestor = otkgw.hoverWidget;
//			while (firstFocusableAncestor != this) {
//				if (firstFocusableAncestor == null)
//					return;
//				if (firstFocusableAncestor.Focusable)
//					return;
//				firstFocusableAncestor = firstFocusableAncestor.Parent as GraphicObject;
//			}
            if (Resizable)
            {
                Direction lastDir = currentDirection;

                if (Math.Abs(e.Position.Y - this.Slot.Y) < Interface.BorderThreshold)
                {
                    if (Math.Abs(e.Position.X - this.Slot.X) < Interface.BorderThreshold)
                    {
                        currentDirection = Direction.NW;
                    }
                    else if (Math.Abs(e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
                    {
                        currentDirection = Direction.NE;
                    }
                    else
                    {
                        currentDirection = Direction.N;
                    }
                }
                else if (Math.Abs(e.Position.Y - this.Slot.Bottom) < Interface.BorderThreshold)
                {
                    if (Math.Abs(e.Position.X - this.Slot.X) < Interface.BorderThreshold)
                    {
                        currentDirection = Direction.SW;
                    }
                    else if (Math.Abs(e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
                    {
                        currentDirection = Direction.SE;
                    }
                    else
                    {
                        currentDirection = Direction.S;
                    }
                }
                else if (Math.Abs(e.Position.X - this.Slot.X) < Interface.BorderThreshold)
                {
                    currentDirection = Direction.W;
                }
                else if (Math.Abs(e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
                {
                    currentDirection = Direction.E;
                }
                else
                {
                    currentDirection = Direction.None;
                }

                if (currentDirection != lastDir)
                {
                    switch (currentDirection)
                    {
                    case Direction.None:
                        otkgw.MouseCursor = XCursor.Default;
                        break;

                    case Direction.N:
                        otkgw.MouseCursor = XCursor.V;
                        break;

                    case Direction.S:
                        otkgw.MouseCursor = XCursor.V;
                        break;

                    case Direction.E:
                        otkgw.MouseCursor = XCursor.H;
                        break;

                    case Direction.W:
                        otkgw.MouseCursor = XCursor.H;
                        break;

                    case Direction.NW:
                        otkgw.MouseCursor = XCursor.NW;
                        break;

                    case Direction.NE:
                        otkgw.MouseCursor = XCursor.NE;
                        break;

                    case Direction.SW:
                        otkgw.MouseCursor = XCursor.SW;
                        break;

                    case Direction.SE:
                        otkgw.MouseCursor = XCursor.SE;
                        break;
                    }
                }
            }
        }
예제 #5
0
 public static XCursorFile Load(Interface iface, string path)
 {
     return(loadFromStream(iface.GetStreamFromPath(path)));
 }
예제 #6
0
 public ColorSelector(Interface iface) : base(iface)
 {
 }
예제 #7
0
 public Popper(Interface iface) : base(iface)
 {
 }
예제 #8
0
 public DockStack(Interface iface) : base(iface)
 {
 }
예제 #9
0
 public TabItem(Interface iface) : base(iface)
 {
 }
예제 #10
0
파일: TextRun.cs 프로젝트: masums/Crow
 public TextRun(Interface iface) : base(iface)
 {
 }
예제 #11
0
파일: GroupBox.cs 프로젝트: masums/Crow
 public GroupBox(Interface iface) : base(iface)
 {
 }
예제 #12
0
 public Menu(Interface iface) : base(iface)
 {
 }
예제 #13
0
 public FileDialog(Interface iface) : base(iface)
 {
 }
예제 #14
0
파일: TreeView.cs 프로젝트: masums/Crow
 public TreeView(Interface iface) : base(iface)
 {
 }
예제 #15
0
파일: TabView.cs 프로젝트: masums/Crow
 public TabView(Interface iface) : base(iface)
 {
 }