示例#1
0
        // /////////////////////////////////////////////////////////////////////////////////
        // /////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Sets the current Window, which will immediately begin to receive
        /// framework messages.  Windows can be changed at any time.  If the specified window
        /// has not yet received a SettingUp message (i.e. it has not already been set as
        /// an application window previously), then OnSettingUp will be called.
        /// </summary>
        /// <param name="win"></param>
        public void SetWindow(Window win)
        {
            if (win == null)
            {
                throw new ArgumentNullException("win");
            }

            Input = new InputManager(win);
            CurrentWindow = win;
            win.ParentApplication = this;
            win.Pigments = new PigmentMap(this.Pigments,
                win.PigmentOverrides);

            if (!win.isSetup)
            {
                win.OnSettingUp();
            }
        }
示例#2
0
        // /////////////////////////////////////////////////////////////////////////////////
        private int Run()
        {
            if (CurrentWindow == null)
            {
                Window win = new Window(new WindowTemplate());
                SetWindow(win);
            }

            while (!TCODConsole.isWindowClosed() && !IsQuitting)
            {
                Update();
                Draw();
            }

            return 0;
        }
示例#3
0
        // /////////////////////////////////////////////////////////////////////////////////
        public Tooltip(string text, Point sPos, Window parentWindow)
        {
            size = new Size(Canvas.TextLength(text) + 2, 3);
            this.parentWindow = parentWindow;

            AutoPosition(sPos);

            canvas = new Canvas(size);

            canvas.SetDefaultPigment(parentWindow.Pigments[PigmentType.Tooltip]);
            canvas.PrintFrame("");

            canvas.PrintString(1, 1, text);
        }