@@ -543,28 +543,34 @@ struct ImPlotStyle {
543
543
IMPLOT_API ImPlotStyle ();
544
544
};
545
545
546
+ // Support for legacy versions
546
547
#if (IMGUI_VERSION_NUM < 18716) // Renamed in 1.88
547
- #define ImGuiModFlags ImGuiKeyModFlags
548
- #define ImGuiModFlags_None ImGuiKeyModFlags_None
549
- #define ImGuiModFlags_Ctrl ImGuiKeyModFlags_Ctrl
550
- #define ImGuiModFlags_Shift ImGuiKeyModFlags_Shift
551
- #define ImGuiModFlags_Alt ImGuiKeyModFlags_Alt
552
- #define ImGuiModFlags_Super ImGuiKeyModFlags_Super
548
+ #define ImGuiMod_None 0
549
+ #define ImGuiMod_Ctrl ImGuiKeyModFlags_Ctrl
550
+ #define ImGuiMod_Shift ImGuiKeyModFlags_Shift
551
+ #define ImGuiMod_Alt ImGuiKeyModFlags_Alt
552
+ #define ImGuiMod_Super ImGuiKeyModFlags_Super
553
+ #elif (IMGUI_VERSION_NUM < 18823) // Renamed in 1.89, sorry
554
+ #define ImGuiMod_None 0
555
+ #define ImGuiMod_Ctrl ImGuiModFlags_Ctrl
556
+ #define ImGuiMod_Shift ImGuiModFlags_Shift
557
+ #define ImGuiMod_Alt ImGuiModFlags_Alt
558
+ #define ImGuiMod_Super ImGuiModFlags_Super
553
559
#endif
554
560
555
561
// Input mapping structure. Default values listed. See also MapInputDefault, MapInputReverse.
556
562
struct ImPlotInputMap {
557
563
ImGuiMouseButton Pan; // LMB enables panning when held,
558
- ImGuiModFlags PanMod; // none optional modifier that must be held for panning/fitting
564
+ int PanMod; // none optional modifier that must be held for panning/fitting
559
565
ImGuiMouseButton Fit; // LMB initiates fit when double clicked
560
566
ImGuiMouseButton Select; // RMB begins box selection when pressed and confirms selection when released
561
567
ImGuiMouseButton SelectCancel; // LMB cancels active box selection when pressed; cannot be same as Select
562
- ImGuiModFlags SelectMod; // none optional modifier that must be held for box selection
563
- ImGuiModFlags SelectHorzMod; // Alt expands active box selection horizontally to plot edge when held
564
- ImGuiModFlags SelectVertMod; // Shift expands active box selection vertically to plot edge when held
568
+ int SelectMod; // none optional modifier that must be held for box selection
569
+ int SelectHorzMod; // Alt expands active box selection horizontally to plot edge when held
570
+ int SelectVertMod; // Shift expands active box selection vertically to plot edge when held
565
571
ImGuiMouseButton Menu; // RMB opens context menus (if enabled) when clicked
566
- ImGuiModFlags OverrideMod; // Ctrl when held, all input is ignored; used to enable axis/plots as DND sources
567
- ImGuiModFlags ZoomMod; // none optional modifier that must be held for scroll wheel zooming
572
+ int OverrideMod; // Ctrl when held, all input is ignored; used to enable axis/plots as DND sources
573
+ int ZoomMod; // none optional modifier that must be held for scroll wheel zooming
568
574
float ZoomRate; // 0.1f zoom rate for scroll (e.g. 0.1f = 10% plot range every scroll click); make negative to invert
569
575
IMPLOT_API ImPlotInputMap ();
570
576
};
@@ -1023,7 +1029,7 @@ IMPLOT_API bool BeginDragDropTargetLegend();
1023
1029
IMPLOT_API void EndDragDropTarget ();
1024
1030
1025
1031
// NB: By default, plot and axes drag and drop *sources* require holding the Ctrl modifier to initiate the drag.
1026
- // You can change the modifier if desired. If ImGuiModFlags_None is provided, the axes will be locked from panning.
1032
+ // You can change the modifier if desired. If ImGuiMod_None is provided, the axes will be locked from panning.
1027
1033
1028
1034
// Turns the current plot's plotting area into a drag and drop source. You must hold Ctrl. Don't forget to call EndDragDropSource!
1029
1035
IMPLOT_API bool BeginDragDropSourcePlot (ImGuiDragDropFlags flags=0 );
0 commit comments