Commit Graph

233 Commits

Author SHA1 Message Date
Cong
7134bf73b5 Fix unary operator clang warning 2017-03-12 22:43:18 +11:00
Micha Mettke
e6a6fe5b21 fixed #363 wrong example in documentation 2017-03-09 10:50:30 +01:00
vurtun
d5ea545a2b Hopefully fixed #362 text input filtering 2017-03-04 13:56:40 +01:00
vurtun
284772c00d fixed #361 group closable window flag 2017-03-04 13:10:33 +01:00
vurtun
e5c1cf9d70 Cleaned up custom draw commands to better fit
Had to change some small things to make everything work for a
general case instead of vertex draw list only. Furthermore I
don't want a custom widget inside nuklear so I removed it.
Feel free to add it back into your own version.
2017-02-25 22:50:37 +01:00
ClaasJG
4c25cd34f5 Added a new command type: NK_COMMAND_CUSTOM
Added a new command type 'NK_COMMAND_CUSTOM'.
A custom command contains a callback that will be called to fill the draw list.

Usage: 
static void custom_convert(struct nk_draw_list *list,
    short x, short y, unsigned short w, unsigned short h,
    nk_handle callback_data){/*Fill draw list.*/}

[...]nk_begin[...]
nk_custom(ctx, customConvert, nk_handle_id(0));

