Exemplo n.º 1
0
        // /////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Construct a Window instance from the given template.
        /// </summary>
        /// <param name="template"></param>
        public Window(WindowTemplate template)
            : base(template)
        {
            this.controlList = new List<Control>();
            this.managerList = new List<Manager>();

            HasFrame = template.HasFrame;
            TooltipBGAlpha = template.TooltipBGAlpha;
            TooltipFGAlpha = template.TooltipFGAlpha;
        }
Exemplo n.º 2
0
        // /////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Construct a Window instance from the given template.
        /// </summary>
        /// <param name="template"></param>
        public Window(WindowTemplate template)
            : base(template)
        {
            this.controlList = new List <Control>();
            this.managerList = new List <Manager>();

            HasFrame       = template.HasFrame;
            TooltipBGAlpha = template.TooltipBGAlpha;
            TooltipFGAlpha = template.TooltipFGAlpha;
        }
Exemplo n.º 3
0
        /// Setup() gets called immediately after Application.Start(), and we can override this to provide custom
        /// initialization code.
        /// 
        /// The first thing we need to do in this method, however, is call the base method - this
        /// initializes libtcod, opening the system window and setting the font, all according to the options provided in
        /// the ApplicationInfo parameter.
        /// 
        /// After calling the base method, we add our setup code, in this case creating the MyWindow (defined below) object 
        /// and setting it as the current Window.
        protected override void Setup(ApplicationInfo info)
        {
            /// One thing to note: in almost all cases, when overriding a framework method it is necessary
            /// to call the base method first.  The base methods handle most of the gritty details of triggering
            /// events, propagating messages, and calling the necessary stub methods.
            base.Setup(info);

            /// Just use the default options in the WindowTemplate.
            WindowTemplate mainWindowTemplate = new WindowTemplate();

            /// Create the mainWindow with the options specified in mainWindowInfo.  We define MyWindow below.
            MyWindow mainWindow = new MyWindow(mainWindowTemplate);

            /// Set the mainWindow to be MyApplication's window.  Note that if we don't set the application window,
            /// a default one is created and set automatically.
            SetWindow(mainWindow);
        }
Exemplo n.º 4
0
 /// Any subclass of Window (actually, of Widget, of which Window is derived from) must call the base constructor
 /// with a single parameter of type WindowTemplate, or a class derived from WindowTemplate.  We are 
 /// keeping this simple, so we will use the default WindowTemplate class instead of deriving our own.
 public MyWindow(WindowTemplate template)
     : base(template)
 {
 }
Exemplo n.º 5
0
 /// The constructor has been modified so that it must be passed a Player object, which
 /// we will store in a field for later use.
 public MyWindow(WindowTemplate template,Player player)
     : base(template)
 {
     this.player = player;
 }