Use ELEMENT_SLIDER to move a drawing element around a gauge with two degrees of freedom. You can see a good example of this type of movement in the mini-controls panel window in Flight Simulator 98. The red dot moves around the window, representing the elevator and aileron control positions. The moving red dot is drawn using ELEMENT_SLIDER.
You can use ELEMENT_SLIDER to move an image in only one direction, as well. Just set the MODULE_VAR, for either X or Y, to MODULE_VAR_NONE.
typedef struct ELEMENT_SLIDER
{
HEADER;
MODULE_VARsource_var_x;
PMODULE_VAR_CBsource_var_x_cb;
FLOAT64scale_x;
PFN_FLOAT64lag_fn_x;
MODULE_VARsource_var_y;
PMODULE_VAR_CBsource_var_y_cb;
FLOAT64scale_y;
PFN_FLOAT64lag_fn_y;
IMAGE_SETslider_data;
PIMAGEsave_buffer;
} ELEMENT_SLIDER, *PELEMENT_SLIDER, **PPELEMENT_SLIDER;
ELEMENT_SLIDER uses the following members:
Member | Description |
HEADER | Discussed in detail in the topic Using Drawing Elements. |
source_var_x | Token value used to calculate the slider's movement along the X axis. |
source_var_x_cb | Callback function used for source_var_x. |
scale_x | Used to scale the MODULE_VAR value in the X direction. |
lag_fn_x | Do not use. |
source_var_y | Token value used to calculate the slider’s movement along the Y axis. |
source_var_y_cb | Callback function used for source_var_y. |
scale_y | Used to scale the MODULE_VAR value in the Y direction. |
lag_fn_y | Do not use. |
slider_data | Used internally by the Panel system; do not use. Must be set to 0. |
save_buffer | Used internally by the Panel system; do not use. Must be set to 0. |