The handle can be used to pass data.
2017-02-25 14:13:08 +01:00
vurtun
064e31f3db Added assert to prevent group with closable flag 2017-02-24 19:18:42 +01:00
Anton Bondarev
aac2d71740 Make NK_API 'static inline' for NK_PRIVATE version
Fixed definition for C89 standard
2017-02-13 13:39:56 +03:00
Anton Bondarev
6fa8424d6e Make NK_API 'static inline' for NK_PRIVATE version 2017-02-06 16:43:33 +03:00
Dmitry Hrabrov
9cd5d035c3 Remove warning "unsigned only in ISO C90"
These warnings appear on GCC for Windows only. There a lot of them. Doesn't matter, native compilation or crosscompile.
`nuklear.h:6836:9: warning: this decimal constant is unsigned only in ISO C90`
2017-01-30 15:57:28 +03:00
vurtun
ef2dcd3b77 Added function to remove edit focus #321 2017-01-24 23:06:59 +01:00
Micha Mettke
3123ba0167 Merge pull request #330 from DeXP/master
Remove warning: 'nk_to_upper' defined but not used
2017-01-24 22:28:13 +01:00
vurtun
f5447a8406 Fixed typo _WIN64 instead of __WIN64
This is one of these highly embarassing typos I completly missed for a
long time.
2017-01-24 22:18:45 +01:00
Dmitry Hrabrov
7d52c0de67 Remove warning: 'nk_to_upper' defined but not used
There is function `NK_INTERN int nk_to_upper(int c)` in `UTIL` section. Implementation is almost the same to `NK_INTERN int nk_to_lower(int c)`. But only `nk_to_lower` used in Nuklear's code. To remove this warning we can: 
1) Comment i.e. remove `nk_to_upper` from code. But it can break someone's code, if he used it in module with `NK_IMPLEMENTATION` defined.
2) Hide it under define. Same. 
3) Just use it somewhere in code. 
I replaced two calls of `nk_to_lower` to `nk_to_upper`. It removes the warning, code works the same. The bad side - complication of the code. "Why `nk_to_upper` is used here, but not `nk_to_lower` as one line up?"
Maybe there exists better solution? Or just add the comment about this line to code?
2017-01-23 11:02:20 +03:00
Dmitry Hrabrov
36c60548a6 Remove unused panel warnings
When NDEBUG defined:
nuklear.h: In function 'nk_popup_begin':
nuklear.h:20753:22: warning: variable 'panel' set but not used [-Wunused-but-set-variable]
nuklear.h: In function 'nk_nonblock_begin':
nuklear.h:20850:22: warning: variable 'panel' set but not used [-Wunused-but-set-variable]
2017-01-22 16:00:28 +03:00
vurtun
3a7486cb35 Extended assert explanation #301 2016-12-20 20:45:36 +01:00
vurtun
ca1c9b3275 Fixed text wrapping without seperator 2016-12-03 18:52:24 +01:00
vurtun
ebe516c37b Text wrap now splits words not characters #292 2016-12-03 14:16:10 +01:00
vurtun
a16877b5b8 Fixed minimized window closing bug #266 2016-11-22 18:16:26 +01:00
Micha Mettke
19fd6221f9 Merge pull request #286 from nsawa/fix__missing_init_of_popup_border
fix: popup border is not shown when using the default style settings
2016-11-20 11:24:27 +01:00
vurtun
6a374eabb1 Fixed abstract comobox closing behavior #282 2016-11-19 20:31:47 +01:00
vurtun
c490e80f01 Fixed tooltip flickering #278 2016-11-19 19:43:44 +01:00
vurtun
e7c06e027a fixed memory leak caused by repeated popup closing 2016-11-19 10:40:20 +01:00
vurtun
e229856391 Fixed memory leak caused by popup panmel alloc 2016-11-18 18:30:18 +01:00
Naoyuki Sawa
a7283af069 fix: popup border is not shown when using the default style settings 2016-11-16 11:32:33 +09:00
Kevin Harrison
40ea365aa9 Fix edit cursor movement and text overflow 2016-11-14 14:44:10 -05:00
vurtun
c61d4f063c Fixed edit multiline widget width calculation 2016-11-14 19:21:49 +01:00
vurtun
d26ff34448 Fixed small edit widget box width calculation 2016-11-14 19:11:18 +01:00
vurtun
f2b9b9a586 Allow NK_API to be overwritten #281 2016-11-13 08:21:00 +01:00
Naoyuki Sawa
344f121468 fix: using nk_layout_row_begin() with NK_STATIC makes incorrect layout 2016-11-11 17:40:01 +09:00
vurtun
02fb019374 Fixed warnings and C++ error #279 2016-11-11 06:43:54 +01:00
vurtun
1acb7ba283 Added additional nk_tree version
Added another version of `nk_tree` that does not store internal state
to hold the tree state (minimized/maximized). Main advantages is
possibily less memory consumptions and more user control.
In addition a new set of button overloads were added to directly pass
in a button style struct which allows an easier way to have custom
button visuals for specific buttons.
2016-11-10 19:17:27 +01:00
vurtun
42efd8214f Added addition nk_group and new nk_list_view
Added additional `nk_group` version which uses an external scrollbar
offset instead of internally managing the memory. In addition
`nk_list_view` is introduced which allows drawing huge lists inside a
`nk_group`(#269).
2016-11-09 20:46:07 +01:00
Naoyuki Sawa
ebed2e6c0c fix: nk_value_color_hex() showed incorrect value. 2016-11-05 17:15:04 +09:00
Micha Mettke
18bacf0d8c Merge pull request #274 from nsawa/fix__nk_hsva_f
fix: nk_hsva_f() lacked processing for quadrant 3
2016-11-03 20:09:30 +01:00
Naoyuki Sawa
bb7ffc4c49 fix: nk_hsva_f() lacked processing for quadrant 3 2016-11-03 16:11:45 +09:00
Naoyuki Sawa
329dacd6ef fix: nk_value_color_byte() shows incorrect text 2016-11-03 14:39:50 +09:00
Naoyuki Sawa
bb2cd9a58c bugfix: nk_combo_separator showed incorrect item length and broken item text. 2016-11-01 10:58:56 +09:00
vurtun
b280370fc8 Fixed copy & paste error 2016-10-31 07:39:43 +01:00
vurtun
69b13a008d Fixed C++ errors 2016-10-30 15:31:04 +01:00
vurtun
7ed612ee9a Merge branch 'master' of https://github.com/vurtun/gui 2016-10-30 14:12:56 +01:00
vurtun
d8688c623f Fixed clipping rectangle bug 2016-10-30 14:12:30 +01:00
vurtun
bd3fd8300f Pulled panel memory managment into nuklear
I simplified a lot of API calls by pulling panel memory management
inside the library. All API calls which previously required a panel
as parameter are now handling their panel themself.
2016-10-29 23:28:47 +02:00
Micha Mettke
01eb4f88d8 Merge pull request #259 from ettoretorti/ettoretorti-patch-1
Correct NK_MEMCOPY optional define to NK_MEMCPY
2016-10-23 00:17:23 +02:00
vurtun
4020b1bab2 Changed border drawing for widgets
Previously every widget border was drawn by two overlapping rectangles
to limit the number of primitives required to be supported by any
potential backend. The biggest problem from using this approach
is drawing overhead and no real way to get widget transparency. So
I changed border drawing to use stroked rectangles instead of a
second filled rectangle drawing call.
2016-10-21 18:02:41 +02:00
vurtun
867b3359b9 Added functions to manually set edit widget focus
I added function `nk_edit_focus` to set the focus to the next edit
widget that will be called after calling.
2016-10-18 22:27:30 +02:00
Ettore Torti
69221cfd3d Correct NK_MEMCOPY optional define to NK_MEMCPY 2016-10-17 16:07:11 +01:00
Yaroslav Tsarko
26d77f88ff implemented ability to quick compare drawing command buffers
using memcmp and decide whether to draw a new frame or not:
  * added NK_ZERO_COMMAND_MEMORY macro
  * when NK_ZERO_COMMAND_MEMORY is defined, inside
    nk_command_buffer_push function there is an additional call
    to NK_MEMSET after allocating memory for new drawing command
2016-10-05 10:11:07 +03:00
vurtun
4e26fb0949 Fixed edit widget UTF-8 cursor drawing bug 2016-09-29 14:51:57 +02:00
vurtun
d370ef9bd1 Fixed edit widget UTF-8 text input 2016-09-28 19:58:37 +02:00