aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/label.h
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-04-30 13:41:34 +0200
committerJoel Bodenmann <joel@unormal.org>2014-04-30 13:41:34 +0200
commit33c721c009465dd30d4e96e055a051480c567b57 (patch)
tree5a6744a79b7469d80bae474d4314b47d4cd6d44d /src/gwin/label.h
parent58cf2d2b35542166f1a4e50a83bcf28ff33574a5 (diff)
parenta394e2c35dde67241bea69409bcae9f46dcfc089 (diff)
downloaduGFX-33c721c009465dd30d4e96e055a051480c567b57.tar.gz
uGFX-33c721c009465dd30d4e96e055a051480c567b57.tar.bz2
uGFX-33c721c009465dd30d4e96e055a051480c567b57.zip
Merge branch 'master' into freertos
Diffstat (limited to 'src/gwin/label.h')
-rw-r--r--src/gwin/label.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/gwin/label.h b/src/gwin/label.h
index 3fe0f3d7..b7218193 100644
--- a/src/gwin/label.h
+++ b/src/gwin/label.h
@@ -6,7 +6,7 @@
*/
/**
- * @file include/gwin/label.h
+ * @file src/gwin/label.h
* @brief GWIN label widget header file.
*
* @defgroup Label Label
@@ -32,6 +32,11 @@
// An label window
typedef struct GLabelObject {
GWidgetObject w;
+
+ #if GWIN_LABEL_ATTRIBUTE
+ coord_t tab;
+ const char* attr;
+ #endif
} GLabelObject;
#ifdef __cplusplus
@@ -63,6 +68,33 @@ GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit);
*/
void gwinLabelSetBorder(GHandle gh, bool_t border);
+#if GWIN_LABEL_ATTRIBUTE || defined(__DOXYGEN__)
+ /**
+ * @brief Add an text attribute in front of the normal label text
+ * @details Often you want to display a text like this:
+ * Current IP: 192.168.1.42
+ * In that case, the actual IP will be variable, the text in front of it
+ * always remains the same. The static text is called the attribute and can be
+ * set using this function.
+ * Furthermore, the tab can be set in order to vertically align multiple labels.
+ * Please check out the website for further explanation, illustraions and usage
+ * examples.
+ *
+ * @note The attribute text is not copied into private memory and so it
+ * must be a constant string, not one allocated in a stack buffer.
+ * @note Use of this construct is discouraged. The appropriate way is to
+ * create two labels - one for the static text and one for the
+ * dynamic text.
+ *
+ * @param[in] gh The widget handle (must be a label handle)
+ * @param[in] tab The distance of the label text from the left widget edge
+ * @param[in] attr The attribute to be displayed
+ *
+ * @api
+ */
+ void gwinLabelSetAttribute(GHandle gh, coord_t tab, const char* attr);
+#endif
+
#ifdef __cplusplus
}
#endif