/// <summary> /// Creates the statusbar object for this scanner /// </summary> private void createStatusBar() { if (_statusBar == null) { _statusBar = new ScannerStatusBar { AltStatus = BAltStatus, CtrlStatus = BCtrlStatus, FuncStatus = BFuncStatus, ShiftStatus = BShiftStatus, LockStatus = BLockStatus }; } }
/// <summary> /// Initializes a new instance of the class. /// </summary> /// <param name="statusBar"></param> public StatusBarController(ScannerStatusBar statusBar) { _statusBar = statusBar; }
/// <summary> /// Creates the status bar /// </summary> private void createStatusBar() { if (_statusBar != null) { return; } _statusBar = new ScannerStatusBar { AltStatus = BAltStatus, CtrlStatus = BCtrlStatus, FuncStatus = BFuncStatus, ShiftStatus = BShiftStatus }; }
/// <summary> /// Initializes a new instance of the class. /// </summary> /// <param name="statusBar"></param> public StatusBarController(ScannerStatusBar statusBar = null) { _statusBar = statusBar; }
/// <summary> /// Creates the status bar for the form to display the status of the /// Ctrl, Alt and Shift keys /// </summary> public void CreateStatusBar() { ScannerForm.Height += 30; _statusBarPanelShift.BorderStyle = StatusBarPanelBorderStyle.None; StatusBarControl.Panels.Add(_statusBarPanelShift); _statusBarPanelCtrl.BorderStyle = StatusBarPanelBorderStyle.None; StatusBarControl.Panels.Add(_statusBarPanelCtrl); _statusBarPanelAlt.BorderStyle = StatusBarPanelBorderStyle.None; StatusBarControl.Panels.Add(_statusBarPanelAlt); StatusBarControl.SizingGrip = false; StatusBarControl.ShowPanels = true; StatusBarControl.Height = 30; StatusBarControl.Margin = new Padding(4, 4, 4, 4); StatusBarControl.Font = new Font("Arial", 16.0f); ScannerForm.Controls.Add(StatusBarControl); var statusbar = new ScannerStatusBar { AltStatus = _statusBarPanelAlt, CtrlStatus = _statusBarPanelCtrl, ShiftStatus = _statusBarPanelShift, }; StatusBar = statusbar; }