/// <summary> /// Initializes a new instance of the class. /// </summary> public ACATMuteForm() { InitializeComponent(); _syncObj = new SyncLock(); ShowInTaskbar = false; if (!initialize()) { Log.Debug("Initialization error!"); } TopMost = true; RoundedCornerControl.CreateRoundedControl(Title); Windows.ShowWindowBorder(this, Common.AppPreferences.ScannerShowBorder); Windows.SetWindowPosition(this, Windows.WindowPosition.CenterScreen); _windowOverlapWatchdog = new WindowOverlapWatchdog(this); updateDateTime(); // Title isn't used on this form, but we keep it hidden instead of removing it // so we don't have to modify the IScreenInterface GetTitle() method Title.Hide(); // timer used for displaying the time timer.Start(); FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; Load += MuteForm_Load; FormClosing += MuteForm_FormClosing; var actuator = ActuatorManager.Instance.GetActuator(typeof(KeyboardActuator)); if (actuator != null) { _keyboardActuator = actuator as KeyboardActuator; if (_keyboardActuator != null) { _keyboardActuator.EvtKeyDown += _keyboardActuator_EvtKeyDown; _keyboardActuator.EvtKeyUp += _keyboardActuator_EvtKeyUp; } } }
/// <summary> /// Called when loaded. Create timers, position the window /// <param name="sender">event sender</param> /// <param name="e">event args</param> /// </summary> private void TalkWindowForm_Load(object sender, EventArgs e) { if (_acatFont == null) { var fontFamily = Fonts.Instance.GetFontFamily("ACAT Icon"); if (fontFamily != null) { _acatFont = new Font(fontFamily, labelSpeaker.Font.Size); labelSpeaker.Font = _acatFont; labelClearText.Font = _acatFont; } } setFont(FontSize); updateVolumeStatus(); CenterToScreen(); _windowOverlapWatchdog = new WindowOverlapWatchdog(this); _windowActiveWatchdog = new WindowActiveWatchdog(this); textBox.SelectionStart = textBox.Text.Length; textBox.DeselectAll(); }
/// <summary> /// Form has been loaded. Initializes resources /// </summary> private void ResizeScannerScreen_Load(object sender, EventArgs e) { var panel = Context.AppPanelManager.CreatePanel(PanelClasses.Alphabet) as IPanel; _previewScanner = panel as Form; _previewScreenInterface = panel as IScannerPreview; _previewScreenInterface.PreviewMode = true; var scannerPanel = panel as IScannerPanel; // we are going to manually set the position of the scanner below scannerPanel.ScannerCommon.PositionSizeController.AutoPosition = false; _previewScanner.Show(); var position = Context.AppWindowPosition; if (position == Windows.WindowPosition.CenterScreen) { position = CoreGlobals.AppPreferences.ScannerPosition; } if (position == Windows.WindowPosition.CenterScreen) { position = Windows.WindowPosition.MiddleRight; } var scanner = _previewScanner as IScannerPanel; scanner.ScannerCommon.PositionSizeController.ManualPosition = position; _windowOverlapWatchdog = new WindowOverlapWatchdog(this, true); _dialogCommon.OnLoad(); _dialogCommon.GetAnimationManager().Start(_dialogCommon.GetRootWidget()); }