2#include "nuklear_internal.h"
20 NK_ASSERT(ctx->current);
21 NK_ASSERT(ctx->current->layout);
22 if (!ctx || !ctx->current || !ctx->current->layout)
25 popup = win->popup.win;
28 body.y = header.y + header.h-ctx->style.window.combo_border;
31 hash = win->popup.combo_count++;
32 is_open = (popup) ? nk_true:nk_false;
33 is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_COMBO);
34 if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
35 (!is_open && !is_active && !is_clicked))
return 0;
36 if (!nk_nonblock_begin(ctx, 0, body,
37 (is_clicked && is_open)?
nk_rect(0,0,0,0):header, NK_PANEL_COMBO)) return 0;
39 win->popup.type = NK_PANEL_COMBO;
40 win->popup.name = hash;
44nk_combo_begin_text(
struct nk_context *ctx,
const char *selected,
int len,
52 int is_clicked = nk_false;
59 NK_ASSERT(ctx->current);
60 NK_ASSERT(ctx->current->layout);
61 if (!ctx || !ctx->current || !ctx->current->layout || !selected)
66 s = nk_widget(&header, ctx);
71 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
76 background = &style->combo.active;
77 text.text = style->combo.label_active;
79 background = &style->combo.hover;
80 text.text = style->combo.label_hover;
82 background = &style->combo.normal;
83 text.text = style->combo.label_normal;
86 text.text = nk_rgb_factor(text.text, style->combo.color_factor);
88 switch(background->type) {
89 case NK_STYLE_ITEM_IMAGE:
90 text.background = nk_rgba(0, 0, 0, 0);
91 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
93 case NK_STYLE_ITEM_NINE_SLICE:
94 text.background = nk_rgba(0, 0, 0, 0);
95 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
97 case NK_STYLE_ITEM_COLOR:
98 text.background = background->data.color;
99 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
100 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
108 int draw_button_symbol;
110 enum nk_symbol_type sym;
112 sym = style->combo.sym_hover;
114 sym = style->combo.sym_active;
116 sym = style->combo.sym_normal;
119 draw_button_symbol = sym != NK_SYMBOL_NONE;
122 button.w = header.h - 2 * style->combo.button_padding.y;
123 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
124 button.y = header.y + style->combo.button_padding.y;
127 content.x = button.x + style->combo.button.padding.x;
128 content.y = button.y + style->combo.button.padding.y;
129 content.w = button.w - 2 * style->combo.button.padding.x;
130 content.h = button.h - 2 * style->combo.button.padding.y;
134 label.x = header.x + style->combo.content_padding.x;
135 label.y = header.y + style->combo.content_padding.y;
136 label.h = header.h - 2 * style->combo.content_padding.y;
137 if (draw_button_symbol)
138 label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;
140 label.w = header.w - 2 * style->combo.content_padding.x;
141 nk_widget_text(&win->buffer, label, selected, len, &text,
142 NK_TEXT_LEFT, ctx->style.font);
145 if (draw_button_symbol)
146 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
147 &ctx->style.combo.button, sym, style->font);
149 return nk_combo_begin(ctx, win, size, is_clicked, header);
152nk_combo_begin_label(
struct nk_context *ctx,
const char *selected,
struct nk_vec2 size)
154 return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size);
164 int is_clicked = nk_false;
169 NK_ASSERT(ctx->current);
170 NK_ASSERT(ctx->current->layout);
171 if (!ctx || !ctx->current || !ctx->current->layout)
176 s = nk_widget(&header, ctx);
181 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
182 is_clicked = nk_true;
186 background = &style->combo.active;
188 background = &style->combo.hover;
189 else background = &style->combo.normal;
191 switch(background->type) {
192 case NK_STYLE_ITEM_IMAGE:
193 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
195 case NK_STYLE_ITEM_NINE_SLICE:
196 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
198 case NK_STYLE_ITEM_COLOR:
199 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
200 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
207 int draw_button_symbol;
209 enum nk_symbol_type sym;
211 sym = style->combo.sym_hover;
213 sym = style->combo.sym_active;
214 else sym = style->combo.sym_normal;
217 draw_button_symbol = sym != NK_SYMBOL_NONE;
220 button.w = header.h - 2 * style->combo.button_padding.y;
221 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
222 button.y = header.y + style->combo.button_padding.y;
225 content.x = button.x + style->combo.button.padding.x;
226 content.y = button.y + style->combo.button.padding.y;
227 content.w = button.w - 2 * style->combo.button.padding.x;
228 content.h = button.h - 2 * style->combo.button.padding.y;
231 bounds.h = header.h - 4 * style->combo.content_padding.y;
232 bounds.y = header.y + 2 * style->combo.content_padding.y;
233 bounds.x = header.x + 2 * style->combo.content_padding.x;
234 if (draw_button_symbol)
235 bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
237 bounds.w = header.w - 4 * style->combo.content_padding.x;
238 nk_fill_rect(&win->buffer, bounds, 0, nk_rgb_factor(color, style->combo.color_factor));
241 if (draw_button_symbol)
242 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
243 &ctx->style.combo.button, sym, style->font);
245 return nk_combo_begin(ctx, win, size, is_clicked, header);
248nk_combo_begin_symbol(
struct nk_context *ctx,
enum nk_symbol_type symbol,
struct nk_vec2 size)
255 int is_clicked = nk_false;
262 NK_ASSERT(ctx->current);
263 NK_ASSERT(ctx->current->layout);
264 if (!ctx || !ctx->current || !ctx->current->layout)
269 s = nk_widget(&header, ctx);
274 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
275 is_clicked = nk_true;
279 background = &style->combo.active;
280 symbol_color = style->combo.symbol_active;
282 background = &style->combo.hover;
283 symbol_color = style->combo.symbol_hover;
285 background = &style->combo.normal;
286 symbol_color = style->combo.symbol_hover;
289 symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor);
291 switch(background->type) {
292 case NK_STYLE_ITEM_IMAGE:
293 sym_background = nk_rgba(0, 0, 0, 0);
294 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
296 case NK_STYLE_ITEM_NINE_SLICE:
297 sym_background = nk_rgba(0, 0, 0, 0);
298 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
300 case NK_STYLE_ITEM_COLOR:
301 sym_background = background->data.color;
302 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
303 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
307 struct nk_rect bounds = {0,0,0,0};
311 enum nk_symbol_type sym;
313 sym = style->combo.sym_hover;
315 sym = style->combo.sym_active;
316 else sym = style->combo.sym_normal;
319 button.w = header.h - 2 * style->combo.button_padding.y;
320 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
321 button.y = header.y + style->combo.button_padding.y;
324 content.x = button.x + style->combo.button.padding.x;
325 content.y = button.y + style->combo.button.padding.y;
326 content.w = button.w - 2 * style->combo.button.padding.x;
327 content.h = button.h - 2 * style->combo.button.padding.y;
330 bounds.h = header.h - 2 * style->combo.content_padding.y;
331 bounds.y = header.y + style->combo.content_padding.y;
332 bounds.x = header.x + style->combo.content_padding.x;
333 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
334 nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color,
338 nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
339 &ctx->style.combo.button, sym, style->font);
341 return nk_combo_begin(ctx, win, size, is_clicked, header);
344nk_combo_begin_symbol_text(
struct nk_context *ctx,
const char *selected,
int len,
345 enum nk_symbol_type symbol,
struct nk_vec2 size)
352 int is_clicked = nk_false;
359 NK_ASSERT(ctx->current);
360 NK_ASSERT(ctx->current->layout);
361 if (!ctx || !ctx->current || !ctx->current->layout)
366 s = nk_widget(&header, ctx);
370 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
371 is_clicked = nk_true;
375 background = &style->combo.active;
376 symbol_color = style->combo.symbol_active;
377 text.text = style->combo.label_active;
379 background = &style->combo.hover;
380 symbol_color = style->combo.symbol_hover;
381 text.text = style->combo.label_hover;
383 background = &style->combo.normal;
384 symbol_color = style->combo.symbol_normal;
385 text.text = style->combo.label_normal;
388 text.text = nk_rgb_factor(text.text, style->combo.color_factor);
389 symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor);
391 switch(background->type) {
392 case NK_STYLE_ITEM_IMAGE:
393 text.background = nk_rgba(0, 0, 0, 0);
394 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
396 case NK_STYLE_ITEM_NINE_SLICE:
397 text.background = nk_rgba(0, 0, 0, 0);
398 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
400 case NK_STYLE_ITEM_COLOR:
401 text.background = background->data.color;
402 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
403 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
412 enum nk_symbol_type sym;
414 sym = style->combo.sym_hover;
416 sym = style->combo.sym_active;
417 else sym = style->combo.sym_normal;
420 button.w = header.h - 2 * style->combo.button_padding.y;
421 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
422 button.y = header.y + style->combo.button_padding.y;
425 content.x = button.x + style->combo.button.padding.x;
426 content.y = button.y + style->combo.button.padding.y;
427 content.w = button.w - 2 * style->combo.button.padding.x;
428 content.h = button.h - 2 * style->combo.button.padding.y;
429 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
430 &ctx->style.combo.button, sym, style->font);
433 image.x = header.x + style->combo.content_padding.x;
434 image.y = header.y + style->combo.content_padding.y;
435 image.h = header.h - 2 * style->combo.content_padding.y;
437 nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color,
442 label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
443 label.y = header.y + style->combo.content_padding.y;
444 label.w = (button.x - style->combo.content_padding.x) - label.x;
445 label.h = header.h - 2 * style->combo.content_padding.y;
446 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
448 return nk_combo_begin(ctx, win, size, is_clicked, header);
458 int is_clicked = nk_false;
463 NK_ASSERT(ctx->current);
464 NK_ASSERT(ctx->current->layout);
465 if (!ctx || !ctx->current || !ctx->current->layout)
470 s = nk_widget(&header, ctx);
475 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
476 is_clicked = nk_true;
480 background = &style->combo.active;
482 background = &style->combo.hover;
483 else background = &style->combo.normal;
485 switch (background->type) {
486 case NK_STYLE_ITEM_IMAGE:
487 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
489 case NK_STYLE_ITEM_NINE_SLICE:
490 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
492 case NK_STYLE_ITEM_COLOR:
493 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
494 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
498 struct nk_rect bounds = {0,0,0,0};
501 int draw_button_symbol;
503 enum nk_symbol_type sym;
505 sym = style->combo.sym_hover;
507 sym = style->combo.sym_active;
508 else sym = style->combo.sym_normal;
511 draw_button_symbol = sym != NK_SYMBOL_NONE;
514 button.w = header.h - 2 * style->combo.button_padding.y;
515 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
516 button.y = header.y + style->combo.button_padding.y;
519 content.x = button.x + style->combo.button.padding.x;
520 content.y = button.y + style->combo.button.padding.y;
521 content.w = button.w - 2 * style->combo.button.padding.x;
522 content.h = button.h - 2 * style->combo.button.padding.y;
525 bounds.h = header.h - 2 * style->combo.content_padding.y;
526 bounds.y = header.y + style->combo.content_padding.y;
527 bounds.x = header.x + style->combo.content_padding.x;
528 if (draw_button_symbol)
529 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
531 bounds.w = header.w - 2 * style->combo.content_padding.x;
532 nk_draw_image(&win->buffer, bounds, &img, nk_rgb_factor(nk_white, style->combo.color_factor));
535 if (draw_button_symbol)
536 nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
537 &ctx->style.combo.button, sym, style->font);
539 return nk_combo_begin(ctx, win, size, is_clicked, header);
542nk_combo_begin_image_text(
struct nk_context *ctx,
const char *selected,
int len,
550 int is_clicked = nk_false;
556 NK_ASSERT(ctx->current);
557 NK_ASSERT(ctx->current->layout);
558 if (!ctx || !ctx->current || !ctx->current->layout)
563 s = nk_widget(&header, ctx);
567 if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
568 is_clicked = nk_true;
572 background = &style->combo.active;
573 text.text = style->combo.label_active;
575 background = &style->combo.hover;
576 text.text = style->combo.label_hover;
578 background = &style->combo.normal;
579 text.text = style->combo.label_normal;
582 text.text = nk_rgb_factor(text.text, style->combo.color_factor);
584 switch(background->type) {
585 case NK_STYLE_ITEM_IMAGE:
586 text.background = nk_rgba(0, 0, 0, 0);
587 nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
589 case NK_STYLE_ITEM_NINE_SLICE:
590 text.background = nk_rgba(0, 0, 0, 0);
591 nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
593 case NK_STYLE_ITEM_COLOR:
594 text.background = background->data.color;
595 nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
596 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
604 int draw_button_symbol;
606 enum nk_symbol_type sym;
608 sym = style->combo.sym_hover;
610 sym = style->combo.sym_active;
611 else sym = style->combo.sym_normal;
614 draw_button_symbol = sym != NK_SYMBOL_NONE;
617 button.w = header.h - 2 * style->combo.button_padding.y;
618 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
619 button.y = header.y + style->combo.button_padding.y;
622 content.x = button.x + style->combo.button.padding.x;
623 content.y = button.y + style->combo.button.padding.y;
624 content.w = button.w - 2 * style->combo.button.padding.x;
625 content.h = button.h - 2 * style->combo.button.padding.y;
626 if (draw_button_symbol)
627 nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
628 &ctx->style.combo.button, sym, style->font);
631 image.x = header.x + style->combo.content_padding.x;
632 image.y = header.y + style->combo.content_padding.y;
633 image.h = header.h - 2 * style->combo.content_padding.y;
635 nk_draw_image(&win->buffer, image, &img, nk_rgb_factor(nk_white, style->combo.color_factor));
639 label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
640 label.y = header.y + style->combo.content_padding.y;
641 label.h = header.h - 2 * style->combo.content_padding.y;
642 if (draw_button_symbol)
643 label.w = (button.x - style->combo.content_padding.x) - label.x;
645 label.w = (header.x + header.w - style->combo.content_padding.x) - label.x;
646 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
648 return nk_combo_begin(ctx, win, size, is_clicked, header);
651nk_combo_begin_symbol_label(
struct nk_context *ctx,
652 const char *selected,
enum nk_symbol_type type,
struct nk_vec2 size)
654 return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size);
657nk_combo_begin_image_label(
struct nk_context *ctx,
660 return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size);
663nk_combo_item_text(
struct nk_context *ctx,
const char *text,
int len,nk_flags align)
665 return nk_contextual_item_text(ctx, text, len, align);
668nk_combo_item_label(
struct nk_context *ctx,
const char *label, nk_flags align)
670 return nk_contextual_item_label(ctx, label, align);
673nk_combo_item_image_text(
struct nk_context *ctx,
struct nk_image img,
const char *text,
674 int len, nk_flags alignment)
676 return nk_contextual_item_image_text(ctx, img, text, len, alignment);
680 const char *text, nk_flags alignment)
682 return nk_contextual_item_image_label(ctx, img, text, alignment);
685nk_combo_item_symbol_text(
struct nk_context *ctx,
enum nk_symbol_type sym,
686 const char *text,
int len, nk_flags alignment)
688 return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);
691nk_combo_item_symbol_label(
struct nk_context *ctx,
enum nk_symbol_type sym,
692 const char *label, nk_flags alignment)
694 return nk_contextual_item_symbol_label(ctx, sym, label, alignment);
696NK_API
void nk_combo_end(
struct nk_context *ctx)
698 nk_contextual_end(ctx);
700NK_API
void nk_combo_close(
struct nk_context *ctx)
702 nk_contextual_close(ctx);
705nk_combo(
struct nk_context *ctx,
const char *
const *items,
int count,
706 int selected,
int item_height,
struct nk_vec2 size)
715 NK_ASSERT(ctx->current);
716 if (!ctx || !items ||!count)
719 item_spacing = ctx->style.window.spacing;
720 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
721 max_height = count * item_height + count * (int)item_spacing.y;
722 max_height += (int)item_spacing.y * 2 + (
int)window_padding.y * 2;
723 size.y = NK_MIN(size.y, (
float)max_height);
724 if (nk_combo_begin_label(ctx, items[selected], size)) {
726 for (i = 0; i < count; ++i) {
727 if (nk_combo_item_label(ctx, items[i], NK_TEXT_LEFT))
735nk_combo_separator(
struct nk_context *ctx,
const char *items_separated_by_separator,
736 int separator,
int selected,
int count,
int item_height,
struct nk_vec2 size)
742 const char *current_item;
747 NK_ASSERT(items_separated_by_separator);
748 if (!ctx || !items_separated_by_separator)
752 item_spacing = ctx->style.window.spacing;
753 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
754 max_height = count * item_height + count * (int)item_spacing.y;
755 max_height += (int)item_spacing.y * 2 + (
int)window_padding.y * 2;
756 size.y = NK_MIN(size.y, (
float)max_height);
759 current_item = items_separated_by_separator;
760 for (i = 0; i < count; ++i) {
762 while (*iter && *iter != separator) iter++;
763 length = (int)(iter - current_item);
764 if (i == selected)
break;
765 current_item = iter + 1;
768 if (nk_combo_begin_text(ctx, current_item, length, size)) {
769 current_item = items_separated_by_separator;
771 for (i = 0; i < count; ++i) {
773 while (*iter && *iter != separator) iter++;
774 length = (int)(iter - current_item);
775 if (nk_combo_item_text(ctx, current_item, length, NK_TEXT_LEFT))
777 current_item = current_item + length + 1;
784nk_combo_string(
struct nk_context *ctx,
const char *items_separated_by_zeros,
785 int selected,
int count,
int item_height,
struct nk_vec2 size)
787 return nk_combo_separator(ctx, items_separated_by_zeros,
'\0', selected, count, item_height, size);
790nk_combo_callback(
struct nk_context *ctx,
void(*item_getter)(
void*,
int,
const char**),
791 void *userdata,
int selected,
int count,
int item_height,
struct nk_vec2 size)
800 NK_ASSERT(item_getter);
801 if (!ctx || !item_getter)
805 item_spacing = ctx->style.window.spacing;
806 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
807 max_height = count * item_height + count * (int)item_spacing.y;
808 max_height += (int)item_spacing.y * 2 + (
int)window_padding.y * 2;
809 size.y = NK_MIN(size.y, (
float)max_height);
811 item_getter(userdata, selected, &item);
812 if (nk_combo_begin_label(ctx, item, size)) {
814 for (i = 0; i < count; ++i) {
815 item_getter(userdata, i, &item);
816 if (nk_combo_item_label(ctx, item, NK_TEXT_LEFT))
823nk_combobox(
struct nk_context *ctx,
const char *
const *items,
int count,
824 int *selected,
int item_height,
struct nk_vec2 size)
826 *selected = nk_combo(ctx, items, count, *selected, item_height, size);
829nk_combobox_string(
struct nk_context *ctx,
const char *items_separated_by_zeros,
830 int *selected,
int count,
int item_height,
struct nk_vec2 size)
832 *selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);
835nk_combobox_separator(
struct nk_context *ctx,
const char *items_separated_by_separator,
836 int separator,
int *selected,
int count,
int item_height,
struct nk_vec2 size)
838 *selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
839 *selected, count, item_height, size);
843 void(*item_getter)(
void* data,
int id,
const char **out_text),
844 void *userdata,
int *selected,
int count,
int item_height,
struct nk_vec2 size)
846 *selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);
main API and documentation file
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
@ NK_WIDGET_INVALID
The widget cannot be seen and is completely out of view.