From da1f4e8e2f2937f1ba1ef14599f81cb8545e9c26 Mon Sep 17 00:00:00 2001 From: Gabor Date: Fri, 12 May 2017 16:09:37 +0200 Subject: [PATCH] minor updates --- lv_obj/lv_obj.h | 55 +++++++++++++++++++++++------------------------ lv_objx/lv_mbox.h | 15 ++++++++++++- lv_objx/lv_page.c | 2 +- lv_objx/lv_page.h | 2 +- lv_objx/lv_win.c | 4 ++-- lv_objx/lv_win.h | 12 +++++------ 6 files changed, 51 insertions(+), 39 deletions(-) diff --git a/lv_obj/lv_obj.h b/lv_obj/lv_obj.h index df95fda42..987bcc833 100644 --- a/lv_obj/lv_obj.h +++ b/lv_obj/lv_obj.h @@ -173,25 +173,6 @@ typedef enum */ void lv_init(void); -/** - * Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task' - * @param obj pointer to an object - */ -void lv_obj_inv(lv_obj_t * obj); - -/** - * Notify an object about its style is modified - * @param obj pointer to an object - */ -void lv_obj_refr_style(lv_obj_t * obj); - -/** - * Notify all object if a style is modified - * @param style pinter to a style. Only objects with this style will be notified - * (NULL to notify all objects) - */ -void lv_style_refr_objs(void * style); - /** * Create a basic object * @param parent pointer to a parent object. @@ -216,6 +197,12 @@ void lv_obj_del(lv_obj_t * obj); */ bool lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param); +/** + * Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task' + * @param obj pointer to an object + */ +void lv_obj_inv(lv_obj_t * obj); + /** * Load a new screen * @param scr pointer to a screen @@ -239,7 +226,7 @@ void lv_obj_set_pos(lv_obj_t * obj, cord_t x, cord_t y); /** * Set relative the position of an object (relative to the parent). - * The coordinates will be upscaled to compensate LV_DOWNSCALE. + * The coordinates will be upscaled with LV_DOWNSCALE. * @param obj pointer to an object * @param x new distance from the left side of the parent. (will be multiplied with LV_DOWNSCALE) * @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE) @@ -255,7 +242,7 @@ void lv_obj_set_x(lv_obj_t * obj, cord_t x); /** * Set the x coordinate of a object. - * The coordinate will be upscaled to compensate LV_DOWNSCALE. + * The coordinate will be upscaled with LV_DOWNSCALE. * @param obj pointer to an object * @param x new distance from the left side from the parent. (will be multiplied with LV_DOWNSCALE) */ @@ -270,7 +257,7 @@ void lv_obj_set_y(lv_obj_t * obj, cord_t y); /** * Set the y coordinate of a object. - * The coordinate will be upscaled to compensate LV_DOWNSCALE. + * The coordinate will be upscaled with LV_DOWNSCALE. * @param obj pointer to an object * @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE) */ @@ -285,7 +272,7 @@ void lv_obj_set_y_us(lv_obj_t * obj, cord_t y); void lv_obj_set_size(lv_obj_t * obj, cord_t w, cord_t h); /** - * Set the size of an object. The coordinates will be upscaled to compensate LV_DOWNSCALE. + * Set the size of an object. The coordinates will be upscaled with LV_DOWNSCALE. * @param obj pointer to an object * @param w new width (will be multiplied with LV_DOWNSCALE) * @param h new height (will be multiplied with LV_DOWNSCALE) @@ -300,7 +287,7 @@ void lv_obj_set_size_us(lv_obj_t * obj, cord_t w, cord_t h); void lv_obj_set_width(lv_obj_t * obj, cord_t w); /** - * Set the width of an object. The width will be upscaled to compensate LV_DOWNSCALE + * Set the width of an object. The width will be upscaled with LV_DOWNSCALE * @param obj pointer to an object * @param w new width (will be multiplied with LV_DOWNSCALE) */ @@ -314,7 +301,7 @@ void lv_obj_set_width_us(lv_obj_t * obj, cord_t w); void lv_obj_set_height(lv_obj_t * obj, cord_t h); /** - * Set the height of an object. The height will be upscaled to compensate LV_DOWNSCALE + * Set the height of an object. The height will be upscaled with LV_DOWNSCALE * @param obj pointer to an object * @param h new height (will be multiplied with LV_DOWNSCALE) */ @@ -331,7 +318,7 @@ void lv_obj_set_height_us(lv_obj_t * obj, cord_t h); void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod); /** - * Align an object to an other object. The coordinates will be upscaled to compensate LV_DOWNSCALE. + * Align an object to an other object. The coordinates will be upscaled with LV_DOWNSCALE. * @param obj pointer to an object to align * @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it. * @param align type of alignment (see 'lv_align_t' enum) @@ -354,6 +341,19 @@ void lv_obj_set_ext_size(lv_obj_t * obj, cord_t ext_size); */ void lv_obj_set_style(lv_obj_t * obj, lv_style_t * style); +/** + * Notify an object about its style is modified + * @param obj pointer to an object + */ +void lv_obj_refr_style(lv_obj_t * obj); + +/** + * Notify all object if a style is modified + * @param style pointer to a style. Only the objects with this style will be notified + * (NULL to notify all objects) + */ +void lv_style_refr_objs(void * style); + /** * Hide an object. It won't be visible and clickable. * @param obj pointer to an object @@ -460,7 +460,6 @@ void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num); */ void lv_obj_set_free_p(lv_obj_t * obj, void * free_p); #endif - /** * Animate an object * @param obj pointer to an object to animate @@ -550,7 +549,7 @@ cord_t lv_obj_get_height(lv_obj_t * obj); cord_t lv_obj_get_ext_size(lv_obj_t * obj); /** - * Get the style pointer of an object + * Get the style pointer of an object (if NULL get style of the parent) * @param obj pointer to an object * @return pointer to a style */ diff --git a/lv_objx/lv_mbox.h b/lv_objx/lv_mbox.h index e1521c2c9..df31e7eb7 100644 --- a/lv_objx/lv_mbox.h +++ b/lv_objx/lv_mbox.h @@ -107,6 +107,13 @@ void lv_mbox_set_text(lv_obj_t * mbox, const char * txt); */ void lv_mbox_set_styles_btn(lv_obj_t * mbox, lv_style_t * rel, lv_style_t * pr); +/** + * Set close animation duration + * @param mbox pointer to a message box object + * @param time animation length in milliseconds (0: no animation) + */ +void lv_mbox_set_anim_close_time(lv_obj_t * mbox, uint16_t time); + /** * Automatically delete the message box after a given time * @param mbox pointer to a message box object @@ -135,6 +142,13 @@ const char * lv_mbox_get_txt(lv_obj_t * mbox); */ lv_obj_t * lv_mbox_get_from_btn(lv_obj_t * btn); +/** + * Get the close animation duration + * @param mbox pointer to a message box object + * @return animation length in milliseconds (0: no animation) + */ +uint16_t lv_mbox_get_anim_close_time(lv_obj_t * mbox ); + /** * Get the style of the buttons on a message box * @param mbox pointer to a message box object @@ -143,7 +157,6 @@ lv_obj_t * lv_mbox_get_from_btn(lv_obj_t * btn); */ lv_style_t * lv_mbox_get_style_btn(lv_obj_t * mbox, lv_btn_state_t state); - /********************** * MACROS **********************/ diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index 6e8ffe4f6..c376bd1cd 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -414,7 +414,7 @@ void lv_page_glue_obj(lv_obj_t * obj, bool glue) * Focus on an object. It ensures that the object will be visible on the page. * @param page pointer to a page object * @param obj pointer to an object to focus (must be on the page) - * @param anim_time true: scroll animation time in milliseconds (0: no animation) + * @param anim_time scroll animation time in milliseconds (0: no animation) */ void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, uint16_t anim_time) { diff --git a/lv_objx/lv_page.h b/lv_objx/lv_page.h index 1c93597c7..117103afb 100644 --- a/lv_objx/lv_page.h +++ b/lv_objx/lv_page.h @@ -122,7 +122,7 @@ void lv_page_glue_obj(lv_obj_t * obj, bool glue); * Focus on an object. It ensures that the object will be visible on the page. * @param page pointer to a page object * @param obj pointer to an object to focus (must be on the page) - * @param anim_en true: scroll with animation + * @param anim_time scroll animation time in milliseconds (0: no animation) */ void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, uint16_t anim_time); diff --git a/lv_objx/lv_win.c b/lv_objx/lv_win.c index 4d8253aed..62f672bd3 100644 --- a/lv_objx/lv_win.c +++ b/lv_objx/lv_win.c @@ -271,7 +271,7 @@ void lv_win_set_cbtn_size(lv_obj_t * win, cord_t size) /** * Set the styles of the window control buttons in a given state * @param win pointer to a window object - * @param rel spointer to the style in released state + * @param rel pointer to the style in released state * @param pr pointer to the style in pressed state */ void lv_win_set_styles_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr) @@ -338,7 +338,7 @@ cord_t lv_win_get_cbtn_size(lv_obj_t * win) /** * Get width of the content area (page scrollable) of the window * @param win pointer to a window object - * @return the width of the contetn area + * @return the width of the content area */ cord_t lv_win_get_width(lv_obj_t * win) { diff --git a/lv_objx/lv_win.h b/lv_objx/lv_win.h index c94b97502..126a72274 100644 --- a/lv_objx/lv_win.h +++ b/lv_objx/lv_win.h @@ -113,9 +113,9 @@ void lv_win_set_title(lv_obj_t * win, const char * title); void lv_win_set_cbtn_size(lv_obj_t * win, cord_t size); /** - * Set the styles of the window control buttons in a given state + * Set the styles of the window control buttons in a given state * @param win pointer to a window object - * @param rel spointer to the style in released state + * @param rel pointer to the style in released state * @param pr pointer to the style in pressed state */ void lv_win_set_styles_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr); @@ -151,17 +151,17 @@ cord_t lv_win_get_cbtn_size(lv_obj_t * win); /** * Get width of the content area (page scrollable) of the window * @param win pointer to a window object - * @return the width of the contetn area + * @return the width of the content area */ cord_t lv_win_get_width(lv_obj_t * win); /** * Get the pointer of a widow from one of its control button. * It is useful in the action of the control buttons where only button is known. - * @param cbtn pointer to a control button of a window - * @return pointer to the window of 'cbtn' + * @param ctrl_btn pointer to a control button of a window + * @return pointer to the window of 'ctrl_btn' */ -lv_obj_t * lv_win_get_from_cbtn(lv_obj_t * cbtn); +lv_obj_t * lv_win_get_from_cbtn(lv_obj_t * ctrl_btn); /********************** * MACROS