bool updateFullScreen(int width, int height) { if (io != null) { // main screen BrailleIOScreen fullScreen = io.GetView(BS_FULLSCREEN_NAME) as BrailleIOScreen; if (fullScreen != null) { fullScreen.SetHeight(height); fullScreen.SetWidth(width); // center BrailleIOViewRange center = fullScreen.GetViewRange(VR_CENTER_NAME); if (center != null) { center.SetHeight(height); center.SetWidth(width); } io.RefreshDisplay(true); return(true); } } return(false); }
public override void Resize(int width, int height) { title.SetLeft(2); title.SetTop(2); title.SetWidth(width - 4); title.SetHeight(width - 4); title.SetText(ll.GetTrans("game.title") + "\n" + ll.GetTrans("game.keybindings1") + "\n" + ll.GetTrans("game.keybindings2") + "\n" + ll.GetTrans("game.keybindings3") + "\n" + ll.GetTrans("game.keybindings4")); }
bool updateMainScreen(int width, int height) { if (io != null) { // main screen BrailleIOScreen mainScreen = io.GetView(BS_MAIN_NAME) as BrailleIOScreen; if (mainScreen != null) { mainScreen.SetHeight(height); mainScreen.SetWidth(width); // center BrailleIOViewRange center = mainScreen.GetViewRange(VR_CENTER_NAME); if (center != null) { center.SetHeight(height); center.SetWidth(width); } // center 2 BrailleIOViewRange center2 = mainScreen.GetViewRange(VR_CENTER_2_NAME); if (center2 != null) { center2.SetHeight(height); center2.SetWidth(width); } //top BrailleIOViewRange top = mainScreen.GetViewRange(VR_TOP_NAME); if (top != null) { top.SetWidth((int)(width * 1.4)); // only that region content is not doing line breaks } // status BrailleIOViewRange status = mainScreen.GetViewRange(VR_STATUS_NAME); if (status != null) { status.SetLeft(width - 12); } // center 2 BrailleIOViewRange detail = mainScreen.GetViewRange(VR_DETAIL_NAME); if (detail != null) { detail.SetTop(height - 7); detail.SetWidth(width); } io.RefreshDisplay(true); return(true); } } return(false); }
// TODO: correct toggle function for active detail area view range private void toggleFullDetailScreen() { BrailleIOScreen vs = GetVisibleScreen(); BrailleIOViewRange detailVR = vs.GetViewRange(VR_DETAIL_NAME); // TODO: ImageData class creates own detail area --> do not use global detailarea BrailleIOViewRange topVR = vs.GetViewRange(VR_TOP_NAME); detailVR.SetHeight(deviceSize.Height - topVR.GetHeight()); detailVR.SetTop(topVR.GetHeight() - 3); io.RefreshDisplay(); audioRenderer.PlaySoundImmediately(LL.GetTrans("tangram.lector.wm.views.detail_maximize")); }
/// <summary> /// Builds a dummy view range with the same size as the image. /// </summary> /// <param name="img">The image.</param> /// <returns>A dummy view range with the size of the image.</returns> private static IViewBoxModel buildImageDummyViewRange(Image img) { BrailleIOViewRange view = new BrailleIOViewRange(0, 0, 0, 0); if (img != null) { view.SetWidth(img.Width); view.SetHeight(img.Height); } return(view); }
/// <summary> /// Resizes the screen /// </summary> /// <param name="width">The new width</param> /// <param name="height">The new height</param> public override void Resize(int width, int height) { this.SetWidth(width); this.SetHeight(height); mainRegion.SetWidth(width); mainRegion.SetHeight(height); detailRegion.SetWidth(width); detailRegion.SetHeight(height); }