예제 #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
파일: Tooltip.cs 프로젝트: AIBrain/ochregui
        // /////////////////////////////////////////////////////////////////////////////////
        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);
        }