Lines Matching refs:button
106 /// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released.
189 /// if (nk_button_label(&ctx, "button")) {
697 /// which resets internal state like delta mouse position and button transistions.
699 /// mouse motion, button and key pressed and released, text input and scrolling.
729 /// __nk_input_button__ | Mirrors mouse button state with either pressed or released
820 /// Mirrors the state of a specific mouse button to nuklear
1324 /// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag
1434 /// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window
3210 /// can be achieved by dragging, adding/removing incremental steps on button click
3222 /// decrement button is clicked. Finally there is a value for increment per pixel
3296 /// __step__ | Increment added and subtracted on increment and decrement button
3317 /// __step__ | Increment added and subtracted on increment and decrement button
3338 /// __step__ | Increment added and subtracted on increment and decrement button
3359 /// __step__ | Increment added and subtracted on increment and decrement button
3382 /// __step__ | Increment added and subtracted on increment and decrement button
3405 /// __step__ | Increment added and subtracted on increment and decrement button
5111 /* button */
5112 struct nk_style_button button;
5131 /* button */
5157 /* button */
5221 struct nk_style_button button;
5441 * red button you can temporarily push the old button color onto a stack
5442 * draw the button with a red color and then you just pop the old color
5445 * nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0)));
5446 * nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0)));
5447 * nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0)));
5448 * nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2));
5925 /* button */
14277 struct nk_style_button *button;
14300 /* default button */
14301 button = &style->button;
14302 nk_zero_struct(*button);
14303 button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]);
14304 button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
14305 button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
14306 button->border_color = table[NK_COLOR_BORDER];
14307 button->text_background = table[NK_COLOR_BUTTON];
14308 button->text_normal = table[NK_COLOR_TEXT];
14309 button->text_hover = table[NK_COLOR_TEXT];
14310 button->text_active = table[NK_COLOR_TEXT];
14311 button->padding = nk_vec2(2.0f,2.0f);
14312 button->image_padding = nk_vec2(0.0f,0.0f);
14313 button->touch_padding = nk_vec2(0.0f, 0.0f);
14314 button->userdata = nk_handle_ptr(0);
14315 button->text_alignment = NK_TEXT_CENTERED;
14316 button->border = 1.0f;
14317 button->rounding = 4.0f;
14318 button->draw_begin = 0;
14319 button->draw_end = 0;
14321 /* contextual button */
14322 button = &style->contextual_button;
14323 nk_zero_struct(*button);
14324 button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
14325 button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
14326 button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
14327 button->border_color = table[NK_COLOR_WINDOW];
14328 button->text_background = table[NK_COLOR_WINDOW];
14329 button->text_normal = table[NK_COLOR_TEXT];
14330 button->text_hover = table[NK_COLOR_TEXT];
14331 button->text_active = table[NK_COLOR_TEXT];
14332 button->padding = nk_vec2(2.0f,2.0f);
14333 button->touch_padding = nk_vec2(0.0f,0.0f);
14334 button->userdata = nk_handle_ptr(0);
14335 button->text_alignment = NK_TEXT_CENTERED;
14336 button->border = 0.0f;
14337 button->rounding = 0.0f;
14338 button->draw_begin = 0;
14339 button->draw_end = 0;
14341 /* menu button */
14342 button = &style->menu_button;
14343 nk_zero_struct(*button);
14344 button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
14345 button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
14346 button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
14347 button->border_color = table[NK_COLOR_WINDOW];
14348 button->text_background = table[NK_COLOR_WINDOW];
14349 button->text_normal = table[NK_COLOR_TEXT];
14350 button->text_hover = table[NK_COLOR_TEXT];
14351 button->text_active = table[NK_COLOR_TEXT];
14352 button->padding = nk_vec2(2.0f,2.0f);
14353 button->touch_padding = nk_vec2(0.0f,0.0f);
14354 button->userdata = nk_handle_ptr(0);
14355 button->text_alignment = NK_TEXT_CENTERED;
14356 button->border = 0.0f;
14357 button->rounding = 1.0f;
14358 button->draw_begin = 0;
14359 button->draw_end = 0;
14448 button = &style->slider.inc_button;
14449 button->normal = nk_style_item_color(nk_rgb(40,40,40));
14450 button->hover = nk_style_item_color(nk_rgb(42,42,42));
14451 button->active = nk_style_item_color(nk_rgb(44,44,44));
14452 button->border_color = nk_rgb(65,65,65);
14453 button->text_background = nk_rgb(40,40,40);
14454 button->text_normal = nk_rgb(175,175,175);
14455 button->text_hover = nk_rgb(175,175,175);
14456 button->text_active = nk_rgb(175,175,175);
14457 button->padding = nk_vec2(8.0f,8.0f);
14458 button->touch_padding = nk_vec2(0.0f,0.0f);
14459 button->userdata = nk_handle_ptr(0);
14460 button->text_alignment = NK_TEXT_CENTERED;
14461 button->border = 1.0f;
14462 button->rounding = 0.0f;
14463 button->draw_begin = 0;
14464 button->draw_end = 0;
14512 button = &style->scrollh.inc_button;
14513 button->normal = nk_style_item_color(nk_rgb(40,40,40));
14514 button->hover = nk_style_item_color(nk_rgb(42,42,42));
14515 button->active = nk_style_item_color(nk_rgb(44,44,44));
14516 button->border_color = nk_rgb(65,65,65);
14517 button->text_background = nk_rgb(40,40,40);
14518 button->text_normal = nk_rgb(175,175,175);
14519 button->text_hover = nk_rgb(175,175,175);
14520 button->text_active = nk_rgb(175,175,175);
14521 button->padding = nk_vec2(4.0f,4.0f);
14522 button->touch_padding = nk_vec2(0.0f,0.0f);
14523 button->userdata = nk_handle_ptr(0);
14524 button->text_alignment = NK_TEXT_CENTERED;
14525 button->border = 1.0f;
14526 button->rounding = 0.0f;
14527 button->draw_begin = 0;
14528 button->draw_end = 0;
14579 button = &style->property.dec_button;
14580 nk_zero_struct(*button);
14581 button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
14582 button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
14583 button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
14584 button->border_color = nk_rgba(0,0,0,0);
14585 button->text_background = table[NK_COLOR_PROPERTY];
14586 button->text_normal = table[NK_COLOR_TEXT];
14587 button->text_hover = table[NK_COLOR_TEXT];
14588 button->text_active = table[NK_COLOR_TEXT];
14589 button->padding = nk_vec2(0.0f,0.0f);
14590 button->touch_padding = nk_vec2(0.0f,0.0f);
14591 button->userdata = nk_handle_ptr(0);
14592 button->text_alignment = NK_TEXT_CENTERED;
14593 button->border = 0.0f;
14594 button->rounding = 0.0f;
14595 button->draw_begin = 0;
14596 button->draw_end = 0;
14651 /* combo button */
14652 button = &style->combo.button;
14653 nk_zero_struct(*button);
14654 button->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
14655 button->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
14656 button->active = nk_style_item_color(table[NK_COLOR_COMBO]);
14657 button->border_color = nk_rgba(0,0,0,0);
14658 button->text_background = table[NK_COLOR_COMBO];
14659 button->text_normal = table[NK_COLOR_TEXT];
14660 button->text_hover = table[NK_COLOR_TEXT];
14661 button->text_active = table[NK_COLOR_TEXT];
14662 button->padding = nk_vec2(2.0f,2.0f);
14663 button->touch_padding = nk_vec2(0.0f,0.0f);
14664 button->userdata = nk_handle_ptr(0);
14665 button->text_alignment = NK_TEXT_CENTERED;
14666 button->border = 0.0f;
14667 button->rounding = 0.0f;
14668 button->draw_begin = 0;
14669 button->draw_end = 0;
14684 /* tab button */
14685 button = &style->tab.tab_minimize_button;
14686 nk_zero_struct(*button);
14687 button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
14688 button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
14689 button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
14690 button->border_color = nk_rgba(0,0,0,0);
14691 button->text_background = table[NK_COLOR_TAB_HEADER];
14692 button->text_normal = table[NK_COLOR_TEXT];
14693 button->text_hover = table[NK_COLOR_TEXT];
14694 button->text_active = table[NK_COLOR_TEXT];
14695 button->padding = nk_vec2(2.0f,2.0f);
14696 button->touch_padding = nk_vec2(0.0f,0.0f);
14697 button->userdata = nk_handle_ptr(0);
14698 button->text_alignment = NK_TEXT_CENTERED;
14699 button->border = 0.0f;
14700 button->rounding = 0.0f;
14701 button->draw_begin = 0;
14702 button->draw_end = 0;
14703 style->tab.tab_maximize_button =*button;
14705 /* node button */
14706 button = &style->tab.node_minimize_button;
14707 nk_zero_struct(*button);
14708 button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
14709 button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
14710 button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
14711 button->border_color = nk_rgba(0,0,0,0);
14712 button->text_background = table[NK_COLOR_TAB_HEADER];
14713 button->text_normal = table[NK_COLOR_TEXT];
14714 button->text_hover = table[NK_COLOR_TEXT];
14715 button->text_active = table[NK_COLOR_TEXT];
14716 button->padding = nk_vec2(2.0f,2.0f);
14717 button->touch_padding = nk_vec2(0.0f,0.0f);
14718 button->userdata = nk_handle_ptr(0);
14719 button->text_alignment = NK_TEXT_CENTERED;
14720 button->border = 0.0f;
14721 button->rounding = 0.0f;
14722 button->draw_begin = 0;
14723 button->draw_end = 0;
14724 style->tab.node_maximize_button =*button;
14742 /* window header close button */
14743 button = &style->window.header.close_button;
14744 nk_zero_struct(*button);
14745 button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
14746 button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
14747 button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
14748 button->border_color = nk_rgba(0,0,0,0);
14749 button->text_background = table[NK_COLOR_HEADER];
14750 button->text_normal = table[NK_COLOR_TEXT];
14751 button->text_hover = table[NK_COLOR_TEXT];
14752 button->text_active = table[NK_COLOR_TEXT];
14753 button->padding = nk_vec2(0.0f,0.0f);
14754 button->touch_padding = nk_vec2(0.0f,0.0f);
14755 button->userdata = nk_handle_ptr(0);
14756 button->text_alignment = NK_TEXT_CENTERED;
14757 button->border = 0.0f;
14758 button->rounding = 0.0f;
14759 button->draw_begin = 0;
14760 button->draw_end = 0;
14762 /* window header minimize button */
14763 button = &style->window.header.minimize_button;
14764 nk_zero_struct(*button);
14765 button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
14766 button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
14767 button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
14768 button->border_color = nk_rgba(0,0,0,0);
14769 button->text_background = table[NK_COLOR_HEADER];
14770 button->text_normal = table[NK_COLOR_TEXT];
14771 button->text_hover = table[NK_COLOR_TEXT];
14772 button->text_active = table[NK_COLOR_TEXT];
14773 button->padding = nk_vec2(0.0f,0.0f);
14774 button->touch_padding = nk_vec2(0.0f,0.0f);
14775 button->userdata = nk_handle_ptr(0);
14776 button->text_alignment = NK_TEXT_CENTERED;
14777 button->border = 0.0f;
14778 button->rounding = 0.0f;
14779 button->draw_begin = 0;
14780 button->draw_end = 0;
15747 /* window close button */
15748 {struct nk_rect button;
15749 button.y = header.y + style->window.header.padding.y;
15750 button.h = header.h - 2 * style->window.header.padding.y;
15751 button.w = button.h;
15755 button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
15756 header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
15758 button.x = header.x + style->window.header.padding.x;
15759 header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
15762 if (nk_do_button_symbol(&ws, &win->buffer, button,
15771 /* window minimize button */
15775 button.x = (header.w + header.x) - button.w;
15777 button.x -= style->window.header.padding.x;
15780 header.w -= button.w + style->window.header.spacing.x;
15782 button.x = header.x;
15783 header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
15785 if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)?
18358 const struct nk_style_button *button;
18409 /* select correct button style */
18413 button = &style->tab.tab_maximize_button;
18414 else button = &style->tab.node_maximize_button;
18418 button = &style->tab.tab_minimize_button;
18419 else button = &style->tab.node_minimize_button;
18422 {/* draw triangle button */
18427 button, 0, style->font);
18539 const struct nk_style_button *button;
18592 /* select correct button style */
18596 button = &style->tab.tab_maximize_button;
18597 else button = &style->tab.node_maximize_button;
18601 button = &style->tab.tab_minimize_button;
18602 else button = &style->tab.node_minimize_button;
18604 {/* draw triangle button */
18608 if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font))
19804 /* calculate button content space */
19810 /* execute button behavior */
20001 /* draw button */
20146 return nk_button_text_styled(ctx, &ctx->style.button, title, len);
20163 struct nk_style_button button;
20183 button = ctx->style.button;
20184 button.normal = nk_style_item_color(color);
20185 button.hover = nk_style_item_color(color);
20186 button.active = nk_style_item_color(color);
20188 &button, in, ctx->button_behavior, &content);
20189 nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
20222 return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
20255 return nk_button_image_styled(ctx, &ctx->style.button, img);
20291 return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
20336 return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
20755 /* update button */
21137 struct nk_rect button;
21138 button.y = bounds.y;
21139 button.w = bounds.h;
21140 button.h = bounds.h;
21142 /* decrement button */
21143 button.x = bounds.x;
21144 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
21148 /* increment button */
21149 button.x = (bounds.x + bounds.w) - button.w;
21150 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
21154 bounds.x = bounds.x + button.w + style->spacing.x;
21155 bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
21540 struct nk_rect button;
21542 button.x = scroll.x;
21543 button.w = scroll.w;
21544 button.h = scroll.w;
21546 scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
21549 /* decrement button */
21550 button.y = scroll.y;
21551 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
21555 /* increment button */
21556 button.y = scroll.y + scroll.h - button.h;
21557 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
21561 scroll.y = scroll.y + button.h;
21629 struct nk_rect button;
21630 button.y = scroll.y;
21631 button.w = scroll.h;
21632 button.h = scroll.h;
21634 scroll_w = scroll.w - 2 * button.w;
21637 /* decrement button */
21638 button.x = scroll.x;
21639 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
21643 /* increment button */
21644 button.x = scroll.x + scroll.w - button.w;
21645 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
21649 scroll.x = scroll.x + button.w;
23656 /* left decrement button */
23670 /* right increment button */
23724 /* execute right button */
23736 /* execute left button */
24639 struct nk_rect button;
24649 /* calculate button */
24650 button.w = header.h - 2 * style->combo.button_padding.y;
24651 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24652 button.y = header.y + style->combo.button_padding.y;
24653 button.h = button.w;
24655 content.x = button.x + style->combo.button.padding.x;
24656 content.y = button.y + style->combo.button.padding.y;
24657 content.w = button.w - 2 * style->combo.button.padding.x;
24658 content.h = button.h - 2 * style->combo.button.padding.y;
24664 label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;;
24669 /* draw open/close button */
24670 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
24671 &ctx->style.combo.button, sym, style->font);
24723 struct nk_rect button;
24733 /* calculate button */
24734 button.w = header.h - 2 * style->combo.button_padding.y;
24735 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24736 button.y = header.y + style->combo.button_padding.y;
24737 button.h = button.w;
24739 content.x = button.x + style->combo.button.padding.x;
24740 content.y = button.y + style->combo.button.padding.y;
24741 content.w = button.w - 2 * style->combo.button.padding.x;
24742 content.h = button.h - 2 * style->combo.button.padding.y;
24748 bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
24751 /* draw open/close button */
24752 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
24753 &ctx->style.combo.button, sym, style->font);
24810 struct nk_rect button;
24819 /* calculate button */
24820 button.w = header.h - 2 * style->combo.button_padding.y;
24821 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
24822 button.y = header.y + style->combo.button_padding.y;
24823 button.h = button.w;
24825 content.x = button.x + style->combo.button.padding.x;
24826 content.y = button.y + style->combo.button.padding.y;
24827 content.w = button.w - 2 * style->combo.button.padding.x;
24828 content.h = button.h - 2 * style->combo.button.padding.y;
24834 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
24838 /* draw open/close button */
24840 &ctx->style.combo.button, sym, style->font);
24898 struct nk_rect button;
24909 /* calculate button */
24910 button.w = header.h - 2 * style->combo.button_padding.y;
24911 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24912 button.y = header.y + style->combo.button_padding.y;
24913 button.h = button.w;
24915 content.x = button.x + style->combo.button.padding.x;
24916 content.y = button.y + style->combo.button.padding.y;
24917 content.w = button.w - 2 * style->combo.button.padding.x;
24918 content.h = button.h - 2 * style->combo.button.padding.y;
24919 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
24920 &ctx->style.combo.button, sym, style->font);
24934 label.w = (button.x - style->combo.content_padding.x) - label.x;
24984 struct nk_rect button;
24993 /* calculate button */
24994 button.w = header.h - 2 * style->combo.button_padding.y;
24995 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
24996 button.y = header.y + style->combo.button_padding.y;
24997 button.h = button.w;
24999 content.x = button.x + style->combo.button.padding.x;
25000 content.y = button.y + style->combo.button.padding.y;
25001 content.w = button.w - 2 * style->combo.button.padding.x;
25002 content.h = button.h - 2 * style->combo.button.padding.y;
25008 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
25011 /* draw open/close button */
25013 &ctx->style.combo.button, sym, style->font);
25067 struct nk_rect button;
25078 /* calculate button */
25079 button.w = header.h - 2 * style->combo.button_padding.y;
25080 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
25081 button.y = header.y + style->combo.button_padding.y;
25082 button.h = button.w;
25084 content.x = button.x + style->combo.button.padding.x;
25085 content.y = button.y + style->combo.button.padding.y;
25086 content.w = button.w - 2 * style->combo.button.padding.x;
25087 content.h = button.h - 2 * style->combo.button.padding.y;
25088 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
25089 &ctx->style.combo.button, sym, style->font);
25102 label.w = (button.x - style->combo.content_padding.x) - label.x;
25601 /// - 2016/09/20 (1.22.2) - Fixed color button size calculation.
25654 /// - 2016/08/30 (1.13.2) - Fixed close and minimize button which would fire even if the
25750 /// - 2016/07/15 (1.00.0) - Changed button API to use context dependend button