Exemple #1
0
        public override bool OnMessage(GUIMessage message)
        {
            switch (message.Message)
            {
            case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
            {
                GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT, GetID, 0, 0, 0, 0, null);
                //g_application.m_guiWindowOSD.OnMessage(msg);	// Send an init msg to the OSD
                GUIGraphicsContext.Save();
                GUIGraphicsContext.Calibrating = false;
                // reset our screen resolution to what it was initially
                //GUIGraphicsContext.SetGUIResolution(g_stSettings.m_ScreenResolution);
                // Inform the player so we can update the resolution
                //if (g_application.m_pPlayer)
                //  g_application.m_pPlayer.Update();
            }
            break;

            case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
            {
                base.OnMessage(message);
                m_iControl = (int)Controls.CONTROL_TOP_LEFT;
                m_iSpeed   = 1;
                m_iCountU  = 0;
                m_iCountD  = 0;
                m_iCountL  = 0;
                m_iCountR  = 0;
                GUIGraphicsContext.Calibrating = true;
                // Inform the player so we can update the resolution

                // disable the UI calibration for our controls...
                GUIImage pControl = (GUIImage)GetControl((int)Controls.CONTROL_BOTTOM_RIGHT);
                if (null != pControl)
                {
                    pControl.CalibrationEnabled = false;
                    pControl = (GUIImage)GetControl((int)Controls.CONTROL_TOP_LEFT);
                    pControl.CalibrationEnabled = false;
                    pControl = (GUIImage)GetControl((int)Controls.CONTROL_SUBTITLES);
                    pControl.CalibrationEnabled = false;
                    pControl = (GUIImage)GetControl((int)Controls.CONTROL_PIXEL_RATIO);
                    pControl.CalibrationEnabled = false;
                    pControl = (GUIImage)GetControl((int)Controls.CONTROL_OSD);
                    pControl.CalibrationEnabled = false;
                    m_fPixelRatioBoxHeight      = (float)pControl.Height;
                }

                GUIMessage msg    = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null);
                GUIWindow  window = GUIWindowManager.GetWindow((int)Window.WINDOW_OSD);
                window.OnMessage(msg); // Send an init msg to the OSD
                return(true);
            }
            }
            return(base.OnMessage(message));
        }
Exemple #2
0
        public override bool OnMessage(GUIMessage message)
        {
            switch (message.Message)
            {
            case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
            {
                GUIWindowManager.OnResize();
                GUIWindowManager.PreInit();
                GUIGraphicsContext.Save();
                if (m_orgZoomVertical != GUIGraphicsContext.ZoomVertical) // only vertical zoom affects font sizes
                {
                    GUIDialogNotify dlgNotify =
                        (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);
                    if (dlgNotify != null)
                    {
                        dlgNotify.Reset();
                        dlgNotify.ClearAll();
                        dlgNotify.SetHeading(213);                       // UI Calibration
                        dlgNotify.SetText(GUILocalizeStrings.Get(2650)); // Reloading fonts, please wait...
                        dlgNotify.TimeOut = 1;
                        dlgNotify.DoModal(GUIWindowManager.ActiveWindow);
                    }
                    GUIFontManager.LoadFonts(Config.GetFile(Config.Dir.Skin, GUIGraphicsContext.Skin, "fonts.xml"));
                    GUIFontManager.InitializeDeviceObjects();
                }
            }
            break;

            case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
            {
                base.OnMessage(message);
                m_iSpeed          = 1;
                m_iCountU         = 0;
                m_iCountD         = 0;
                m_iCountL         = 0;
                m_iCountR         = 0;
                m_iMode           = 0;
                m_bModeLocked     = true;
                m_orgZoomVertical = GUIGraphicsContext.ZoomVertical;
                m_iLogWidth       = (int)Math.Round((float)GUIGraphicsContext.Width * (float)GUIGraphicsContext.ZoomHorizontal);
                m_iLogHeight      = (int)Math.Round((float)GUIGraphicsContext.Height * (float)GUIGraphicsContext.ZoomVertical);
                ClampLogicalScreenSize();
                UpdateControlLabel();
                return(true);
            }
            }
            return(base.OnMessage(message));
        }