public void RenderDlg(float timePassed) { lock (this) { // render the parent window if (null != m_pParentWindow) { m_pParentWindow.Render(timePassed); } GUIFontManager.Present(); // render this dialog box base.Render(timePassed); } }
public void OnGUI() { Window.Render(OnDraw); }
public override void Render(float timePassed) { // hide all our controls GUIImage pControl = (GUIImage)GetControl((int)Controls.CONTROL_BOTTOM_RIGHT); if (null != pControl) { pControl.IsVisible = false; } pControl = (GUIImage)GetControl((int)Controls.CONTROL_SUBTITLES); if (null != pControl) { pControl.IsVisible = false; } pControl = (GUIImage)GetControl((int)Controls.CONTROL_TOP_LEFT); if (null != pControl) { pControl.IsVisible = false; } pControl = (GUIImage)GetControl((int)Controls.CONTROL_PIXEL_RATIO); if (null != pControl) { pControl.IsVisible = false; } pControl = (GUIImage)GetControl((int)Controls.CONTROL_OSD); if (null != pControl) { pControl.IsVisible = false; } int iXOff, iYOff; string strStatus = ""; switch (m_iControl) { case (int)Controls.CONTROL_TOP_LEFT: { iXOff = GUIGraphicsContext.OverScanLeft; iYOff = GUIGraphicsContext.OverScanTop; pControl = (GUIImage)GetControl((int)Controls.CONTROL_TOP_LEFT); if (null != pControl) { pControl.IsVisible = true; pControl.Height = pControl.TextureHeight; pControl.Width = pControl.TextureWidth; pControl.SetPosition(iXOff, iYOff); } string strMode = GUILocalizeStrings.Get(272); strStatus = String.Format("{0} ({1},{2})", strMode, iXOff, iYOff); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW2, GUILocalizeStrings.Get(276)); } break; case (int)Controls.CONTROL_BOTTOM_RIGHT: { iXOff = GUIGraphicsContext.OverScanLeft; iYOff = GUIGraphicsContext.OverScanTop; iXOff += GUIGraphicsContext.OverScanWidth; iYOff += GUIGraphicsContext.OverScanHeight; pControl = (GUIImage)GetControl((int)Controls.CONTROL_BOTTOM_RIGHT); if (null != pControl) { pControl.IsVisible = true; int iTextureWidth = pControl.TextureWidth; int iTextureHeight = pControl.TextureHeight; pControl.Height = iTextureHeight; pControl.Width = pControl.TextureWidth; pControl.SetPosition(iXOff - iTextureWidth, iYOff - iTextureHeight); int iXOff1 = GUIGraphicsContext.Width - iXOff; int iYOff1 = GUIGraphicsContext.Height - iYOff; string strMode = GUILocalizeStrings.Get(273); strStatus = String.Format("{0} ({1},{2})", strMode, iXOff1, iYOff1); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW2, GUILocalizeStrings.Get(276)); } } break; case (int)Controls.CONTROL_SUBTITLES: { iXOff = GUIGraphicsContext.OverScanLeft; iYOff = GUIGraphicsContext.Subtitles; int iScreenWidth = GUIGraphicsContext.OverScanWidth; pControl = (GUIImage)GetControl((int)Controls.CONTROL_SUBTITLES); if (null != pControl) { pControl.IsVisible = true; int iTextureWidth = pControl.TextureWidth; int iTextureHeight = pControl.TextureHeight; pControl.Height = pControl.TextureHeight; pControl.Width = pControl.TextureWidth; pControl.SetPosition(iXOff + (iScreenWidth - iTextureWidth) / 2, iYOff - iTextureHeight); string strMode = GUILocalizeStrings.Get(274); strStatus = String.Format("{0} ({1})", strMode, iYOff); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW2, GUILocalizeStrings.Get(277)); } } break; case (int)Controls.CONTROL_PIXEL_RATIO: { float fSqrtRatio = (float)Math.Sqrt(GUIGraphicsContext.PixelRatio); pControl = (GUIImage)GetControl((int)Controls.CONTROL_PIXEL_RATIO); if (null != pControl) { pControl.IsVisible = true; int iControlHeight = (int)(m_fPixelRatioBoxHeight * fSqrtRatio); int iControlWidth = (int)(m_fPixelRatioBoxHeight / fSqrtRatio); pControl.Width = iControlWidth; pControl.Height = iControlHeight; iXOff = GUIGraphicsContext.OverScanLeft; iYOff = GUIGraphicsContext.OverScanTop; int iScreenWidth = GUIGraphicsContext.OverScanWidth; int iScreenHeight = GUIGraphicsContext.OverScanHeight; pControl.SetPosition(iXOff + (iScreenWidth - iControlWidth) / 2, iYOff + (iScreenHeight - iControlHeight) / 2); string strMode = GUILocalizeStrings.Get(275); strStatus = String.Format("{0} ({1:#.##})", strMode, GUIGraphicsContext.PixelRatio); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW2, GUILocalizeStrings.Get(278)); } } break; case (int)Controls.CONTROL_OSD: { iXOff = GUIGraphicsContext.OverScanLeft; iYOff = GUIGraphicsContext.Subtitles; iYOff = (GUIGraphicsContext.Height + GUIGraphicsContext.OSDOffset); int iScreenWidth = GUIGraphicsContext.OverScanWidth; pControl = (GUIImage)GetControl((int)Controls.CONTROL_OSD); if (null != pControl) { //pControl.IsVisible=true; int iTextureWidth = pControl.TextureWidth; int iTextureHeight = pControl.TextureHeight; pControl.SetPosition(iXOff + (iScreenWidth - iTextureWidth) / 2, iYOff - iTextureHeight); string strMode = GUILocalizeStrings.Get(469); strStatus = String.Format("{0} ({1}, Offset={2})", strMode, iYOff, GUIGraphicsContext.OSDOffset); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW2, GUILocalizeStrings.Get(468)); } } break; } string strText; strText = String.Format("{0}x{1} | {2}", GUIGraphicsContext.Width, GUIGraphicsContext.Height, strStatus); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABEL_ROW1, strText); base.Render(timePassed); /* * GUIFont font1=GUIFontManager.GetFont("font13"); * if (font1!=null) * { * for (int i=0; i < 780; i+=20) * { * System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.White,1); * GUIGraphicsContext.graphics.DrawLine(pen,0,i,720,i); * pen.Dispose(); * font1.DrawText(100,i,0xffffffff,i.ToString(),GUICheckMarkControl.Alignment.ALIGN_LEFT); * } * System.Drawing.Pen pen2 = new System.Drawing.Pen(System.Drawing.Color.Red,1); * GUIGraphicsContext.graphics.DrawLine(pen2,0,GUIGraphicsContext.Height-1,720,GUIGraphicsContext.Height-1); * pen2.Dispose(); * * }*/ if (m_iControl == (int)Controls.CONTROL_OSD) { GUIWindow window = GUIWindowManager.GetWindow((int)Window.WINDOW_OSD); window.Render(timePassed); } }