private async Task InitializeAsync() { lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); BlinkCheckBox.IsEnabled = (lineDisplay != null) && (lineDisplay.Capabilities.CanBlink != LineDisplayTextAttributeGranularity.NotSupported); DisplayTextButton.IsEnabled = (lineDisplay != null); }
private async Task InitializeAsync() { ResetButton.IsEnabled = false; SupportedGlyphsComboBox.Items.Clear(); lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); if ((lineDisplay != null) && lineDisplay.Capabilities.CanDisplayCustomGlyphs) { string sampleText = "ABC"; foreach (uint glyphCode in lineDisplay.CustomGlyphs.SupportedGlyphCodes) { string glyphString = Char.ConvertFromUtf32((int)glyphCode); SupportedGlyphsComboBox.Items.Add(new ComboBoxItem { Content = $"Code {glyphCode} (UTF-32 '{glyphString}')", Tag = glyphCode }); if (sampleText.Length < 10) { sampleText += glyphString; } } if (SupportedGlyphsComboBox.Items.Count > 0) { SupportedGlyphsComboBox.SelectedIndex = 0; } Size glyphSize = lineDisplay.CustomGlyphs.SizeInPixels; glyphBuffer = CreateSolidGlyphBuffer((int)glyphSize.Width, (int)glyphSize.Height); await lineDisplay.DefaultWindow.TryDisplayTextAsync(sampleText); } ResetButton.IsEnabled = true; }
private async Task InitializeAsync() { lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); maxWindows = (lineDisplay == null) ? 0 : lineDisplay.Capabilities.SupportedWindows; if (maxWindows >= 1) { // Create an entry to represent the default window. WindowList.Add(new WindowInfo(lineDisplay.DefaultWindow, nextWindowId)); nextWindowId++; } }
private async Task InitializeAsync() { UpdateButton.IsEnabled = false; DisplayTextButton.IsEnabled = false; ResetButton.IsEnabled = false; CursorTypeComboBox.Items.Clear(); lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); CursorTypeComboBox.IsEnabled = (lineDisplay != null) && lineDisplay.DefaultWindow.Cursor.CanCustomize; if (CursorTypeComboBox.IsEnabled) { if (lineDisplay.DefaultWindow.Cursor.IsBlockSupported) { CursorTypeComboBox.Items.Add(LineDisplayCursorType.Block); } if (lineDisplay.DefaultWindow.Cursor.IsHalfBlockSupported) { CursorTypeComboBox.Items.Add(LineDisplayCursorType.HalfBlock); } if (lineDisplay.DefaultWindow.Cursor.IsOtherSupported) { CursorTypeComboBox.Items.Add(LineDisplayCursorType.Other); } if (lineDisplay.DefaultWindow.Cursor.IsReverseSupported) { CursorTypeComboBox.Items.Add(LineDisplayCursorType.Reverse); } if (lineDisplay.DefaultWindow.Cursor.IsUnderlineSupported) { CursorTypeComboBox.Items.Add(LineDisplayCursorType.Underline); } if (CursorTypeComboBox.Items.Count > 0) { CursorTypeComboBox.SelectedIndex = 0; } } IsAutoAdvanceEnabledCheckbox.IsEnabled = (lineDisplay != null); IsBlinkEnabledCheckbox.IsEnabled = (lineDisplay != null) && lineDisplay.DefaultWindow.Cursor.IsBlinkSupported; SetCursorPositionCheckbox.IsEnabled = (lineDisplay != null); UpdateButton.IsEnabled = (lineDisplay != null); DisplayTextButton.IsEnabled = (lineDisplay != null); ResetButton.IsEnabled = true; }
private async Task InitializeAsync() { lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); BlinkRateSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeBlinkRate; BrightnessSlider.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.IsBrightnessSupported; SupportedScreenSizesComboBox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanChangeScreenSize; if (SupportedScreenSizesComboBox.IsEnabled) { foreach (Size screenSize in lineDisplay.SupportedScreenSizesInCharacters) { SupportedScreenSizesComboBox.Items.Add(new ComboBoxItem { Content = $"{screenSize.Width} x {screenSize.Height}", Tag = screenSize }); } if (SupportedScreenSizesComboBox.Items.Count > 0) { SupportedScreenSizesComboBox.SelectedIndex = 0; } } CharacterSetMappingEnabledCheckbox.IsEnabled = (lineDisplay != null) && lineDisplay.Capabilities.CanMapCharacterSets; UpdateButton.IsEnabled = (lineDisplay != null); if (UpdateButton.IsEnabled) { SetValuesFromLineDisplay(); if (lineDisplay.Capabilities.CanBlink == LineDisplayTextAttributeGranularity.NotSupported) { await lineDisplay.DefaultWindow.TryDisplayTextAsync("Regular Text"); } else { await lineDisplay.DefaultWindow.TryDisplayTextAsync("Blinking Text", LineDisplayTextAttribute.Blink); } } }
private async Task InitializeAsync() { lineDisplay = await rootPage.ClaimScenarioLineDisplayAsync(); if (lineDisplay != null) { Size screenSize = lineDisplay.GetAttributes().ScreenSizeInCharacters; int windowCount = 1; if (lineDisplay.Capabilities.IsHorizontalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows)) { // Create a horizontal scrollable window by creating a window // whose width is wider than the viewport. horizontalScrollableWindow = await lineDisplay.TryCreateWindowAsync( new Rect() { X = 0, Y = 0, Width = screenSize.Width, Height = screenSize.Height }, new Size() { Width = screenSize.Width * 2, Height = screenSize.Height }); if (horizontalScrollableWindow != null) { windowCount++; ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Left); ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Right); } } if (lineDisplay.Capabilities.IsVerticalMarqueeSupported && (windowCount < lineDisplay.Capabilities.SupportedWindows)) { // Create a vertical scrollable window by creating a window // whose height is taller than the viewport. verticalScrollableWindow = await lineDisplay.TryCreateWindowAsync( new Rect() { X = 0, Y = 0, Width = screenSize.Width, Height = screenSize.Height }, new Size() { Width = screenSize.Width, Height = screenSize.Height * 2 }); if (verticalScrollableWindow != null) { windowCount++; ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Up); ScrollDirectionComboBox.Items.Add(LineDisplayScrollDirection.Down); } } } if (ScrollDirectionComboBox.Items.Count > 0) { ScrollDirectionComboBox.SelectedIndex = 0; StartScrollingButton.IsEnabled = true; StopScrollingButton.IsEnabled = true; } }