コード例 #1
0
ファイル: AbstractInterface.cs プロジェクト: malacandrian/fyp
        /// <summary>
        /// Create a new interface with a specific icon
        /// </summary>
        /// <param Name="icon"></param>
        protected AbstractInterface(PImage icon)
        {
            //Create the icon
            Icon = icon;
            Icon.Bounds = new RectangleF(MinWidth + Padding, Padding, IconBounds.Width, IconBounds.Height);
            AddChild(Icon);

            //Create the background
            Background = PPath.CreateRectangle(0, 0, MinWidth + IconBounds.Width + (Padding * 2), 100);
            AddChild(Background);

            //Create the text entry field
            Entry = new PText();
            Entry.ConstrainHeightToTextHeight = false;
            Entry.Bounds = new RectangleF(Padding, Padding, 0, TextHeight);
            Entry.Font = new Font("Century Gothic", 32);
            AddChild(Entry);

            //Create the text entry handler
            Handler = new InterfaceTextEntryHandler(this);
            Entry.AddInputEventListener(Handler);
        }
コード例 #2
0
        /// <summary>
        /// Create a new interface with a specific icon
        /// </summary>
        /// <param Name="icon"></param>
        protected AbstractInterface(PImage icon)
        {
            //Create the icon
            Icon        = icon;
            Icon.Bounds = new RectangleF(MinWidth + Padding, Padding, IconBounds.Width, IconBounds.Height);
            AddChild(Icon);

            //Create the background
            Background = PPath.CreateRectangle(0, 0, MinWidth + IconBounds.Width + (Padding * 2), 100);
            AddChild(Background);

            //Create the text entry field
            Entry = new PText();
            Entry.ConstrainHeightToTextHeight = false;
            Entry.Bounds = new RectangleF(Padding, Padding, 0, TextHeight);
            Entry.Font   = new Font("Century Gothic", 32);
            AddChild(Entry);

            //Create the text entry handler
            Handler = new InterfaceTextEntryHandler(this);
            Entry.AddInputEventListener(Handler);
        }