private void CreateMouseEvent(QEnum.Type type, QEnum.MouseButton button) { var mouseEvent = new QMouseEvent(type, button, mouseLocalPos(), MouseScreenPos()); switch (type) { case QEnum.Type.MouseButtonPress: ShowCursor(type); MousePressEvent(mouseEvent); break; case QEnum.Type.MouseButtonRelease: ShowCursor(type); MouseReleaseEvent(mouseEvent); break; } }
private void ShowCursor(QEnum.Type type) { if (cursor == null) { return; } switch (type) { case QEnum.Type.Enter: cursor.Show(); break; case QEnum.Type.Exit: cursor.Hide(); break; case QEnum.Type.MouseButtonPress: case QEnum.Type.DragLeave: cursor.SetState(QEnum.CursorState.Down); break; case QEnum.Type.MouseButtonRelease: case QEnum.Type.DragEnd: cursor.SetState(QEnum.CursorState.Hover); break; } }
public QDragEvent(object data, QEnum.MouseButton button, Vector2 localPos, Vector2 screenPos, QEnum.Type type = QEnum.Type.DragLeave) : base(type, localPos, screenPos) { dropData = data; b = button; }
public QDragEvent(Vector2 localPos, Vector2 screenPos, QEnum.Type type = QEnum.Type.DragLeave) : base(type, localPos, screenPos) { }
public QEvent(QEnum.Type type) { t = type; }
public QMouseEvent(QEnum.Type type, QEnum.MouseButton button, Vector2 localPos, Vector2 screenPos) : base(type) { b = button; l = localPos; s = screenPos; }
public QMouseEvent(QEnum.Type type, Vector2 localPos, Vector2 screenPos) : base(type) { l = localPos; s = screenPos; }
public QExitEvent(QEnum.Type type = QEnum.Type.Exit) : base(type) { }
public QWheelEvent(Vector2 delta, QEnum.Type type = QEnum.Type.Wheel) : base(type) { d = (int)delta.y; }
public QFocusEvent(QEnum.Type type) : base(type) { }
public QEnterEvent(QEnum.Type type = QEnum.Type.Enter) : base(type) { }
public QMoveEvent(Vector2 size, Vector2 oldSize, QEnum.Type type = QEnum.Type.Move) : base(type) { s = size; o = oldSize; }
public QCloseEvent(QEnum.Type type = QEnum.Type.Close) : base(type) { }
public QHideEvent(QEnum.Type type = QEnum.Type.Hide) : base(type) { }
public QShowEvent(QEnum.Type type = QEnum.Type.Show) : base(type) { }
public QKeyEvent(QEnum.Type type, KeyCode keyCode, EventModifiers modifiers) : base(type) { k = keyCode; m = modifiers; }
public QDropEvent(Vector2 localPos, Vector2 screenPos, QEnum.Type type = QEnum.Type.Drop) : base(localPos, screenPos, type) { }