Click here to Skip to main content
15,898,010 members
Articles / Mobile Apps

Windows Mobile Password Safe

Rate me:
Please Sign up or sign in to vote.
4.87/5 (58 votes)
12 Jan 2009CPOL16 min read 161.9K   3.1K   139  
A password safe with a touch screen UI introducing Fluid Controls.
using System;

using System.Collections.Generic;
using System.Text;

namespace Fluid.Controls
{
    /// <summary>
    /// A control that represents a tab item for a tab control.
    /// </summary>
    public class PageControl : ControlContainer
    {
        public PageControl(string title)
            : base()
        {
            this.Title = title;
        }

        protected override void InitControl()
        {
            base.InitControl();
            if (Bounds.IsEmpty) bounds = new System.Drawing.Rectangle(0, 0, 240, 300);
            buttons = new ButtonCollection(null);
            buttons.ListChanged += new System.ComponentModel.ListChangedEventHandler(buttons_ListChanged);
        }

        void buttons_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
        {

        }

        private FluidControl control;
        internal NavigationPanel tabPanel;

        /// <summary>
        /// Gets or sets the child control.
        /// </summary>
        public FluidControl Control
        {
            get { return control; }
            set
            {
                if (control != value)
                {
                    if (control != null) controls.Remove(control);
                    control = value;
                    if (value != null)
                    {
                        controls.Add(value);
                        value.Bounds = ClientRectangle;
                    }
                }
            }
        }

        private string title;

        public string Title
        {
            get { return title; }
            set
            {
                if (title != value)
                {
                    title = value;
                    OnTitleChanged();
                }
            }
        }

        private FluidButton backButton;

        public FluidButton BackButton
        {
            get { return backButton; }
            set { backButton = value; }
        }

        private ButtonCollection buttons;

        public ButtonCollection Buttons
        {
            get { return buttons; }
        }

        private void OnTitleChanged()
        {
            if (TitleChanged != null) TitleChanged(this, EventArgs.Empty);
        }

        public event EventHandler TitleChanged;

        protected override void OnSizeChanged(System.Drawing.Size oldSize, System.Drawing.Size newSize)
        {
            base.OnSizeChanged(oldSize, newSize);
            if (control != null) control.Bounds = ClientRectangle;
        }

        protected override void OnPaintBackground(FluidPaintEventArgs e)
        {
            //base.OnPaintBackground(e);
        }

        public override void Scale(System.Drawing.SizeF scaleFactor)
        {
            base.Scale(scaleFactor);
            Buttons.Width = (int)(Buttons.Width * scaleFactor.Width);
        }

        public override void Focus()
        {
            if (Control != null) Control.Focus();
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Germany Germany
MCPD
Enterprise Application Developer 3.5
Windows Developer 3.5
.ASP.NET Developer 3.5
.NET 2.0 Windows Developer
.NET 2.0 Web Developer
.NET 2.0 Enterprise Application Developer


MCTS
.NET 3.5 Windows Forms Applications
.NET 3.5 ASP.NET Applications
.NET 3.5, ADO.NET Application Development
.NET 3.5 WCF
.NET 3.5 WPF
.NET 3.5 WF
Microsoft SQL Server 2008, Database Development
.NET 2.0 Windows Applications
.NET 2.0 Web Applications
.NET 2.0 Distributed Applications
SQL Server 2005
Sharepoint Services 3.0 Application Development
Windows Vista Client Configuration

Comments and Discussions