mirror of
https://github.com/gwm17/implot.git
synced 2025-04-22 00:18:49 -04: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);
|
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 ImPlot {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
39
implot.h
39
implot.h
|
@ -172,27 +172,30 @@ struct ImPlotStyle {
|
||||||
ImPlotStyle();
|
ImPlotStyle();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Input mapping structure, and their default values.
|
// Input mapping structure, default values listed in the comments.
|
||||||
struct ImPlotInputMap {
|
struct ImPlotInputMap {
|
||||||
ImGuiMouseButton PanButton = ImGuiMouseButton_Left;
|
|
||||||
ImGuiKeyModFlags PanMod = ImGuiKeyModFlags_None;
|
|
||||||
|
|
||||||
ImGuiMouseButton BoxSelectButton = ImGuiMouseButton_Right;
|
ImPlotInputMap();
|
||||||
ImGuiKeyModFlags BoxSelectMod = ImGuiKeyModFlags_None;
|
|
||||||
|
|
||||||
ImGuiMouseButton BoxCancelButton = ImGuiMouseButton_Left;
|
ImGuiMouseButton PanButton; // left mouse
|
||||||
|
ImGuiKeyModFlags PanMod; // none
|
||||||
ImGuiMouseButton QueryClickButton = ImGuiMouseButton_Left;
|
|
||||||
ImGuiKeyModFlags QueryClickMod = ImGuiKeyModFlags_Ctrl;
|
ImGuiMouseButton BoxSelectButton; // right mouse
|
||||||
|
ImGuiKeyModFlags BoxSelectMod; // none
|
||||||
ImGuiMouseButton QueryDragButton = ImGuiMouseButton_Middle;
|
|
||||||
ImGuiKeyModFlags QueryDragMod = ImGuiKeyModFlags_None;
|
ImGuiMouseButton BoxCancelButton; // left mouse
|
||||||
|
|
||||||
ImGuiMouseButton QueryDragButton2 = ImGuiMouseButton_Right;
|
ImGuiMouseButton QueryClickButton; // left mouse
|
||||||
ImGuiKeyModFlags QueryDragMod2 = ImGuiKeyModFlags_Ctrl;
|
ImGuiKeyModFlags QueryClickMod; // ctrl
|
||||||
|
|
||||||
ImGuiKeyModFlags HorizontalSizeMod = ImGuiKeyModFlags_Alt;
|
ImGuiMouseButton QueryDragButton; // middle mouse
|
||||||
ImGuiKeyModFlags VerticalSizeMod = ImGuiKeyModFlags_Shift;
|
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