Hi guys,
In the last chapter about the C# editor, there's a section on input handling. In it, I find the following method:
Display All
Which is used as:
Display All
I was just wondering what the purpose is of this fake focus check? It seems to just check if the mouse cursor is inside the display panel, and then it sets the position to the real position? How exactly does this affect anything?
Thanks!
In the last chapter about the C# editor, there's a section on input handling. In it, I find the following method:
Source Code
- void CheckFakeFocus()
- {
- System.Drawing.Point position = Cursor.Position;
- System.Drawing.Point relativeToForm = m_displayPanel.PointToClient(position);
- m_fakeFocus = (relativeToForm.X >= 0 && relativeToForm.Y >= 0 &&
- relativeToForm.X < m_displayPanel.Width && relativeToForm.Y < m_displayPanel.Width);
- if (m_fakeFocus)
- {
- m_mouseDownPosition = position;
- }
- }
Which is used as:
Source Code
- public bool PreFilterMessage(ref Message m)
- {
- // Intercept messages only if they occur for the EditorForm
- // or its display panel.
- if (m.Msg == WM_LBUTTONDOWN || m.Msg == WM_RBUTTONDOWN || m.Msg == WM_MBUTTONDOWN)
- CheckFakeFocus();
- if (m.HWnd == m_displayPanel.Handle || (m_fakeFocus && (m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP)))
- {
- switch (m.Msg)
- {
I was just wondering what the purpose is of this fake focus check? It seems to just check if the mouse cursor is inside the display panel, and then it sets the position to the real position? How exactly does this affect anything?
Thanks!
Cheers and beers from Belgium!