The multi-plot example the phase exists for: three plots stacked in one Figure, sharing one x link with following armed, each row carrying its own named signals and its own legend, driven by six StreamSeries at 500 kS/s. Two cursors and a region with an exact statistics readout reach the direct manipulation of spec §5 in the same frame, and PLOT_DEMO_SYNC=1 is a self-checking mode that exits non-zero unless all three rows hold one range and the shared right edge keeps tracking the newest sample through a zoom, a pan on another row and more arriving data. The GLFW host gains the figure mode the demo needs: set_figure() makes the run loop draw the Figure instead of its own plot and route each pointer, wheel and key event to the row it lands in, through one Controller per row (row_controller()). All of it is opt-in; the single-plot path is untouched.
14 lines
594 B
Plaintext
14 lines
594 B
Plaintext
e.mods = static_cast<u32>(mods);
|
|
// GLFW reports auto-repeat as its own action; a held key keeps acting, exactly
|
|
// as holding the key on a keyboard does.
|
|
e.down = action != GLFW_RELEASE;
|
|
// A key has no position of its own: it goes to the row the pointer was last over,
|
|
// which is the row the user is looking at.
|
|
input::Controller& controller =
|
|
(figure_ == nullptr || last_row_ >= row_controllers_.size()) ? controller_
|
|
: *row_controllers_[last_row_];
|
|
controller.on_key(e);
|
|
}
|
|
|
|
} // namespace plot::glfw
|