@@ -543,28 +543,34 @@ struct ImPlotStyle {
543543 IMPLOT_API ImPlotStyle ();
544544};
545545
546+ // Support for legacy versions
546547#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
553559#endif
554560
555561// Input mapping structure. Default values listed. See also MapInputDefault, MapInputReverse.
556562struct ImPlotInputMap {
557563 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
559565 ImGuiMouseButton Fit; // LMB initiates fit when double clicked
560566 ImGuiMouseButton Select; // RMB begins box selection when pressed and confirms selection when released
561567 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
565571 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
568574 float ZoomRate; // 0.1f zoom rate for scroll (e.g. 0.1f = 10% plot range every scroll click); make negative to invert
569575 IMPLOT_API ImPlotInputMap ();
570576};
@@ -1023,7 +1029,7 @@ IMPLOT_API bool BeginDragDropTargetLegend();
10231029IMPLOT_API void EndDragDropTarget ();
10241030
10251031// 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.
10271033
10281034// Turns the current plot's plotting area into a drag and drop source. You must hold Ctrl. Don't forget to call EndDragDropSource!
10291035IMPLOT_API bool BeginDragDropSourcePlot (ImGuiDragDropFlags flags=0 );
0 commit comments