Ejemplo n.º 1
0
 public StatusBar(AppWindow owner)
 {
     this.BackColor = owner.DarkColor;
     this.Dock      = DockStyle.Bottom;
     this.ForeColor = owner.LightColor;
     this.Height    = sz;
 }
Ejemplo n.º 2
0
            public Frame(AppWindow owner)
            {
                this.BackColor = owner.DarkColor;

                this.MouseDown += delegate(object sender, MouseEventArgs e)
                {
                    initialPoint = e.Location;
                };
            }
Ejemplo n.º 3
0
            public LeftFrame(AppWindow owner)
                : base(owner)
            {
                this.Dock  = DockStyle.Left;
                this.Width = thickness;

                this.MouseMove += delegate(object sender, MouseEventArgs e)
                {
                    if (!owner.Maximized && !owner.IsFixed)
                    {
                        if (e.Button == System.Windows.Forms.MouseButtons.Left)
                        {
                            finalPoint = e.Location;

                            int deltaX = (finalPoint.X - initialPoint.X);
                            int deltaY = (finalPoint.Y - initialPoint.Y);

                            if (this.Cursor == Cursors.SizeWE)
                            {
                                owner.Location = new Point(owner.Location.X + deltaX, owner.Location.Y);
                                owner.Width   -= deltaX;
                            }
                            else if (this.Cursor == Cursors.SizeNWSE)
                            {
                                owner.Location = new Point(owner.Location.X + deltaX, owner.Location.Y + deltaY);
                                owner.Size     = new Size(owner.Width - deltaX, owner.Height - deltaY);
                            }
                            else if (this.Cursor == Cursors.SizeNESW)
                            {
                                deltaY         = -deltaX;//a hack to solve a problem I cant figure out
                                owner.Location = new Point(owner.Location.X + deltaX, owner.Location.Y);
                                owner.Size     = new Size(owner.Width - deltaX, owner.Height + deltaY);
                            }
                        }
                        else
                        {
                            if (e.Y <= cornerThickness)
                            {
                                this.Cursor = Cursors.SizeNWSE;
                            }
                            else if ((this.Height - e.Y) <= cornerThickness)
                            {
                                this.Cursor = Cursors.SizeNESW;
                            }
                            else
                            {
                                this.Cursor = Cursors.SizeWE;
                            }
                        }
                    }
                };
            }
Ejemplo n.º 4
0
        public LeftPanelButton(AppWindow owner)
        {
            this.owner = owner;

            this.Font = new Font(this.Font.FontFamily, 15.0f);
            this.FlatAppearance.BorderSize = 0;
            this.FlatStyle         = FlatStyle.Flat;
            this.Height            = 40;
            this.Width             = 280;
            this.TextImageRelation = TextImageRelation.ImageBeforeText;

            this.Click += delegate
            {
                this.Highlight();
                this.Siblings.ForEach(c => c.Unhighlight());
            };

            this.Unhighlight();
        }
Ejemplo n.º 5
0
        public RegistrationForm(AppWindow owner)
        {
            InitializeComponent();

            this.Dock      = DockStyle.Fill;
            this.BackColor = Color.White;

            txtFirstName = new HintedTextBox("first name")
            {
                BorderStyle = System.Windows.Forms.BorderStyle.None,
                Font        = new System.Drawing.Font(this.Font.FontFamily, 11.0F),
                Width       = 400
            };
            txtFirstName.Location = new Point(20, 20);
            UnderlineFor lblLine1 = new UnderlineFor(txtFirstName, owner.DarkColor, SystemColors.GrayText)
            {
                BackColor = owner.DarkColor,
            };

            lblLine1.Location = new Point(txtFirstName.Location.X, txtFirstName.Bottom);
            this.Controls.Add(txtFirstName);
            this.Controls.Add(lblLine1);
        }
Ejemplo n.º 6
0
        public VerificationForm(AppWindow owner)
        {
            InitializeComponent();

            //this.Dock = DockStyle.Fill;
            //this.BackColor = Color.White;

            //picVerification = new PictureBox()
            //{
            //    Location = new Point(20, 20),
            //    Size = new Size(100, 100)
            //};
            //this.Controls.Add(picVerification);

            //btnScan = new Button()
            //{
            //    Location = new Point(picVerification.Left, picVerification. Bottom + 10),
            //    Size = new Size(100, 25)
            //};
            //this.Controls.Add(btnScan);

            //this.Load += VerificationForm_Load;
            ReaderCollection rc = ReaderCollection.GetReaders();
        }
