当前位置: 首页>>代码示例>>C#>>正文


C# ScintillaControl.PointToClient方法代码示例

本文整理汇总了C#中ScintillaNet.ScintillaControl.PointToClient方法的典型用法代码示例。如果您正苦于以下问题:C# ScintillaControl.PointToClient方法的具体用法?C# ScintillaControl.PointToClient怎么用?C# ScintillaControl.PointToClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScintillaNet.ScintillaControl的用法示例。


在下文中一共展示了ScintillaControl.PointToClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleDwellStart

        private void HandleDwellStart(ScintillaControl sci, int position)
        {
            if (OnMouseHover == null || sci == null || DisableEvents) return;
            try
            {
                // check mouse over the editor
                if ((position < 0) || simpleTip.Visible || CompletionList.HasMouseIn) return;
                Point mousePos = sci.PointToClient(Control.MousePosition);
                if (mousePos.X == lastMousePos.X && mousePos.Y == lastMousePos.Y)
                    return;

                lastMousePos = mousePos;
                Rectangle bounds = sci.Bounds;
                if ((mousePos.X < 0) || (mousePos.X > bounds.Width) || (mousePos.Y < 0) || (mousePos.Y > bounds.Height)) return;

                // check no panel is over the editor
                DockPanel panel = PluginBase.MainForm.DockPanel;
                DockContentCollection panels = panel.Contents;
                foreach (DockContent content in panels)
                {
                    if (content.IsHidden) continue;
                    Point pt = content.PointToClient(Control.MousePosition);
                    if (content.ClientRectangle.Contains(pt)
                        && content.GetType().ToString() != "FlashDevelop.Docking.TabbedDocument")
                        return;
                }
                if (OnMouseHover != null) OnMouseHover(sci, position);
            }
            catch (Exception ex)
            {
                ErrorManager.ShowError(ex);
                // disable this feature completely
                OnMouseHover = null;
            }
        }
开发者ID:heon21st,项目名称:flashdevelop,代码行数:35,代码来源:UITools.cs

示例2: HandleDwellStart

		static public void HandleDwellStart(ScintillaControl sci, int position)
		{
			// check dwell validity
			if (sci == null || CallTipActive) return;
			// TODO: Improve this code: I don't like this solution to check the mouse position
			// check mouse over the editor
			if ((position < 0) || Visible) return;
			Point mousePos = sci.PointToClient(Control.MousePosition);
			Rectangle bounds = sci.Bounds;
			if ((mousePos.X < 0) || (mousePos.X > bounds.Width) || (mousePos.Y < 0) || (mousePos.Y > bounds.Height)) return;
			// check no panel is over the editor
			bool valid = false;
			Form frm = (Form)UITools.MainForm;
			mousePos = frm.PointToClient(Control.MousePosition);
			Control ctrl = frm.GetChildAtPoint(mousePos);
			if (ctrl != null) 
			{
				mousePos = ctrl.PointToClient(Control.MousePosition);
				ctrl = ctrl.GetChildAtPoint(mousePos);
				if (ctrl != null) 
				{
					mousePos = ctrl.PointToClient(Control.MousePosition);
					ctrl = ctrl.GetChildAtPoint(mousePos);
					if (ctrl != null) 
					{
						mousePos = ctrl.PointToClient(Control.MousePosition);
						ctrl = ctrl.GetChildAtPoint(mousePos);
						if (ctrl != null) 
						{
							valid = (ctrl.GetType().ToString() == "FlashDevelop.TabbedDocument");
						}
					}
				}
			}
			if (valid && OnMouseHover != null) OnMouseHover(sci, position);
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:36,代码来源:InfoTip.cs


注:本文中的ScintillaNet.ScintillaControl.PointToClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。