This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
214 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
[GenerateNode(Category = "ImGui.Commands", GenerateRetained = false)] | ||
internal partial class ResetMouseDragDelta : Widget | ||
{ | ||
|
||
public bool Enabled { private get; set; } = true; | ||
|
||
internal override void Update(Context context) | ||
{ | ||
if (Enabled) | ||
ImGuiNET.ImGui.ResetMouseDragDelta(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/VL.ImGui/Widgets/Queries/Mouse/GetMouseClickedCount.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Return the number of successive mouse-clicks at the time where a click happen (otherwise 0). | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class GetMouseClickedCount : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flag { private get; set; } | ||
|
||
public int Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.GetMouseClickedCount(Flag); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Stride.Core.Mathematics; | ||
|
||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class GetMouseDragDelta : Widget | ||
{ | ||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public float Threshold { private get; set; } = -2.0f; | ||
|
||
public Vector2 Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
var value = ImGuiNET.ImGui.GetMouseDragDelta(Flags, Threshold); | ||
Value = value.ToVL(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Stride.Core.Mathematics; | ||
|
||
namespace VL.ImGui.Widgets | ||
{ | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class GetMousePos : Widget | ||
{ | ||
public Vector2 Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
var value = ImGuiNET.ImGui.GetMousePos(); | ||
Value = value.ToVL(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/VL.ImGui/Widgets/Queries/Mouse/GetMousePosOnOpeningCurrentPopup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Stride.Core.Mathematics; | ||
|
||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Retrieve mouse position at the time of opening popup. | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries", GenerateRetained = false)] | ||
internal partial class GetMousePosOnOpeningCurrentPopup : Widget | ||
{ | ||
public Vector2 Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
var value = ImGuiNET.ImGui.GetMousePosOnOpeningCurrentPopup(); | ||
Value = value.ToVL(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Did mouse button clicked? | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseClicked : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public bool Repeat { private get; set; } = true; | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseClicked(Flags, Repeat); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/VL.ImGui/Widgets/Queries/Mouse/IsMouseDoubleClicked.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Did mouse button double-clicked? | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseDoubleClicked : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseDoubleClicked(Flags); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Is mouse button held? | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseDown : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseDown(Flags); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseDragging : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public float Threshold { private get; set; } = -2.0f; | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseDragging(Flags, Threshold); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Stride.Core.Mathematics; | ||
|
||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block. | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseHoveringRect : Widget | ||
{ | ||
|
||
public Vector2 Min { private get; set; } | ||
public Vector2 Max { private get; set; } | ||
public bool Clip { private get; set; } | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseHoveringRect(Min.ToImGui(), Max.ToImGui(), Clip); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace VL.ImGui.Widgets | ||
{ | ||
/// <summary> | ||
/// Did mouse button released? | ||
/// </summary> | ||
[GenerateNode(Category = "ImGui.Queries")] | ||
internal partial class IsMouseReleased : Widget | ||
{ | ||
|
||
public ImGuiNET.ImGuiMouseButton Flags { private get; set; } | ||
|
||
public bool Value { get; private set; } | ||
|
||
internal override void Update(Context context) | ||
{ | ||
Value = ImGuiNET.ImGui.IsMouseReleased(Flags); | ||
} | ||
} | ||
} |