private static Point GetToolTipPosition(CustomToolTip toolTip, ToolStripItem label) { var b = label.Bounds; var s = toolTip.Size; var x = b.X + (b.Width - s.Width) / 2; var y = b.Y - s.Height - 5; var clientCoords = new Point(x, y); var scr = label.Owner.PointToScreen(clientCoords); if (scr.X < 0) { scr.X = 0; clientCoords = label.Owner.PointToClient(scr); } return(clientCoords); }
/// <summary> /// 释放资源 /// </summary> public void DisposeAllInfo() { if (_customToolTip != null) { _customToolTip.Close(); _customToolTip.Dispose(); _customToolTip = null; } if (_tempRedundancyDict != null) { _tempRedundancyDict.Clear(); _tempRedundancyDict = null; } _senderStatusUC.MouseMoveInGridEvent -= new MouseOperateInGridEventHandler(SenderStatusUC_MouseMoveInGridEvent); }
//------------------------------------------------------------- public SuggestedGameOwnerControl(DTO_Suggestion dto, string pathHDD, KobberLan parent, bool ownSuggestions = false) //------------------------------------------------------------- { //Init control InitializeComponent(); torrentPeers = new List <string>(); torrentPeers.Add("127.0.0.1"); // Inclusive owner torrentDownloadCompleted = new List <string>(); torrentDownloadStarted = new List <string>(); ingame = new List <string>(); metaProgress = 0; state = TorrentState.Starting; kobberLan = parent; path = pathHDD; dto_suggestion = dto; Likes = new List <IPAddress>(); label_GameTitle.Text = dto.title; pictureBox_Cover.Image = dto.imageCover; //Set mouseover tooltip CustomToolTip tip = new CustomToolTip(dto, this); tip.InitImage(dto.imageBig); tip.SetToolTip(pictureBox_Cover, "Details"); torrentShared = false; //Check for startup value if (!(string.IsNullOrEmpty(dto.startGame) && string.IsNullOrEmpty(dto.startServer))) { button_Play.Enabled = true; } //Hide peers/downloads/remove if not own suggestions this.ownSuggestions = ownSuggestions; if (!ownSuggestions) { pictureBox_Downloaded.Visible = false; pictureBox_Peers.Visible = false; label_Downloading.Visible = false; label_Peers.Visible = false; button_Clear.Visible = false; } }
/// <summary> /// 鼠标移动事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StandarAndSimpleLayout_GridMouseMove(object sender, RectangularGridMouseEventArgs e) { if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = _customToolTipFont; } if (e.GridInfo == null) { //当前鼠标移动到的区域无矩形格子 _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, null); Debug.WriteLine("进入格子的GridMouseMove事件,并获取的格子信息为空"); return; } RectangularGridInfo scanBordGridInfo = _standarAndSimpleLayout[e.GridInfo.Key]; List <string> noticeStrList = null; if (scanBordGridInfo != null) { _tempCustomInfo = (SetCustomObjInfo)scanBordGridInfo.CustomObj; if (_tempCustomInfo == null) { _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, null); return; } noticeStrList = new List <string>(); _tempCnt = _tempCustomInfo.Count; noticeStrList.Add(StaticValue.SenderName + ":" + (_tempCustomInfo.ScanBordInfo.SenderIndex + 1)); noticeStrList.Add(StaticValue.PortName + ":" + (_tempCustomInfo.ScanBordInfo.PortIndex + 1)); noticeStrList.Add(StaticValue.ScanBoardName + ":" + (_tempCustomInfo.ScanBordInfo.ConnectIndex + 1)); noticeStrList.Add("(X, Y):(" + e.GridInfo.Region.X + "," + e.GridInfo.Region.Y + ")"); noticeStrList.Add("(W, H):(" + e.GridInfo.Region.Width + "," + e.GridInfo.Region.Height + ")"); noticeStrList.Add(StaticValue.CountStr + ":" + _tempCustomInfo.Count); } _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, noticeStrList); if (!_customToolTip.TopLevel) { _customToolTip.TopLevel = true; } }
private void UC_OneScreenLayout_Disposed(object sender, EventArgs e) { this.Disposed -= new EventHandler(UC_OneScreenLayout_Disposed); if (_customToolTip != null) { _customToolTip.Close(); _customToolTip.Dispose(); _customToolTip = null; } if (_standarAndSimpleLayout != null) { _standarAndSimpleLayout.GridMouseMove -= new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseMove); _standarAndSimpleLayout.GridMouseDoubleClick -= new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseDoubleClick); } if (_complexLayout != null) { _complexLayout.SetComplexScreenInfEvent -= new SettingMonitorCntEventHandler(ComplexScreenSetInfo); } }
private void dbfDataGridView_ComplexScreenInfo_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = this.Font; } if (e.ColumnIndex < 0 || e.ColumnIndex >= dbfDataGridView_ComplexScreenInfo.ColumnCount) { _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); return; } if (e.RowIndex < 0 || e.RowIndex >= dbfDataGridView_ComplexScreenInfo.RowCount) { _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); return; } int rowIndex = e.RowIndex; if (e.ColumnIndex == 0) { List<string> noticeStrList = null; if (rowIndex >= _curAllScanBoardMonitorInfList.Count) { _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); return; } SBInfoAndMonitorInfo scanBoardMonitorInfo = _curAllScanBoardMonitorInfList[rowIndex]; string fanOrPowerCntKey = scanBoardMonitorInfo.SBRectKey; if (scanBoardMonitorInfo != null) { if (scanBoardMonitorInfo.ScanBordInfo != null) { noticeStrList = new List<string>(); noticeStrList.Add(scanBoardMonitorInfo.CommPortName);//+ "-"+ CommonStaticValue.CommPortScreen+ (scanBoardMonitorInfo.ScreenIndex + 1) if (scanBoardMonitorInfo.MonitorData != null) { switch (_curType) { #region ��ȡ��Ҫ��ʾ�����ͺ�ֵ�ַ��� case MonitorDisplayType.SBStatus: #region ���տ�״̬ noticeStrList.AddRange(GetMonitorColorAndValue.GetSBStatusNoticeStr(scanBoardMonitorInfo.MonitorData)); #endregion break; case MonitorDisplayType.MCStatus: #region ��ؿ�״̬ noticeStrList.AddRange(GetMonitorColorAndValue.GetMCStatusNoticeStr(scanBoardMonitorInfo.MonitorData)); #endregion break; case MonitorDisplayType.Smoke: #region ���� noticeStrList.Add(GetMonitorColorAndValue.GetSmokeNoticeStr(scanBoardMonitorInfo.MonitorData)); #endregion break; case MonitorDisplayType.Temperature: #region �¶� noticeStrList.Add(GetMonitorColorAndValue.GetTemperatureNoticeStr(scanBoardMonitorInfo.MonitorData, _curMonitorConfigInfo.TempDisplayType)); #endregion break; case MonitorDisplayType.Humidity: #region ʪ�� noticeStrList.Add(GetMonitorColorAndValue.GetHumidityNoticeStr(scanBoardMonitorInfo.MonitorData)); #endregion break; case MonitorDisplayType.Fan: #region ���� noticeStrList.AddRange(GetMonitorColorAndValue.GetFanNoticeStr(scanBoardMonitorInfo.MonitorData, _curMonitorConfigInfo.MCFanInfo, fanOrPowerCntKey)); #endregion break; case MonitorDisplayType.Power: #region ��Դ noticeStrList.AddRange(GetMonitorColorAndValue.GetPowerNoticeStr(scanBoardMonitorInfo.MonitorData, _curMonitorConfigInfo.MCPowerInfo, _curMonitorConfigInfo.IsDisplayScanBoardVolt, fanOrPowerCntKey)); #endregion break; case MonitorDisplayType.RowLine: #region ���� noticeStrList.AddRange(GetMonitorColorAndValue.GetRowLineNoticeStr(scanBoardMonitorInfo.MonitorData, scanBoardMonitorInfo.RowLineStatus)); break; #endregion case MonitorDisplayType.GeneralSwitch: #region ͨ�ÿ���״̬ noticeStrList.Add(GetMonitorColorAndValue.GetGeneralSwitchNoticeStr(scanBoardMonitorInfo.MonitorData, scanBoardMonitorInfo.GeneralSwitchList)); break; #endregion default: _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); return; #endregion } } } _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, noticeStrList); if (!_customToolTip.TopLevel) { _customToolTip.TopLevel = true; } } else { _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); } } else { _customToolTip.SetTipInfo(dbfDataGridView_ComplexScreenInfo, null); } }
private void dbDataGridView_MonitorInfo_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { List<string> noticeStrList = new List<string>(); if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = this.Font; } if (e.RowIndex == 0) { noticeStrList.Add(StaticValue.DisplayTypeStr[e.ColumnIndex]); _customToolTip.SetTipInfo(this.dbDataGridView_MonitorInfo, noticeStrList); } else if (e.RowIndex > 0 && e.ColumnIndex > 0 && dbDataGridView_MonitorInfo[e.ColumnIndex, e.RowIndex].Value!=null && dbDataGridView_MonitorInfo[e.ColumnIndex, e.RowIndex].Value.ToString() != "UnAvailable") { noticeStrList.Add(StaticValue.ColConTextTip); _customToolTip.SetTipInfo(this.dbDataGridView_MonitorInfo, noticeStrList); } else { _customToolTip.SetTipInfo(this.dbDataGridView_MonitorInfo, null); } }
public VideoPanelViewModel() { // //TODO: Add the constructor code here // //videoRender = null; //mediaPlayer.Dock = DockStyle.Fill; //mediaPlayer.stretchToFit = true; videoRender = new VideoRender(VideoPanel); audioPlayer = new StreamingAudioBuffer(this); //videoRender.initialize(0,0); videoDecoder = new VideoPlayer(); videoDecoder.FrameQueue.Closed += new EventHandler(frameQueue_Closed); videoDecoder.setLogCallback(new VideoPlayer.LogCallbackDelegate(videoDecoderLogCallback), true, true); videoRefreshTimer = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE); videoRefreshTimer.Tick += new EventHandler(videoRefreshTimer_Tick); //videoRefreshTimer.SynchronizingObject = this; videoRefreshTimer.AutoReset = false; audioRefreshTimer = HRTimerFactory.create(HRTimerFactory.TimerType.TIMER_QUEUE); audioRefreshTimer.Tick += new EventHandler(audioRefreshTimer_Tick); audioRefreshTimer.AutoReset = false; audioRefreshTimer.SynchronizingObject = null; videoDebug = new VideoDebugForm(); audioDiffAvgCoef = Math.Exp(Math.Log(0.01) / AUDIO_DIFF_AVG_NB); //syncMode = SyncMode.VIDEO_SYNCS_TO_AUDIO; syncMode = SyncMode.AUDIO_SYNCS_TO_VIDEO; VideoState = VideoState.CLOSED; updateTimeTrackBar = true; timeTrackBarToolTip = new CustomToolTip(); timeTrackBarToolTip.BackColor = SystemColors.Info; this.Controls.Add(timeTrackBarToolTip); timeTrackBarToolTip.Show(); timeTrackBarToolTip.BringToFront(); timeTrackBarToolTip.Visible = false; muteCheckBox.Checked = bool.Parse(Settings.getVar(Settings.VarName.VIDEO_MUTED)); volumeTrackBar.Value = Util.lerp<int>(Double.Parse(Settings.getVar(Settings.VarName.VIDEO_VOLUME)), volumeTrackBar.Minimum, volumeTrackBar.Maximum); }
private void UC_OneScreenLayout_Disposed(object sender, EventArgs e) { this.Disposed -= new EventHandler(UC_OneScreenLayout_Disposed); if(_customToolTip != null) { _customToolTip.Close(); _customToolTip.Dispose(); _customToolTip = null; } if (_standarAndSimpleLayout != null) { _standarAndSimpleLayout.GridMouseMove -= new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseMove); _standarAndSimpleLayout.GridMouseDoubleClick -= new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseDoubleClick); } if (_complexLayout != null) { _complexLayout.SetComplexScreenInfEvent -= new SettingMonitorCntEventHandler(ComplexScreenSetInfo); } }
/// <summary> /// ����ƶ��¼� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StandarAndSimpleLayout_GridMouseMove(object sender, RectangularGridMouseEventArgs e) { if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = _customToolTipFont; } if (e.GridInfo == null) { //��ǰ����ƶ������������θ��� _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, null); Debug.WriteLine("������ӵ�GridMouseMove�¼�������ȡ�ĸ�����ϢΪ��"); return; } RectangularGridInfo scanBordGridInfo = _standarAndSimpleLayout[e.GridInfo.Key]; List<string> noticeStrList = null; if (scanBordGridInfo != null) { _tempCustomInfo = (SetCustomObjInfo)scanBordGridInfo.CustomObj; if (_tempCustomInfo == null) { _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, null); return; } noticeStrList = new List<string>(); _tempCnt = _tempCustomInfo.Count; noticeStrList.Add(StaticValue.SenderName + ":" + (_tempCustomInfo.ScanBordInfo.SenderIndex + 1)); noticeStrList.Add(StaticValue.PortName + ":" + (_tempCustomInfo.ScanBordInfo.PortIndex + 1)); noticeStrList.Add(StaticValue.ScanBoardName + ":" + (_tempCustomInfo.ScanBordInfo.ConnectIndex + 1)); noticeStrList.Add("(X, Y):(" + e.GridInfo.Region.X + "," + e.GridInfo.Region.Y + ")"); noticeStrList.Add("(W, H):(" + e.GridInfo.Region.Width + "," + e.GridInfo.Region.Height + ")"); noticeStrList.Add(StaticValue.CountStr + ":" + _tempCustomInfo.Count); } _customToolTip.SetTipInfo(_standarAndSimpleLayout.DrawPanel, noticeStrList); if (!_customToolTip.TopLevel) { _customToolTip.TopLevel = true; } }
private void SenderStatusUC_MouseMoveInGridEvent(object sender, MouseOperateInGridEventArgs e) { if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = _customToolTipFont; } if (e.SenderGridInfo == null) { _customToolTip.SetTipInfo(_senderStatusUC.DrawPanel, null); return; } List <string> noticeStrList = new List <string>(); noticeStrList.Add(GetLangText("CommPortName", "串口") + ":" + e.SenderGridInfo.CommPort); noticeStrList.Add(GetLangText("SenderName", "发送卡") + ":" + (e.SenderGridInfo.SenderIndex + 1).ToString()); if (e.SenderGridInfo.Status == WorkStatusType.OK) { noticeStrList.Add(GetLangText("DVISignalOK", "DVI信号:正常")); //DVI信号正常时显示发送卡的刷新率 string refreshReteStr = GetLangText("RefreshRate", "刷新率:"); if (!e.SenderGridInfo.RefreshRateInfo.IsValid) { refreshReteStr += GetLangText("label_Unknown", "未知"); } else { refreshReteStr += e.SenderGridInfo.RefreshRateInfo.Value.ToString() + " HZ"; } noticeStrList.Add(refreshReteStr); } else if (e.SenderGridInfo.Status == WorkStatusType.Error) { noticeStrList.Add(GetLangText("DVISignalException", "DVI信号:异常")); } else if (e.SenderGridInfo.Status == WorkStatusType.Unknown) { noticeStrList.Add(GetLangText("DVISignalUnkonwn", "DVI信号:未知")); } else if (e.SenderGridInfo.Status == WorkStatusType.SenderCardError) { noticeStrList.Add(GetLangText("SenderCardUnkonwn", "发送卡:发送卡故障")); } string msg = ""; string portMsg = ""; if (_tempRedundancyDict != null && _tempRedundancyDict.Count > 0 && _tempRedundancyDict.ContainsKey(e.SenderGridInfo.CommPort)) { if (_tempRedundancyDict[e.SenderGridInfo.CommPort] != null && _tempRedundancyDict[e.SenderGridInfo.CommPort].Count > 0) { foreach (int i in e.SenderGridInfo.RedundantStateTypeList.Keys) { RedundantStateType state = e.SenderGridInfo.RedundantStateTypeList[i]; if (state == RedundantStateType.OK) { portMsg = ""; msg = GetLangText("PortNormal", "网口:正常"); } else if (state == RedundantStateType.Error) { if (_tempRedundancyDict.ContainsKey(e.SenderGridInfo.CommPort)) { for (int j = 0; j < _tempRedundancyDict[e.SenderGridInfo.CommPort].Count; j++) { SenderRedundancyInfo senderInfo = _tempRedundancyDict[e.SenderGridInfo.CommPort][j]; if (senderInfo.SlaveSenderIndex == e.SenderGridInfo.SenderIndex && senderInfo.SlavePortIndex == i) { portMsg = "-" + GetLangText("MasterSenderPort", "主网口:发送卡") + (senderInfo.MasterSenderIndex + 1) + "-" + GetLangText("Port", "网口") + (senderInfo.MasterPortIndex + 1); msg = GetLangText("PortRedundant", "网口:冗余"); break; } else { msg = GetLangText("PortNormal", "网口:正常"); } } } } else if (state == RedundantStateType.Unknown) { portMsg = ""; msg = GetLangText("PortUnknown", "网口:未知"); } msg = (i + 1) + msg + portMsg; noticeStrList.Add(msg); } } } _customToolTip.SetTipInfo(_senderStatusUC.DrawPanel, noticeStrList); if (!_customToolTip.TopLevel) { _customToolTip.TopLevel = true; } }
private static Point GetToolTipPosition(CustomToolTip toolTip, ToolStripItem label) { var b = label.Bounds; var s = toolTip.Size; var x = b.X + (b.Width - s.Width) / 2; var y = b.Y - s.Height - 5; var clientCoords = new Point(x, y); var scr = label.Owner.PointToScreen(clientCoords); if(scr.X < 0) { scr.X = 0; clientCoords = label.Owner.PointToClient(scr); } return clientCoords; }
private void SenderStatusUC_MouseMoveInGridEvent(object sender, MouseOperateInGridEventArgs e) { if (_customToolTip == null) { _customToolTip = new CustomToolTip(); _customToolTip.Owner = this.ParentForm; _customToolTip.TipContentFont = _customToolTipFont; } if (e.SenderGridInfo == null) { _customToolTip.SetTipInfo(_senderStatusUC.DrawPanel, null); return; } List<string> noticeStrList = new List<string>(); noticeStrList.Add(GetLangText("CommPortName", "串口") + ":" + e.SenderGridInfo.CommPort); noticeStrList.Add(GetLangText("SenderName", "发送卡") + ":" + (e.SenderGridInfo.SenderIndex + 1).ToString()); if (e.SenderGridInfo.Status == WorkStatusType.OK) { noticeStrList.Add(GetLangText("DVISignalOK", "DVI信号:正常")); //DVI信号正常时显示发送卡的刷新率 string refreshReteStr = GetLangText("RefreshRate", "刷新率:"); if (!e.SenderGridInfo.RefreshRateInfo.IsValid) { refreshReteStr += GetLangText("label_Unknown", "未知"); } else { refreshReteStr += e.SenderGridInfo.RefreshRateInfo.Value.ToString() + " HZ"; } noticeStrList.Add(refreshReteStr); } else if (e.SenderGridInfo.Status == WorkStatusType.Error) { noticeStrList.Add(GetLangText("DVISignalException", "DVI信号:异常")); } else if (e.SenderGridInfo.Status == WorkStatusType.Unknown) { noticeStrList.Add(GetLangText("DVISignalUnkonwn", "DVI信号:未知")); } else if (e.SenderGridInfo.Status == WorkStatusType.SenderCardError) { noticeStrList.Add(GetLangText("SenderCardUnkonwn", "发送卡:发送卡故障")); } string msg = ""; string portMsg = ""; if (_tempRedundancyDict != null && _tempRedundancyDict.Count > 0 && _tempRedundancyDict.ContainsKey(e.SenderGridInfo.CommPort)) { if (_tempRedundancyDict[e.SenderGridInfo.CommPort] != null && _tempRedundancyDict[e.SenderGridInfo.CommPort].Count > 0) { foreach (int i in e.SenderGridInfo.RedundantStateTypeList.Keys) { RedundantStateType state = e.SenderGridInfo.RedundantStateTypeList[i]; if (state == RedundantStateType.OK) { portMsg = ""; msg = GetLangText("PortNormal", "网口:正常"); } else if (state == RedundantStateType.Error) { if (_tempRedundancyDict.ContainsKey(e.SenderGridInfo.CommPort)) { for (int j = 0; j < _tempRedundancyDict[e.SenderGridInfo.CommPort].Count; j++) { SenderRedundancyInfo senderInfo = _tempRedundancyDict[e.SenderGridInfo.CommPort][j]; if (senderInfo.SlaveSenderIndex == e.SenderGridInfo.SenderIndex && senderInfo.SlavePortIndex == i) { portMsg = "-" + GetLangText("MasterSenderPort", "主网口:发送卡") + (senderInfo.MasterSenderIndex + 1) + "-" + GetLangText("Port", "网口") + (senderInfo.MasterPortIndex + 1); msg = GetLangText("PortRedundant", "网口:冗余"); break; } else { msg = GetLangText("PortNormal", "网口:正常"); } } } } else if (state == RedundantStateType.Unknown) { portMsg = ""; msg = GetLangText("PortUnknown", "网口:未知"); } msg = (i + 1) + msg + portMsg; noticeStrList.Add(msg); } } } _customToolTip.SetTipInfo(_senderStatusUC.DrawPanel, noticeStrList); if (!_customToolTip.TopLevel) { _customToolTip.TopLevel = true; } }