コード例 #1
0
ファイル: dialogs.cs プロジェクト: OOP-03376400/DF_GCS_W
        public Dialog(String title, int x, int y, uint width, uint height)
        {
            tittleBar = new DialogTittleBar(title);

            top    = 12;
            bottom = 14;
            left   = 12;
            right  = 12;

            borderUpLeft      = new DialogBorder(9, 7, 4, 4);
            borderUpRight     = new DialogBorder((int)(width - 9 - 4), 7, 4, 4);
            borderUp          = new DialogBorder(13, 7, width - 26, 4);
            borderLeft        = new DialogBorder(9, 11, 4, height - 27);
            borderRight       = new DialogBorder((int)(width - 13), 11, 4, height - 27);
            borderBottomLeft  = new DialogBorder(9, (int)(height - 27), 4, 4);
            borderBottom      = new DialogBorder(13, (int)(height - 27), width - 26, 4);
            borderBottomRight = new DialogBorder((int)(width - 13), (int)(height - 27), 4, 4);

            dialogBorders[0] = borderUpLeft;
            dialogBorders[1] = borderUpRight;
            dialogBorders[2] = borderUp;
            dialogBorders[3] = borderLeft;
            dialogBorders[4] = borderRight;
            dialogBorders[5] = borderBottomLeft;
            dialogBorders[6] = borderBottom;
            dialogBorders[7] = borderBottomRight;

            Dragable  = true;
            Resizable = true;
            showType  = EShowType.None;

            Position.X  = x;
            Position.Y  = y;
            Size.width  = width;
            Size.height = height;

            Pack();

            tittleBar.DragMovedEvent += new DragMovedHandler(tittleBar_DragMovedEvent);

            borderLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderLeft.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderRight.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderUp.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUp.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUp.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderBottom.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottom.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottom.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);
            //===========================================================================

            borderUpLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUpLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUpLeft.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderUpRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUpRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUpRight.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderBottomLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottomLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottomLeft.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);

            borderBottomRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottomRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottomRight.DragMovedEvent    += new DragMovedHandler(border_DragMovedEvent);
        }
コード例 #2
0
        public override void PaintDialogTittleBar(DialogTittleBar component)
        {
            Position origin = UI.Instance.GetOrigin();

            GL.Color3((byte)31, (byte)31, (byte)31);
            GL.Begin(BeginMode.Quads);
            GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y);
            GL.Vertex2(origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y);
            GL.Vertex2(origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y + component.Size.height);
            GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y + component.Size.height);
            GL.End();
            GL.Color3(1f, 1f, 1f);
            component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X);
            component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y);
            component.textFont.Render(true);
        }
コード例 #3
0
 public override Size GetDialogTittleBarPreferedSize(DialogTittleBar component)
 {
     UI.Instance.CurrentTheme.defaultTextFont.MeasureString(component.Text, out w, out h);
     return new Size(20 + (uint)w, 20);
 }
コード例 #4
0
ファイル: Theme.cs プロジェクト: RobertCL/MissionPlanner
 public abstract void PaintDialogTittleBar(DialogTittleBar component);
コード例 #5
0
ファイル: Theme.cs プロジェクト: RobertCL/MissionPlanner
 public abstract Size GetDialogTittleBarPreferedSize(DialogTittleBar component);
コード例 #6
0
ファイル: dialogs.cs プロジェクト: RobertCL/MissionPlanner
        public Dialog(String title, int x, int y, uint width, uint height)
        {
            tittleBar = new DialogTittleBar(title);

            top = 12;
            bottom = 14;
            left = 12;
            right = 12;

            borderUpLeft = new DialogBorder(9, 7, 4, 4);
            borderUpRight = new DialogBorder((int)(width - 9 - 4), 7, 4, 4);
            borderUp = new DialogBorder(13, 7, width - 26, 4);
            borderLeft = new DialogBorder(9, 11, 4, height - 27);
            borderRight = new DialogBorder((int)(width - 13), 11, 4, height - 27);
            borderBottomLeft = new DialogBorder(9, (int)(height - 27), 4, 4);
            borderBottom = new DialogBorder(13, (int)(height - 27), width - 26, 4);
            borderBottomRight = new DialogBorder((int)(width - 13), (int)(height - 27), 4, 4);

            dialogBorders[0] = borderUpLeft;
            dialogBorders[1] = borderUpRight;
            dialogBorders[2] = borderUp;
            dialogBorders[3] = borderLeft;
            dialogBorders[4] = borderRight;
            dialogBorders[5] = borderBottomLeft;
            dialogBorders[6] = borderBottom;
            dialogBorders[7] = borderBottomRight;

            Dragable = true;
            Resizable = true;
            showType = EShowType.None;

            Position.X = x;
            Position.Y = y;
            Size.width = width;
            Size.height = height;

            Pack();

            tittleBar.DragMovedEvent += new DragMovedHandler(tittleBar_DragMovedEvent);

            borderLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderLeft.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderRight.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderUp.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUp.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUp.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderBottom.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottom.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottom.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);
            //===========================================================================

            borderUpLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUpLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUpLeft.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderUpRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderUpRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderUpRight.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderBottomLeft.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottomLeft.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottomLeft.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);

            borderBottomRight.MouseEnteredEvent += new MouseEnteredHandler(border_MouseEvent);
            borderBottomRight.MousePressedEvent += new MousePressedHandler(border_MouseEvent);
            borderBottomRight.DragMovedEvent += new DragMovedHandler(border_DragMovedEvent);
        }