summaryrefslogtreecommitdiff
path: root/textscreen/txt_spinctrl.h
diff options
context:
space:
mode:
Diffstat (limited to 'textscreen/txt_spinctrl.h')
-rw-r--r--textscreen/txt_spinctrl.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/textscreen/txt_spinctrl.h b/textscreen/txt_spinctrl.h
index 2fdd2a62..02d5a211 100644
--- a/textscreen/txt_spinctrl.h
+++ b/textscreen/txt_spinctrl.h
@@ -22,7 +22,16 @@
#ifndef TXT_SPINCONTROL_H
#define TXT_SPINCONTROL_H
+/**
+ * Spin control widget.
+ *
+ * A spin control widget works as an input box that can be used to
+ * set numeric values, but also has buttons that allow its value
+ * to be increased or decreased.
+ */
+
typedef struct txt_spincontrol_s txt_spincontrol_t;
+
typedef enum
{
TXT_SPINCONTROL_INT,
@@ -40,7 +49,28 @@ struct txt_spincontrol_s
char *buffer;
};
+/**
+ * Create a new spin control widget tracking an integer value.
+ *
+ * @param value Pointer to the variable containing the value
+ * displayed in the widget.
+ * @param min Minimum value that may be set.
+ * @param max Maximum value that may be set.
+ * @return Pointer to the new spin control widget.
+ */
+
txt_spincontrol_t *TXT_NewSpinControl(int *value, int min, int max);
+
+/**
+ * Create a new spin control widget tracking a float value.
+ *
+ * @param value Pointer to the variable containing the value
+ * displayed in the widget.
+ * @param min Minimum value that may be set.
+ * @param max Maximum value that may be set.
+ * @return Pointer to the new spin control widget.
+ */
+
txt_spincontrol_t *TXT_NewFloatSpinControl(float *value, float min, float max);
#endif /* #ifndef TXT_SPINCONTROL_H */