本文整理汇总了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;
}
}
示例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);
}