diff --git a/microui.c b/microui.c index 987ff1e..7c39cd8 100644 --- a/microui.c +++ b/microui.c @@ -792,6 +792,12 @@ mu_label(mu_Context* ctx, char const* text) mu_draw_control_text(ctx, text, mu_layout_next(ctx), MU_COLOR_TEXT, 0); } +int +mu_button(mu_Context* ctx, char const* label) +{ + return mu_button_ex(ctx, label, 0, MU_OPT_ALIGNCENTER); +} + int mu_button_ex(mu_Context* ctx, char const* label, int icon, int opt) { diff --git a/microui.h b/microui.h index 6ebef57..77ab634 100644 --- a/microui.h +++ b/microui.h @@ -267,7 +267,6 @@ void mu_draw_control_text(mu_Context* ctx, char const* str, mu_Rect rect, int co int mu_mouse_over(mu_Context* ctx, mu_Rect rect); void mu_update_control(mu_Context* ctx, mu_Id id, mu_Rect rect, int opt); -#define mu_button(ctx, label) mu_button_ex(ctx, label, 0, MU_OPT_ALIGNCENTER) #define mu_textbox(ctx, buf, bufsz) mu_textbox_ex(ctx, buf, bufsz, 0) #define mu_slider(ctx, value, lo, hi) mu_slider_ex(ctx, value, lo, hi, 0, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER) #define mu_number(ctx, value, step) mu_number_ex(ctx, value, step, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER) @@ -278,6 +277,7 @@ void mu_update_control(mu_Context* ctx, mu_Id id, mu_Rect rect, int opt); void mu_text(mu_Context* ctx, char const* text); void mu_label(mu_Context* ctx, char const* text); +int mu_button(mu_Context* ctx, char const* label); int mu_button_ex(mu_Context* ctx, char const* label, int icon, int opt); int mu_checkbox(mu_Context* ctx, char const* label, bool *state); int mu_textbox_ex(mu_Context* ctx, char *buf, int bufsz, int opt); diff --git a/microui.sunder b/microui.sunder index e6f6fac..97d680c 100644 --- a/microui.sunder +++ b/microui.sunder @@ -232,7 +232,6 @@ extern func mu_draw_control_text(ctx: *mu_Context, str: *char, rect: mu_Rect, co extern func mu_mouse_over(ctx: *mu_Context, rect: mu_Rect) sint; extern func mu_update_control(ctx: *mu_Context, id: mu_Id, rect: mu_Rect, opt: sint) void; -func mu_button(ctx: *mu_Context, label: *char) sint { return mu_button_ex(ctx, label, 0, MU_OPT_ALIGNCENTER); } func mu_textbox(ctx: *mu_Context, buf: *char, bufsz: sint) sint { return mu_textbox_ex(ctx, buf, bufsz, 0); } func mu_slider(ctx: *mu_Context, value: *mu_Real, lo: mu_Real, hi: mu_Real) sint { return mu_slider_ex(ctx, value, lo, hi, 0.0, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER); } func mu_number(ctx: *mu_Context, value: *mu_Real, step: mu_Real) sint { return mu_number_ex(ctx, value, step, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER); } @@ -243,6 +242,7 @@ func mu_begin_panel(ctx: *mu_Context, name: *char) void { mu_begin_panel_ex(ctx, extern func mu_text(ctx: *mu_Context, text: *char) void; extern func mu_label(ctx: *mu_Context, text: *char) void; +extern func mu_button(ctx: *mu_Context, label: *char) sint; extern func mu_button_ex(ctx: *mu_Context, label: *char, icon: sint, opt: sint) sint; extern func mu_checkbox(ctx: *mu_Context, label: *char, state: *bool) sint; extern func mu_textbox_ex(ctx: *mu_Context, buf: *char, bufsz: sint, opt: sint) sint;