Ejemplo n.º 1
0
        public void OnLoad(bool resetTalkWindowPosition = true)
        {
            PositionSizeController.OnLoad();

            TextController.OnLoad();

            PositionSizeController.ScaleForm();
            Windows.SetWindowPosition(ScannerForm, Context.AppWindowPosition);

            if (Context.ShowTalkWindowOnStartup)
            {
                Context.AppTalkWindowManager.ToggleTalkWindow();
                Context.ShowTalkWindowOnStartup = false;
            }

            if (resetTalkWindowPosition)
            {
                Context.AppTalkWindowManager.SetTalkWindowPosition(ScannerForm);
            }

            StatusBarController.UpdateStatusBar();

            subscribeToEvents();

            SetWidgetEnabledStates(WindowActivityMonitor.GetForegroundWindowInfo());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Instantiates a new instance of the class
        /// </summary>
        /// <param name="iScannerPanel">The scanner Form object</param>
        public ScannerCommon(IScannerPanel iScannerPanel)
        {
            ScannerForm               = iScannerPanel.Form;
            StartupArg                = null;
            _scannerPanel             = iScannerPanel;
            ScannerForm.ShowInTaskbar = false;
            PositionSizeController    = new ScannerPositionSizeController(this);
            TextController            = new TextController();
            KeepTalkWindowActive      = false;
            _syncLock = new SyncLock();

            var scannerStatusBar = (ScannerForm is ISupportsStatusBar) ?
                                   ((ISupportsStatusBar)ScannerForm).ScannerStatusBar :
                                   null;

            StatusBarController = new StatusBarController(scannerStatusBar);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Call this in the OnResume event handler in the form
        /// </summary>
        public void OnResume()
        {
            if (!_isPaused)
            {
                return;
            }

            _isPaused = false;

            try
            {
                StatusBarController.UpdateStatusBar();

                PositionSizeController.ScaleForm();

                if (!DialogMode)
                {
                    if (!KeepTalkWindowActive)
                    {
                        Log.Debug(ScannerForm.Name + ", _talkWindowPaused : " + _talkWindowPaused);
                        if (_talkWindowPaused)
                        {
                            Log.Debug(ScannerForm.Name + ", Resuming talk window: " + _talkWindowPaused);

                            Context.AppTalkWindowManager.Resume();

                            _talkWindowPaused = false;
                        }
                    }

                    PositionSizeController.AutoSetPositionAndNotify();
                }
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Instantiates a new instance of the class
        /// </summary>
        /// <param name="iScannerPanel">The scanner Form object</param>
        public ScannerCommon(IScannerPanel iScannerPanel)
        {
            ScannerForm = iScannerPanel.Form;
            StartupArg = null;
            _scannerPanel = iScannerPanel;
            ScannerForm.ShowInTaskbar = false;
            PositionSizeController = new ScannerPositionSizeController(this);
            TextController = new TextController();
            KeepTalkWindowActive = false;
            _syncLock = new SyncLock();

            var scannerStatusBar = (ScannerForm is ISupportsStatusBar) ?
                                                ((ISupportsStatusBar)ScannerForm).ScannerStatusBar :
                                                null;
            StatusBarController = new StatusBarController(scannerStatusBar);
        }
Ejemplo n.º 5
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;

            StatusBarController = new StatusBarController();

            ScannerForm.AutoScaleMode = AutoScaleMode.None;

            ScannerForm.TopMost = true;

            ScannerForm.MaximizeBox = false;

            Windows.ShowWindowBorder(ScannerForm, true, ScannerForm.Text);

            Windows.EvtWindowPositionChanged += Windows_EvtWindowPositionChanged;

            ScannerForm.SizeChanged += ScannerForm_SizeChanged;

            CoreGlobals.AppPreferences.EvtPreferencesChanged += AppPreferences_EvtPreferencesChanged;

            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;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// The keystate of one of the modifier keys (shift, alt,
 /// ctrl or function) changed.  Update the scanner status bar
 /// </summary>
 private void KeyStateTracker_EvtKeyStateChanged()
 {
     StatusBarController.UpdateStatusBar();
 }