Example #1
0
        /// <summary>
        /// Initializes a new instance of the class..  Parameters
        /// can be used to cutomize the screen
        /// </summary>
        /// <param name="line1">First line</param>
        /// <param name="line2">Second line</param>
        /// <param name="line3">Third line</param>
        /// <param name="image">Path to bitmap</param>
        public SplashScreen(String line1, String line2, String line3, String image)
        {
            InitializeComponent();

            this.line1.Text = line1;
            this.line2.Text = line2;
            this.line3.Text = line3;

            Windows.SetWindowPosition(this, Windows.WindowPosition.CenterScreen);

            try
            {
                var img    = Image.FromFile(image);
                var bitmap = ImageUtils.ImageOpacity(img, 1.0F, new Rectangle(0, 0, img.Width, img.Height));
                splashPictureBox.Image = bitmap;
            }
            catch
            {
            }

            FormClosing += Form1_FormClosing;

            ShowInTaskbar = false;

            TopMost = true;

            _loadingLabel = lblLoading.Text;

            _watchDog = new WindowOverlapWatchdog(this);

            Load  += SplashScreen_Load;
            Shown += SplashScreen_Shown;
        }
Example #2
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize(StartupArg startupArg)
        {
            _panelName = startupArg.PanelClass;

            var panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(startupArg.PanelClass);

            if (panelConfigMapEntry == null) // did not find the panel
            {
                return(false);
            }

            bool retVal = initWidgetManager(panelConfigMapEntry);

            if (retVal)
            {
                retVal = initAnimationManager(panelConfigMapEntry);
            }

            Windows.SetTopMost(_form);

            PanelManager.Instance.EvtScannerShow += Instance_EvtScannerShow;
            Windows.EvtWindowPositionChanged     += Windows_EvtWindowPositionChanged;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return(retVal);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the class..  Parameters
        /// can be used to cutomize the screen
        /// </summary>
        /// <param name="line1">First line</param>
        /// <param name="line2">Second line</param>
        /// <param name="line3">Third line</param>
        /// <param name="line4">Fourth line</param>
        /// <param name="image">Path to bitmap</param>
        public SplashScreen(String line1, String line2, String line3, String line4, String image)
        {
            InitializeComponent();

            this.labelLine1.Text = line1;
            this.labelLine2.Text = line2;
            this.labelLine3.Text = line3;
            this.labelLine4.Text = line4;

            Windows.SetWindowPosition(this, Windows.WindowPosition.BottomRight);

            try
            {
                var img    = Image.FromFile(image);
                var bitmap = ImageUtils.ImageOpacity(img, 1.0F, new Rectangle(0, 0, img.Width, img.Height));
                splashPictureBox.BackgroundImage = bitmap;
            }
            catch
            {
            }

            FormClosing += Form1_FormClosing;

            ShowInTaskbar = false;

            TopMost = true;

            pictureBoxStatus.BackgroundImageLayout = ImageLayout.Stretch;

            _watchDog = new WindowOverlapWatchdog(this);

            Load  += SplashScreen_Load;
            Shown += SplashScreen_Shown;
        }
Example #4
0
        /// <summary>
        /// Performs initialization.  Reads the config file for the form, creates
        /// the animation manager, widget manager, loads in  all the widgets,
        /// subscribes to events
        /// Call this function in the Initialize() function in the scanner.
        /// </summary>
        /// <param name="startupArg"></param>
        /// <returns></returns>
        public bool Initialize(StartupArg startupArg)
        {
            Log.Debug("Entered from Initialize");

            Glass.Enable = CoreGlobals.AppPreferences.EnableGlass;

            Glass.EvtShowGlass += Glass_EvtShowGlass;

            StartupArg = startupArg;

            ScannerForm.AutoScaleMode = AutoScaleMode.None;

            ScannerForm.TopMost = true;

            Windows.ShowWindowBorder(ScannerForm,
                                     CoreGlobals.AppPreferences.ScannerShowBorder,
                                     CoreGlobals.AppPreferences.ScannerShowTitleBar ? ScannerForm.Text : String.Empty);

            Windows.EvtWindowPositionChanged += Windows_EvtWindowPositionChanged;

            ScannerForm.SizeChanged += ScannerForm_SizeChanged;

            subscribeTalkWindowManager();

            ScannerForm.Shown          += form_Shown;
            ScannerForm.VisibleChanged += form_VisibleChanged;

            _dialogMode = startupArg.DialogMode;

            var configFile = startupArg.ConfigFileName;

            if (String.IsNullOrEmpty(configFile))
            {
                configFile = PanelConfigMap.GetConfigFileForScreen(ScannerForm.GetType());
            }

            bool retVal = initWidgetManager(configFile);

            if (retVal)
            {
                retVal = initAnimationManager(configFile);
            }

            if (retVal)
            {
                createIdleTimer();
            }

            PositionSizeController.Initialize();

            PositionSizeController.AutoSetPosition();

            _windowOverlapWatchdog = new WindowOverlapWatchdog(ScannerForm);

            WindowActivityMonitor.EvtWindowMonitorHeartbeat += WindowActivityMonitor_EvtWindowMonitorHeartbeat;

            Log.Debug("Returning from Initialize");
            return(retVal);
        }
Example #5
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize()
        {
            bool retVal = initWidgetManager();

            if (retVal)
            {
                retVal = initAnimationManager();
            }

            _form.TopMost = true;
            _form.Paint  += Form_Paint;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return(retVal);
        }
Example #6
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize()
        {
            bool retVal = initWidgetManager();

            if (retVal)
            {
                retVal = initAnimationManager();
            }

            _form.TopMost = true;

            PanelManager.Instance.EvtScannerShow   += Instance_EvtScannerShow;
            PanelManager.Instance.EvtScannerClosed += Instance_EvtScannerClosed;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return(retVal);
        }
Example #7
0
        /// <summary>
        /// Performs initialization.  Reads the config file for the form, creates
        /// the animation manager, widget manager, loads in  all the widgets,
        /// subscribes to events
        /// Call this function in the Initialize() function in the scanner.
        /// </summary>
        /// <param name="startupArg"></param>
        /// <returns></returns>
        public bool Initialize(StartupArg startupArg)
        {
            Log.Debug("Entered from Initialize");

            Glass.Enable = CoreGlobals.AppPreferences.EnableGlass;

            Glass.EvtShowGlass += Glass_EvtShowGlass;

            StartupArg = startupArg;

            ScannerForm.AutoScaleMode = AutoScaleMode.None;

            ScannerForm.TopMost = true;

            Windows.ShowWindowBorder(ScannerForm,
                                    CoreGlobals.AppPreferences.ScannerShowBorder,
                                    CoreGlobals.AppPreferences.ScannerShowTitleBar ? ScannerForm.Text : String.Empty);

            Windows.EvtWindowPositionChanged += Windows_EvtWindowPositionChanged;

            ScannerForm.SizeChanged += ScannerForm_SizeChanged;

            subscribeTalkWindowManager();

            ScannerForm.Shown += form_Shown;
            ScannerForm.VisibleChanged += form_VisibleChanged;

            _dialogMode = startupArg.DialogMode;

            var configFile = startupArg.ConfigFileName;
            if (String.IsNullOrEmpty(configFile))
            {
                configFile = PanelConfigMap.GetConfigFileForScreen(ScannerForm.GetType());
            }

            bool retVal = initWidgetManager(configFile);

            if (retVal)
            {
                retVal = initAnimationManager(configFile);
            }

            if (retVal)
            {
                createIdleTimer();
            }

            PositionSizeController.Initialize();

            PositionSizeController.AutoSetPosition();

            _windowOverlapWatchdog = new WindowOverlapWatchdog(ScannerForm);

            WindowActivityMonitor.EvtWindowMonitorHeartbeat += WindowActivityMonitor_EvtWindowMonitorHeartbeat;

            Log.Debug("Returning from Initialize");
            return retVal;
        }
Example #8
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize()
        {
            bool retVal = initWidgetManager();
            if (retVal)
            {
                retVal = initAnimationManager();
            }

            _form.TopMost = true;
            _form.Paint += Form_Paint;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return retVal;
        }
Example #9
0
        /// <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;
                }
            }
        }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the class..  Parameters
        /// can be used to cutomize the screen
        /// </summary>
        /// <param name="line1">First line</param>
        /// <param name="line2">Second line</param>
        /// <param name="line3">Third line</param>
        /// <param name="image">Path to bitmap</param>
        public SplashScreen(String line1, String line2, String line3, String image)
        {
            InitializeComponent();

            this.line1.Text = line1;
            this.line2.Text = line2;
            this.line3.Text = line3;

            Windows.SetWindowPosition(this, Windows.WindowPosition.CenterScreen);

            try
            {
                var img = Image.FromFile(image);
                var bitmap = ImageUtils.ImageOpacity(img, 1.0F, new Rectangle(0, 0, img.Width, img.Height));
                splashPictureBox.Image = bitmap;
            }
            catch
            {
            }

            FormClosing += Form1_FormClosing;

            ShowInTaskbar = false;

            TopMost = true;

            _loadingLabel = lblLoading.Text;

            _watchDog = new WindowOverlapWatchdog(this);

            Load += SplashScreen_Load;
            Shown += SplashScreen_Shown;
        }
Example #11
0
        /// <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());
        }
Example #13
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize()
        {
            bool retVal = initWidgetManager();
            if (retVal)
            {
                retVal = initAnimationManager();
            }

            _form.TopMost = true;

            PanelManager.Instance.EvtScannerShow += Instance_EvtScannerShow;
            PanelManager.Instance.EvtScannerClosed += Instance_EvtScannerClosed;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return retVal;
        }