mirror of
https://github.com/gwm17/implot.git
synced 2025-01-30 19:08:51 -05:00
Switched from in-class initialization to setting the default input mapping in a constructor in the .cpp file.
This commit is contained in:
parent
989815bec5
commit
ce79420146
24
implot.cpp
24
implot.cpp
|
@ -133,6 +133,30 @@ bool ImPlotLimits::Contains(double x, double y) const {
|
|||
return X.Contains(x) && Y.Contains(y);
|
||||
}
|
||||
|
||||
ImPlotInputMap::ImPlotInputMap() {
|
||||
|
||||
PanButton = ImGuiMouseButton_Left;
|
||||
PanMod = ImGuiKeyModFlags_None;
|
||||
|
||||
BoxSelectButton = ImGuiMouseButton_Right;
|
||||
BoxSelectMod = ImGuiKeyModFlags_None;
|
||||
|
||||
BoxCancelButton = ImGuiMouseButton_Left;
|
||||
|
||||
QueryClickButton = ImGuiMouseButton_Left;
|
||||
QueryClickMod = ImGuiKeyModFlags_Ctrl;
|
||||
|
||||
QueryDragButton = ImGuiMouseButton_Middle;
|
||||
QueryDragMod = ImGuiKeyModFlags_None;
|
||||
|
||||
QueryDragButton2 = ImGuiMouseButton_Right;
|
||||
QueryDragMod2 = ImGuiKeyModFlags_Ctrl;
|
||||
|
||||
HorizontalSizeMod = ImGuiKeyModFlags_Alt;
|
||||
VerticalSizeMod = ImGuiKeyModFlags_Shift;
|
||||
}
|
||||
|
||||
|
||||
namespace ImPlot {
|
||||
|
||||
namespace {
|
||||
|
|
39
implot.h
39
implot.h
|
@ -172,27 +172,30 @@ struct ImPlotStyle {
|
|||
ImPlotStyle();
|
||||
};
|
||||
|
||||
// Input mapping structure, and their default values.
|
||||
// Input mapping structure, default values listed in the comments.
|
||||
struct ImPlotInputMap {
|
||||
ImGuiMouseButton PanButton = ImGuiMouseButton_Left;
|
||||
ImGuiKeyModFlags PanMod = ImGuiKeyModFlags_None;
|
||||
|
||||
ImGuiMouseButton BoxSelectButton = ImGuiMouseButton_Right;
|
||||
ImGuiKeyModFlags BoxSelectMod = ImGuiKeyModFlags_None;
|
||||
ImPlotInputMap();
|
||||
|
||||
ImGuiMouseButton BoxCancelButton = ImGuiMouseButton_Left;
|
||||
|
||||
ImGuiMouseButton QueryClickButton = ImGuiMouseButton_Left;
|
||||
ImGuiKeyModFlags QueryClickMod = ImGuiKeyModFlags_Ctrl;
|
||||
|
||||
ImGuiMouseButton QueryDragButton = ImGuiMouseButton_Middle;
|
||||
ImGuiKeyModFlags QueryDragMod = ImGuiKeyModFlags_None;
|
||||
|
||||
ImGuiMouseButton QueryDragButton2 = ImGuiMouseButton_Right;
|
||||
ImGuiKeyModFlags QueryDragMod2 = ImGuiKeyModFlags_Ctrl;
|
||||
|
||||
ImGuiKeyModFlags HorizontalSizeMod = ImGuiKeyModFlags_Alt;
|
||||
ImGuiKeyModFlags VerticalSizeMod = ImGuiKeyModFlags_Shift;
|
||||
ImGuiMouseButton PanButton; // left mouse
|
||||
ImGuiKeyModFlags PanMod; // none
|
||||
|
||||
ImGuiMouseButton BoxSelectButton; // right mouse
|
||||
ImGuiKeyModFlags BoxSelectMod; // none
|
||||
|
||||
ImGuiMouseButton BoxCancelButton; // left mouse
|
||||
|
||||
ImGuiMouseButton QueryClickButton; // left mouse
|
||||
ImGuiKeyModFlags QueryClickMod; // ctrl
|
||||
|
||||
ImGuiMouseButton QueryDragButton; // middle mouse
|
||||
ImGuiKeyModFlags QueryDragMod; // none
|
||||
|
||||
ImGuiMouseButton QueryDragButton2; // right mouse, alternative way to query drag, useful when middle mouse is not available
|
||||
ImGuiKeyModFlags QueryDragMod2; // ctrl
|
||||
|
||||
ImGuiKeyModFlags HorizontalSizeMod; // alt
|
||||
ImGuiKeyModFlags VerticalSizeMod; // shift
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user