Ejemplo n.º 7
0
        public LeftPanel(AppWindow owner)
        {
            this.BackColor = owner.DarkColor;
            this.Dock      = DockStyle.Left;
            this.Width     = 300;

            Label lblLogo = new Label()
            {
                AutoSize = false,
                Dock     = DockStyle.Top,
                Height   = 150
            };

            lblLogo.BackgroundImage       = Properties.Resources.LogoWhite;
            lblLogo.BackgroundImageLayout = ImageLayout.Zoom;
            this.Controls.Add(lblLogo);

            Label lblName = new Label()
            {
                AutoSize  = false,
                Font      = new Font(this.Font.FontFamily, 13.0f, FontStyle.Bold),
                ForeColor = owner.LightColor,
                Location  = new Point(0, lblLogo.Bottom + 10),
                Size      = new Size(300, 30),
                Text      = owner.Text,
                TextAlign = ContentAlignment.MiddleCenter
            };

            this.Controls.Add(lblName);

            //registration
            LeftPanelButton btnReg = new LeftPanelButton(owner)
            {
                Text = "Registration"
            };

            btnReg.Location = new Point(this.Width - btnReg.Width, lblName.Bottom + 10);
            btnReg.Click   += delegate
            {
                if (regForm == null)
                {
                    regForm = new RegistrationForm(owner);
                }
                owner.Body.Controls.Clear();
                owner.Body.Controls.Add(regForm);
                owner.Text = "Registration - IDPs Biometric Enumeration";
            };
            this.Controls.Add(btnReg);
            //verification
            LeftPanelButton btnVeri = new LeftPanelButton(owner)
            {
                Text = "Verification"
            };

            btnVeri.Location = new Point(btnReg.Left, btnReg.Bottom + 10);
            btnVeri.Click   += delegate
            {
                if (veriForm == null)
                {
                    veriForm = new VerificationForm(owner);
                }
                owner.Body.Controls.Clear();
                owner.Body.Controls.Add(veriForm);
                owner.Text = "Verification - IDPs Biometric Enumeration";
            };
            this.Controls.Add(btnVeri);
            //sync

            //
            btnReg.Siblings.Add(btnVeri);
            btnVeri.Siblings.Add(btnReg);

            owner.RegisterToMoveWindow(this);
            owner.RegisterToMoveWindow(lblLogo);
            owner.RegisterToMoveWindow(lblName);
        }
Ejemplo n.º 8
0
 public Container(AppWindow owner)
 {
     this.BackColor = owner.LightColor;
     this.Dock      = DockStyle.Fill;
 }
Ejemplo n.º 9
0
        public TitleBar(AppWindow owner)
        {
            this.owner = owner;

            this.BackColor = owner.LightColor;//this.BackColor = owner.DarkColor;
            this.Dock      = DockStyle.Top;
            this.ForeColor = owner.DarkColor;
            this.Height    = sz;

            ToolTip tooltip = new ToolTip();

            //customControls
            customControls = new List <Control>();

            //btnMinimize
            btnMinimize = new Label()
            {
                BackgroundImage       = Properties.Resources.Minimize,
                BackgroundImageLayout = ImageLayout.Stretch,
                Size = new Size(smSz, smSz)
            };
            btnMinimize.MouseEnter += delegate { btnMinimize.BackgroundImage = Properties.Resources.Minimize2; };
            btnMinimize.MouseLeave += delegate { btnMinimize.BackgroundImage = Properties.Resources.Minimize; };
            btnMinimize.Click      += delegate { owner.WindowState = FormWindowState.Minimized; };

            if (owner.Maximized)
            {
                MaximizeImageNormal = Properties.Resources.Restore;
                MaximizeImageFocus  = Properties.Resources.Restore2;
            }
            else
            {
                MaximizeImageNormal = Properties.Resources.Maximize;
                MaximizeImageFocus  = Properties.Resources.Maximize2;
            }
            //btnMaximize
            btnMaximize = new Label()
            {
                BackgroundImage       = MaximizeImageNormal,
                BackgroundImageLayout = ImageLayout.Stretch,
                Size = new Size(smSz, smSz)
            };
            btnMaximize.MouseEnter += delegate { btnMaximize.BackgroundImage = MaximizeImageFocus; };
            btnMaximize.MouseLeave += delegate { btnMaximize.BackgroundImage = MaximizeImageNormal; };
            btnMaximize.Click      += delegate { owner.Maximized = !owner.Maximized; };

            //btnClose
            btnClose = new Label()
            {
                BackgroundImage       = Properties.Resources.Close,
                BackgroundImageLayout = ImageLayout.Stretch,
                Size = new Size(smSz, smSz)
            };
            btnClose.MouseEnter += delegate { btnClose.BackgroundImage = Properties.Resources.Close2; };
            btnClose.MouseLeave += delegate { btnClose.BackgroundImage = Properties.Resources.Close; };
            btnClose.Click      += delegate { owner.Close(); };

            //dynamicPanel
            dynamicPanel = new Panel()
            {
                Height = 30,
                Width  = 0
            };
            this.Controls.Add(dynamicPanel);

            //btnIconBox
            btnIconBox = new Label()
            {
                BackgroundImage       = Properties.Resources.IconImage,
                BackgroundImageLayout = ImageLayout.Stretch,
                Location = new Point(offset, offset),
                Size     = new Size(smSz, smSz)
            };
            owner.RegisterToMoveWindow(btnIconBox);
            this.Controls.Add(btnIconBox);

            //lblAppName
            lblAppName = new Label()
            {
                AutoEllipsis = true,
                Font         = new System.Drawing.Font(this.Font.FontFamily, 11.0F),
                Height       = smSz,
                Text         = owner.Text,
                TextAlign    = ContentAlignment.BottomLeft
            };
            lblAppName.Location = new Point(btnIconBox.Location.X + btnIconBox.Width + offset, offset);
            this.Controls.Add(lblAppName);
            owner.RegisterToMoveWindow(lblAppName);
            owner.SizeChanged += delegate { lblAppName.Width = owner.Width / 2; };
            owner.TextChanged += delegate { lblAppName.Text = owner.Text; };

            owner.MaximizedChanged += owner_MaximizedChanged;

            this.SizeChanged += TitleBar_SizeChanged;

            RefreshTitleBar(true, true, true);
        }