Lines Matching defs:text

134 /// NK_INPUT_MAX                    | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
677 /// mouse, key and text input states.
699 /// mouse motion, button and key pressed and released, text input and scrolling.
731 /// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer
732 /// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer
733 /// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer
751 /* Shortcuts: text field */
779 /// Begins the input mirroring process by resetting text, scroll
851 /// Copies a single ASCII character into an internal text buffer
870 /// internal text buffer.
887 /// into an internal text buffer.
933 /// filled and stroked rectangles, circles, text, lines, triangles and scissors.
3735 NK_API int nk_strfilter(const char *text, const char *regexp);
3765 do all the text drawing yourself and the library does not require any kind
3771 float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
3791 `nk_user_font`. First a texture atlas handle used to draw text as subimages
3796 float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
4160 /* Basic string buffer which is only used in context with the text editor
4216 /* Editing text in this library is handled by either `nk_edit_string` or
4224 * user text input. Main upside is complete control over memory while the biggest
4229 * This is mainly useful if you want something more like a text editor but don't want
4234 * allocator version if you do. While the text editor is quite powerful for its
4237 * an full blown text editor.
4310 /* text editor */
4591 NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color);
4622 char text[NK_INPUT_MAX];
4794 NK_API void nk_draw_list_add_text(struct nk_draw_list*, const struct nk_user_font*, struct nk_rect, const char *text, int len, float font_height, struct nk_color);
4833 /* text */
4864 /* text */
4894 /* text color (inactive) */
4899 /* text color (active) */
5030 /* text (unselected) */
5035 /* text (selected) */
5057 /* text */
5129 struct nk_color text;
5220 struct nk_style_text text;
5590 /* text editor objects are quite big because of an internal
5823 NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
5856 /* text editor */
5916 /* text */
5920 struct nk_color text;
5972 NK_LIB void nk_edit_draw_text(struct nk_command_buffer *out, const struct nk_style_edit *style, float pos_x, float pos_y, float x_offset, const char *text, int byte_len, float row_height, const struct nk_user_font *font, struct nk_color background, struct nk_color foreground, int is_selected);
6327 NK_INTERN int nk_str_match_here(const char *regexp, const char *text);
6328 NK_INTERN int nk_str_match_star(int c, const char *regexp, const char *text);
6593 nk_str_match_here(const char *regexp, const char *text)
6598 return nk_str_match_star(regexp[0], regexp+2, text);
6600 return *text == '\0';
6601 if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text))
6602 return nk_str_match_here(regexp+1, text+1);
6606 nk_str_match_star(int c, const char *regexp, const char *text)
6609 if (nk_str_match_here(regexp, text))
6611 } while (*text != '\0' && (*text++ == c || c == '.'));
6615 nk_strfilter(const char *text, const char *regexp)
6624 return nk_str_match_here(regexp+1, text);
6626 if (nk_str_match_here(regexp, text))
6628 } while (*text++ != '\0');
7330 nk_text_clamp(const struct nk_user_font *font, const char *text,
7348 glyph_len = nk_utf_decode(text, &unicode, text_len);
7351 s = font->width(font->userdata, font->height, text, len);
7364 glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
7940 const char *text;
7950 text = str;
7952 glyph_len = nk_utf_decode(text, &unicode, text_len);
7956 glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
7967 const char *text;
7981 text = buffer;
7983 glyph_len = nk_utf_decode(text, unicode, text_len);
7992 glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
8329 nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
8334 if (!str || !text || !len) return 0;
8336 byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
8337 nk_str_append_text_char(str, text, byte_len);
8341 nk_str_append_str_utf8(struct nk_str *str, const char *text)
8348 if (!str || !text) return 0;
8350 glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
8352 glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
8356 nk_str_append_text_char(str, text, byte_len);
8360 nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
8367 if (!str || !text || !len) return 0;
8369 byte_len = nk_utf_encode(text[i], glyph, NK_UTF_SIZE);
8445 nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
8447 return nk_str_insert_text_utf8(str, pos, text, len);
8450 nk_str_insert_str_char(struct nk_str *str, int pos, const char *text)
8452 return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text));
8455 nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
8462 NK_ASSERT(text);
8463 if (!str || !text || !len) return 0;
8465 byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
8466 nk_str_insert_at_rune(str, pos, text, byte_len);
8470 nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text)
8477 if (!str || !text) return 0;
8479 glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
8481 glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
8485 nk_str_insert_at_rune(str, pos, text, byte_len);
8604 char *text;
8618 text = (char*)str->buffer.memory.ptr;
8620 glyph_len = nk_utf_decode(text, unicode, text_len);
8629 glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
8632 return text + src_len;
8647 char *text;
8661 text = (char*)str->buffer.memory.ptr;
8663 glyph_len = nk_utf_decode(text, unicode, text_len);
8672 glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
8675 return text + src_len;
9185 /* make sure text fits inside bounds */
10340 struct nk_rect rect, const char *text, int len, float font_height,
10352 if (!list || !len || !text) return;
10358 glyph_len = nk_utf_decode(text, &unicode, len);
10369 next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len);
13007 nk_font_text_width(nk_handle handle, float height, const char *text, int len)
13018 if (!font || !text || !len)
13022 glyph_len = text_len = nk_utf_decode(text, &unicode, (int)len);
13033 glyph_len = nk_utf_decode(text + text_len, &unicode, (int)len - text_len);
14041 nk_utf_encode(unicode, &in->keyboard.text[in->keyboard.text_len],
14276 struct nk_style_text *text;
14295 /* default text */
14296 text = &style->text;
14297 text->color = table[NK_COLOR_TEXT];
14298 text->padding = nk_vec2(0,0);
14675 tab->text = table[NK_COLOR_TEXT];
15708 struct nk_text text;
15725 /* select correct header background and text color */
15728 text.text = style->window.header.label_active;
15731 text.text = style->window.header.label_hover;
15734 text.text = style->window.header.label_normal;
15740 text.background = nk_rgba(0,0,0,0);
15743 text.background = background->data.color;
15797 text.padding = nk_vec2(0,0);
15805 nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
17125 nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
17148 text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
17161 const char *text, int len, nk_flags align)
17183 img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
17197 const char *text, int len, nk_flags align)
17219 symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
17227 const char *text, nk_flags align)
17229 return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align);
17414 const char *text, nk_flags align, struct nk_vec2 size)
17416 return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size);
17550 const char *text, int len, nk_flags align)
17552 return nk_contextual_item_image_text(ctx, img, text, len, align);
17555 const char *text, int len, nk_flags align)
17557 return nk_contextual_item_symbol_text(ctx, sym, text, len, align);
17614 layout->row.min_height += ctx->style.text.padding.y*2;
18365 struct nk_text text;
18394 text.background = nk_rgba(0,0,0,0);
18396 text.background = background->data.color;
18401 } else text.background = style->window.background;
18443 text.text = style->tab.text;
18444 text.padding = nk_vec2(0,0);
18445 nk_widget_text(out, label, title, nk_strlen(title), &text,
18550 struct nk_text text;
18580 text.background = nk_rgba(0,0,0,0);
18582 text.background = background->data.color;
18587 } else text.background = style->window.background;
18614 /* calculate size of the text and tooltip */
19301 nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text);
19313 struct nk_text text;
19320 text.padding = nk_vec2(0,0);
19321 text.background = t->background;
19322 text.text = t->text;
19336 nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f);
19351 struct nk_text text;
19361 item_padding = style->text.padding;
19363 text.padding.x = item_padding.x;
19364 text.padding.y = item_padding.y;
19365 text.background = style->window.background;
19366 text.text = color;
19367 nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
19378 struct nk_text text;
19388 item_padding = style->text.padding;
19390 text.padding.x = item_padding.x;
19391 text.padding.y = item_padding.y;
19392 text.background = style->window.background;
19393 text.text = color;
19394 nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
19511 nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
19518 nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
19702 /* single character text symbol */
19706 struct nk_text text;
19707 text.padding = nk_vec2(0,0);
19708 text.background = background;
19709 text.text = foreground;
19710 nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font);
19823 struct nk_text text;
19829 text.background = background->data.color;
19830 else text.background = style->text_background;
19832 text.text = style->text_hover;
19834 text.text = style->text_active;
19835 else text.text = style->text_normal;
19837 text.padding = nk_vec2(0,0);
19838 nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
19951 struct nk_text text;
19957 text.background = background->data.color;
19958 else text.background = style->text_background;
19960 /* select correct text colors */
19963 text.text = style->text_hover;
19966 text.text = style->text_active;
19969 text.text = style->text_normal;
19972 text.padding = nk_vec2(0,0);
19974 nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
20015 struct nk_text text;
20021 text.background = background->data.color;
20022 else text.background = style->text_background;
20024 text.text = style->text_hover;
20026 text.text = style->text_active;
20027 else text.text = style->text_normal;
20029 text.padding = nk_vec2(0,0);
20030 nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
20260 const char *text, int len, nk_flags align)
20282 symbol, text, len, align, ctx->button_behavior,
20287 const char* text, int len, nk_flags align)
20291 return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
20306 const struct nk_style_button *style, struct nk_image img, const char *text,
20329 bounds, img, text, len, align, ctx->button_behavior,
20334 const char *text, int len, nk_flags align)
20336 return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
20383 struct nk_text text;
20389 text.text = style->text_hover;
20393 text.text = style->text_active;
20397 text.text = style->text_normal;
20411 text.padding.x = 0;
20412 text.padding.y = 0;
20413 text.background = style->text_background;
20414 nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
20425 struct nk_text text;
20431 text.text = style->text_hover;
20435 text.text = style->text_active;
20439 text.text = style->text_normal;
20453 text.padding.x = 0;
20454 text.padding.y = 0;
20455 text.background = style->text_background;
20456 nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
20526 nk_check_text(struct nk_context *ctx, const char *text, int len, int active)
20550 text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
20554 nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
20559 NK_ASSERT(text);
20560 if (!ctx || !text) return flags;
20562 if (nk_check_text(ctx, text, len, old_active))
20568 nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active)
20572 NK_ASSERT(text);
20574 if (!ctx || !text || !active) return 0;
20576 *active = nk_check_text(ctx, text, len, *active);
20580 nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
20585 NK_ASSERT(text);
20587 if (!ctx || !text || !flags) return 0;
20590 if (nk_checkbox_text(ctx, text, len, &active)) {
20621 nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active)
20645 text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
20649 nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active)
20653 NK_ASSERT(text);
20655 if (!ctx || !text || !active) return 0;
20657 *active = nk_option_text(ctx, text, len, old_value);
20688 struct nk_text text;
20689 text.padding = style->padding;
20695 text.text = style->text_pressed;
20698 text.text = style->text_hover;
20701 text.text = style->text_normal;
20706 text.text = style->text_pressed_active;
20709 text.text = style->text_hover_active;
20712 text.text = style->text_normal_active;
20715 /* draw selectable background and text */
20718 text.background = nk_rgba(0,0,0,0);
20721 text.background = background->data.color;
20725 else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font);
20727 nk_widget_text(out, *bounds, string, len, &text, align, font);
21741 const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l);
21743 text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE);
21781 /* below all text, return 'after' last character */
22024 /* API paste: replace existing selection with passed-in text */
22026 const char *text = (const char *) ctext;
22035 if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
22047 nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
22054 NK_ASSERT(text);
22055 if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;
22057 glyph_len = nk_utf_decode(text, &unicode, total_len);
22064 /* filter incoming text */
22075 text+text_len, 1))
22083 text+text_len, 1))
22092 glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
22793 float x_offset, const char *text, int byte_len, float row_height,
22800 if (!text || !byte_len || !out || !style) return;
22807 const char *line = text;
22814 txt.text = foreground;
22816 glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
22832 nk_widget_text(out, label, line, (int)((text + text_len) - line),
22838 line = text + text_len;
22840 glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
22845 glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
22848 glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
22851 glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
22866 nk_widget_text(out, label, line, (int)((text + text_len) - line),
22892 /* visible text area calculation */
22913 /* (de)activate text editor */
22972 /* text input */
22975 nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len);
22997 const char *text;
23003 text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len);
23005 edit->clip.copy(edit->clip.userdata, text, end - begin);
23036 {const char *text = nk_str_get_const(&edit->string);
23059 /* text pointer positions */
23074 if (text && len)
23084 glyph_len = nk_utf_decode(text, &unicode, len);
23085 glyph_width = font->width(font->userdata, font->height, text, glyph_len);
23101 row_size = nk_text_calculate_text_bounds(font, text+row_begin,
23105 cursor_ptr = text + text_len;
23119 row_size = nk_text_calculate_text_bounds(font, text+row_begin,
23123 select_begin_ptr = text + text_len;
23137 row_size = nk_text_calculate_text_bounds(font, text+row_begin,
23141 select_end_ptr = text + text_len;
23150 glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
23151 glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
23159 glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
23161 text+text_len, glyph_len);
23166 /* handle case when cursor is at end of text buffer */
23219 /* draw text */
23258 /* no selection so just draw the complete text */
23265 /* edit has selection so draw 1-3 text chunks */
23267 /* draw unselected text before selection */
23275 /* draw selected text */
23291 /* draw unselected text after selected text */
23319 /* draw cursor inside text */
23335 txt.text = cursor_text_color;
23341 /* not active so just draw text */
23598 struct nk_text text;
23601 /* select correct background and text color */
23604 text.text = style->label_active;
23607 text.text = style->label_hover;
23610 text.text = style->label_normal;
23616 text.background = nk_rgba(0,0,0,0);
23618 text.background = background->data.color;
23624 text.padding = nk_vec2(0,0);
23625 nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
23662 /* text label */
23758 /* execute and run text edit field */
23781 /* property is now not active so convert edit text to value*/
24598 struct nk_text text;
24620 text.text = style->combo.label_active;
24623 text.text = style->combo.label_hover;
24626 text.text = style->combo.label_normal;
24629 text.background = nk_rgba(0,0,0,0);
24632 text.background = background->data.color;
24637 /* print currently selected text item */
24661 text.padding = nk_vec2(0,0);
24666 nk_widget_text(&win->buffer, label, selected, len, &text,
24857 struct nk_text text;
24878 text.text = style->combo.label_active;
24882 text.text = style->combo.label_hover;
24886 text.text = style->combo.label_normal;
24889 text.background = nk_rgba(0,0,0,0);
24892 text.background = background->data.color;
24927 nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color,
24931 text.padding = nk_vec2(0,0);
24936 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
25029 struct nk_text text;
25049 text.text = style->combo.label_active;
25052 text.text = style->combo.label_hover;
25055 text.text = style->combo.label_normal;
25058 text.background = nk_rgba(0,0,0,0);
25061 text.background = background->data.color;
25099 text.padding = nk_vec2(0,0);
25104 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
25121 nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
25123 return nk_contextual_item_text(ctx, text, len, align);
25131 nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text,
25134 return nk_contextual_item_image_text(ctx, img, text, len, alignment);
25138 const char *text, nk_flags alignment)
25140 return nk_contextual_item_image_label(ctx, img, text, alignment);
25144 const char *text, int len, nk_flags alignment)
25146 return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);
25366 nk_tooltip(struct nk_context *ctx, const char *text)
25378 NK_ASSERT(text);
25379 if (!ctx || !ctx->current || !ctx->current->layout || !text)
25386 /* calculate size of the text and tooltip */
25387 text_len = nk_strlen(text);
25389 style->font->height, text, text_len);
25393 /* execute tooltip and fill with text */
25396 nk_text(ctx, text, text_len, NK_TEXT_LEFT);
25534 /// - 2017/06/08 (1.39.1) - Fixed property text edit handling bug caused by past `nk_widget` fix.
25552 /// - 2017/03/04 (1.34.2) - Fixed text edit filtering.
25564 /// - 2016/12/03 (1.29.1) - Fixed wrapped text with no seperator and C89 error.
25565 /// - 2016/12/03 (1.29.0) - Changed text wrapping to process words not characters.
25594 /// - 2016/09/29 (1.22.6) - Fixed edit widget UTF-8 text cursor drawing bug.
25595 /// - 2016/09/28 (1.22.5) - Fixed edit widget UTF-8 text appending/inserting/removing.
25596 /// - 2016/09/28 (1.22.4) - Fixed drawing bug inside edit widgets which offset all text
25597 /// text in every edit widget if one of them is scrolled.
25599 /// text length is passed. It should have been in bytes but