Commit Graph

423 Commits

Author SHA1 Message Date
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
vurtun
3977145137 Fixed drawing bug inside edit box for UTF text 2016-09-28 18:28:25 +02:00
vurtun
3b89835533 Fixed font base85 decoding for trigraphs 2016-09-23 10:13:17 +02:00
vurtun
0fef9148fc Fixed color button size calculation 2016-09-20 18:28:20 +02:00
vurtun
ea47c24c28 Removed <stdio.h> fro NK_INCLUDE_STANDARD_VARARGS 2016-09-20 17:17:19 +02:00
vurtun
81d8d689cf Additional behavior fixes for nk_vsnprintf 2016-09-20 00:12:19 +02:00
vurtun
34ddd97c03 Removed test code 2016-09-19 19:12:02 +02:00
vurtun
85b7c7b7f3 Extend nk_strfmt to conform more to C standard 2016-09-19 18:47:34 +02:00
vurtun
7b71cbf03b Fixed NK_VSNPRINTF macro for vsnprintf 2016-09-19 10:46:19 +02:00
vurtun
1e2fadd46b Fixed small typo in standard library version check 2016-09-19 10:08:48 +02:00
vurtun
43a8e246be changed #if to #ifdef 2016-09-18 19:57:19 +02:00
vurtun
b0e2dba52c Fixed C89 error caused by missing vsnprintf
For more information please look inside the changelog. This is more of
an internal fix and hopefully does not break any existing code. I also
removed `nk_strfmt` from the API and made it internal only.
2016-09-18 19:49:52 +02:00
vurtun
5f3c1e241b Fixed popup close to deeper panel level
If you had any kind of popups like for example comboboxes inside a
deeper panel structure using nk_group, then `nk_xxx_close` would only
unblock input for the first level and not the whole panel stack. This is
now fixed and works correctly.
2016-09-16 10:44:45 +02:00
vurtun
00ab109855 Fixed C++ errors and internal selection padding 2016-09-16 10:09:26 +02:00
vurtun
85d109e351 Fixed non-blocking popup closing behavior
This is a breaking change which fixes bad closing behavior in
non-blocking popups. If the maximum size of a non-blocking popup was
not reached and you clicked to close the popup under it could happen
that it wouldn't be closed. This is now fixed in combination with
more popup control by allowing to set both the maximum height as
well as popup width.
2016-09-15 18:20:07 +02:00
vurtun
2a888b3098 Added assert to make sur menubar is used correctly
Since it is not as clear on how to use the menubar correctly as I
thought added an assert into `nk_menubar_begin` with explainations on
how to use it correctly and stop wrong ussage.
2016-09-15 10:01:58 +02:00
vurtun
179fddb5de Cleanup type selection and add additional check 2016-09-14 22:46:11 +02:00
vurtun
3d3e63133e Fixed #240 slider behavior is now correct 2016-09-13 19:00:20 +02:00
vurtun
9e6b4f67cc Changes to fix #233 and #238
For more informatio please look inside the issues and for the
actual changes overview please look inside `CHANGELOG.md`
2016-09-08 20:20:02 +02:00
vurtun
4ad73e83c2 Fixed #239 compile flag to add userdata to command 2016-09-07 07:31:43 +02:00
vurtun
929d74a338 Added documentation to warn for #233
Since it was not as apparent as I thought it is I added some
documentation warning to set the same flags each time you
include "nuklear.h" except `NK_IMPLEMENTATION` which is only
allowed to be defined once in *one* source file.
2016-09-04 20:46:23 +02:00
Micha Mettke
d38cd31010 Merge pull request #237 from mlabbe/master
fix visual studio warning C4116
2016-09-04 20:39:02 +02:00
vurtun
98c7376556 Fixed some warning and C89 errors 2016-09-04 20:29:41 +02:00
Michael Labbe
c867184094 fix visual studio warning C4116 2016-09-04 10:39:19 -07:00
vurtun
1d465751c6 Fixed wrong combobox height calculation #224
Functions `nk_combo`, `nk_combo_seperator`, `nk_combo_string`,
`nk_combo_callback`, `nk_combobox`, `nk_combobox_seperator`, `nk_combobox_string`,
`nk_combobox_callback` all calculated the the height of the combo box
panel wrong and forces a scrollbar even if it was not required. The
calculation is now fixed and should produce the right result.
2016-09-04 12:25:31 +02:00
vurtun
7f5d808809 Fixed CPP build
Looks like C++11 does not like conversion from pointer to int.
No problem just set type to `nk_size`.
2016-09-03 18:05:06 +02:00
vurtun
fc832cef07 Fixed gaps in combobox under OpenGL
This is basically a hack to fill the gaps. I have absoultly no idea why
I get some of these gaps but hopefully it is fixed and does not come
back to hunt me in the future.
2016-09-03 12:55:28 +02:00
vurtun
1b9779ce51 Nuklear now allows custom vertex layouts
I removed the default vertex type and instead create an API to allow the
user to specify the vertex struct layout. Of course you are still
bound on what the library actual has on vertex data but the type and
sequence of the data is now configurable. This commit is quite
experiental and could introduce some bugs, but so far it look fine.
2016-09-02 15:33:49 +02:00
vurtun
210bc49b25 Removed unused variables 2016-08-31 20:04:28 +02:00
vurtun
d9b2cf2035 Fixed #227 with API argument name mismatch 2016-08-31 19:38:32 +02:00
vurtun
4cc1778f9c Fixed C++ build errors 2016-08-31 19:29:18 +02:00
vurtun
550a2b03d3 Fixed some bug introduced by last commit and more
This commit fixed some bugs from the last commit as well as some general
changes and fixes of some old bugs. For overview of all changes please
look inside `CHANGELOG.md`.
2016-08-31 19:19:06 +02:00
vurtun
82e35927b4 Removed some internal complexity
This is a rather experiemental commit to remove some internal complexity
that build up over time handling panel padding and border. There still
could be some bugs but I tried my best to keep everything working.
2016-08-30 21:54:10 +02:00
vurtun
ad821dc808 Added additional height parameter to combo box
Added a max height parameter to very retain mode combo box to allow
a fixed height.
2016-08-29 19:40:27 +02:00
vurtun
24f7096acc Added popup mouse scrolling and fix popup drawing
Previously it was only possible to scroll windows and groups by mouse.
No it is possible to scroll popups, as well as nonblocking popups like
menus, contextuals and comboboxes. In addition I fixed a drawing bug
in dynamically growing panels.
2016-08-29 19:20:53 +02:00
vurtun
8e4d8ee741 Added window name string representation
To account for hash collisions which can be quite nasty I added
the string representation of the window name for additional
assurance. I also added an assert to check and alert if two windows
have the same name.
2016-08-26 20:31:33 +02:00
Micha Mettke
abac1878eb Merge pull request #222 from KalenAnson/master
Do not insert a backward delete
2016-08-26 20:02:38 +02:00
vurtun
d4625dc9c1 Added stacks for temporary style/UI changes
It is now possible to temporarily push some style values like color,
style items, font, ... into a stack modify the value and as soon as
you are done just pop the changes. Main benefit is less boilerplate
code to manually save and restore configuration properties.
2016-08-26 19:46:06 +02:00
Kalen Hall
f614b5dc1a Check for incoming backward delete (unicode 127) and do not insert into text box, just process as a text event 2016-08-26 11:08:12 -04:00
vurtun
114757ffa6 Hopefully fixed iOS key up/down issue #215
SDL iOs implementation provides key press and release in
one frame and while nuklear previously was keeping track
of transistions it did not check it. It hopefully should now be
possible to correctly interpret up and down key in the same frame.
2016-08-24 20:37:26 +02:00
vurtun
e69aee6922 Added additional nk_edit flag
Added flag `NK_EDIT_GOTO_END_ON_ACTIVATE` flag to text fields which
cursor jump to the end of the text field when activated.
2016-08-24 20:22:38 +02:00
vurtun
9f60ef2a3b Fixed #218 with invalid assert and condition check 2016-08-24 16:01:43 +02:00
vurtun
9d184a8b91 Fixed ROM-Flag for deeper level of popup parents
No you can have non/block- popups inside nested groups while the parent
groups do not receive any more input which was a bug.
2016-08-16 19:33:33 +02:00
vurtun
9d14e8e3ae Split CHANGELOG into own file
Since the CHANGELOG in `nuklear.h` became bigger and bigger I decided to
split it into it's own file. Probably have to think about a layout.
2016-08-16 17:40:57 +02:00
vurtun
8bf255030a Keep edit field active after enter commit
Edit widget width `NK_EDIT_SIG_ENTER` flag now keep their active
state after enter was pressed. Main reason is to be able to keep
typing after commiting.
2016-08-15 15:07:11 +02:00
vurtun
ce234fc7a7 Removed redundant code 2016-08-15 11:50:40 +02:00
vurtun
01c088e7d8 Fixed negative numbers in nk_strtoi 2016-08-15 11:24:00 +02:00
vurtun
3771eb1dab Changed NK_WINDOW_BACKGROUND behavior
Background windows now get only selected by hovering if no other window
is above it and not on clicks.
2016-08-15 10:34:27 +02:00
vurtun
338eba3d57 Fixed #211 font baking bug with multiple ranges 2016-08-14 18:46:22 +02:00
vurtun
1cc7697d58 Removed unused variables 2016-08-12 20:17:04 +02:00
vurtun
c7c355e55a Added function to check if window is hidden
`nk_window_is_closed` previously checked if the window is hidden
instead of checking if it is closed. This behavior is now fixed and I
added an additional function `nk_window_is_hidden` to check if a
window is currently hidden.
2016-08-12 20:14:42 +02:00
vurtun
02718210e6 Added additional property version for double
Nuklear now has three different property versions for int, float and
added by this commit a double version. Internally an additional change
happend. Now the type of the property is actually taken into account
and floating pointer errors due to casting are less of an issue.
2016-08-12 12:08:13 +02:00
vurtun
427744e57c Added define to replace float to string conversion
Since floating point to and from string conversion is a total pain
and really complex it is really hard to provide a realtive simple
non-standard library solution. But to solve both problems I now added
a way to overwrite the library intern float to string conversion
implementation if you really need more precision.
2016-08-09 21:30:36 +02:00
vurtun
f675cea305 Added define to overwrite nk_strtod
Since nuklear internal string to number conversion is quite imprecise,
and a correct solution is way to complex (I dare you to look at the
implementation of strtod, dtoa, ...) I now provide a new define to
overwrite the library function with either your own or the standard
libray implementation.
2016-08-09 18:33:31 +02:00
vurtun
e7eb366332 Fixed compiling without NK_INCLUDE_FIXED_TYPE 2016-08-09 07:43:45 +02:00
vurtun
a384c6ed80 Fixed possible floating pointer error in nk_widget
Under certain circumstances it is possible that because of floating
point error `nk_widget` will mark a widget as read only if used in
combination with `nk_layout_row`. The fix is rather simple in this
case since the additional floating point precision is not really needed
it is possible to just cast to int and remove the problem all togther.
2016-08-08 20:48:50 +02:00
vurtun
69d8db0f2b Differentiate between closing and hiding a window
There is now a difference between hiding a window with
`nk_window_show` and closing a window by clicking the close button in
the window header or calling `nk_window_close`. Only in the case of
activly closing a window will be removed at the end of the frame
besides getting removed if not updated inside the frame.
2016-08-08 17:01:48 +02:00
vurtun
7635094d27 Added '\0' terminated nk_edit_string version
To support both string formats with string combined with length as
well as zero terminated strings I added a zero terminated string
version to `nk_edit_xxxx` with `nk_edit_string_zero_terminated`.
2016-08-08 12:42:10 +02:00
vurtun
2e66a94de9 Fixed minor scrollbar and panel padding bug
Fixed scrollbar auto hiding behavior to also work correctly if
the window is not hovered or manipulated in any way.
In addition I fixed a small panel padding bug in `nk_layout_widget`
for all panels outside windows which require a test on
`layout->flags` instead of `window->flags`.
2016-08-08 12:08:51 +02:00
vurtun
a0870bd307 Fixed bug in layout API calculating wrong width
The dynamic immediate mode layout API with `nk_layout_row_begin`,
`nk_layout_row_push` and `nk_layout_row_end` caused an infinite
scrollbar bug by wrongfully calculating the required widget sizes.
This bug is now fixed and everything is correctly calculated.
2016-08-07 21:53:20 +02:00
vurtun
f50f83698c Fixed drawing bug inside combobox popup 2016-08-07 21:26:10 +02:00
vurtun
94ca7accdf Version 1.05 split varargs include into own define
Previously I packed standard library variable arguments as well as
file operation into one define `NK_INCLUDE_STANDARD_IO`. This caused
some problems and I split the define into two. So if you want the old
behavior you need to define `NK_INCLUDE_STANDARD_IO` as well as
`NK_INCLUDE_STANDARD_VARARGS`. If you only want file operations but
not variable arguments only define `NK_INCLUDE_STANDARD_IO` and
if you only want varargs but not file operations please only define
`NK_INCLUDE_STANDARD_VARARGS`.
2016-08-06 17:44:00 +02:00
vurtun
f288188a72 Changed overlooked memset calls to NK_MEMSET 2016-08-06 14:36:31 +02:00
vurtun
204a663de7 Fixed fast window scaling behavior
If you move the cursor to fast while scaling a window there is a
chance the mouse will miss the scaler and the scaling operation will
halt. Dragging in itself is quite hard but I implemented the hack I
use for property, window moving and slider for the window scaler and
scaling hopefully now works correctly.
2016-08-04 21:09:31 +02:00
vurtun
2b1c2ca540 Fixed window scaling, movement bug
This is quite an old bug and a result of being nearly stateless.
If you move/scale a window and another window is behind it the other
window will be acitvated and the move/scale operation will be stopped.
To fix this I now require no mouse down for activating by hovering.
I hope this does not cause any problems and fixes the problem for good.
2016-08-04 16:31:44 +02:00
vurtun
100480c6c7 Fixed swapping out fonts
I had a long standing bug inside nuklear which prevents you from
swapping out a font while the code is being build. This bug is now
fixed but the fix requires _ALL_ `nk_user_font` data structures
provided by `nk_style_set_font` to be persistent.
2016-08-04 14:18:29 +02:00
vurtun
7f4e5eb76e Fixed 'NK_WINDOW_BACKGROUND' behavior 2016-08-03 20:21:31 +02:00
vurtun
b251f91107 Fixed multiple crashes in font handling 2016-08-03 16:22:13 +02:00
vurtun
8d5c479db2 Release version 1.04 changes in changelog 2016-08-03 12:01:33 +02:00
vurtun
84b1bbf069 Fixed NK_RGB color picker widget
Removed invalid assert macro which wrongfully triggers if you call
`nk_color_picker` with parameter `NK_RGB`.
2016-08-03 09:50:56 +02:00
vurtun
c87a55cf56 Version 1.04 with seperated window name and title
Added `nk_begin_titled` for seperated window name and title or cases
you need to keep persistent state between frames while changing
the window title.
2016-08-02 10:48:32 +02:00
vurtun
c957b49d04 Moved helper macros inside header guard
A previous push request added some macros into the header file and
I missed that it was outside the header include guard. This should
now be fixed and not cause problem if included multiple times in
different location.
2016-08-01 21:54:41 +02:00
vurtun
3011ef451f Added clipboard as default flag to edit fields
Edit flags are now a default flag for edit field and editors.
2016-07-31 20:35:32 +02:00
vurtun
ebfeeea7e1 Version 1.03 with auto hiding window scrollbars
Window scrollbar will if enabled by window flag hide if no user
interaction happens for a set time duration.
In addition the internal window/table data structs are now located
inside the header part of nuklear to remove the need to allocate a
pool and therefore simplify memory management.
2016-07-29 12:36:51 +02:00
Timothy Qiu
ff00fc00f6 Fixes typos in comments 2016-07-27 09:54:56 +08:00
vurtun
fe1f1530f4 Fixed hole in combobox and window border drawing
Hopefully I finally fixed the hole inside combobox popup which only
occur if you set the window border size greater one. In addition
I fixed some subpixel drawing artifacts that come up if you use
antialising in combination with vertex buffer output.
2016-07-25 16:54:59 +02:00
vurtun
9637af3681 Fixed window border and popup border drawing 2016-07-25 11:58:01 +02:00
vurtun
980889e6f9 Fixed color picker crosshair drawing
The crosshair inside the color picker had some some wrong pixel
measurements. This is now fixed and should look correct.
2016-07-25 09:42:20 +02:00
vurtun
c5614d9098 Release 1.01 changes in changelog in nuklear.h
Breaking changes to the button API, font atlas and added software
cursor to library.
2016-07-16 01:33:37 +02:00
vurtun
d8adeae85f Merge branch 'master' of https://github.com/phoekz/nuklear into phoekz-master 2016-07-15 13:55:29 +02:00
vurtun
0def503980 Fixed NK_INCLUDE_COMMAND_USERDATA flag
Fixed compile error if flag NK_INCLUDE_COMMAND_USERDATA was set.
2016-07-15 13:48:39 +02:00
vurtun
362afc071a Fixed edit scrollbar and ROM flag
I completely forgot to add the edit scrollbar style and
had a incorrect scrollbar bounds calculation. Both bugs
should now be fixed. Furthermore the edit ROM flag know
prevents any manipulating input instead of all input.
So it should be possible to move or copy inside the edit
field but not to modify the content.
2016-07-14 12:56:41 +02:00
vurtun
db4ff5ad93 Merge branch 'ytsarko-master' 2016-07-12 15:48:15 +02:00
vurtun
d49b669db9 Added function to modify window title 2016-07-12 15:47:53 +02:00
vurtun
def4850b49 Merge branch 'master' of https://github.com/ytsarko/nuklear into ytsarko-master 2016-07-12 15:44:23 +02:00
Vinh Truong
383d0f94bd Change popup toggling semantics
For gui elements like tree tabs, tree nodes and windows themselves,
you can repeatedly click the same "minimize" region and it keeps
toggling that element. This was not the case with "popup" type of
elements. This commit slightly changes how the popups close once
they are already open.

Like before, the user can close the popup by just clicking outside
the popups region. Now the user can also close the popup by clicking
the "header" region of the popup.
2016-07-10 10:36:28 +03:00
Vinh Truong
3b50eedba4 Fix nk_input_key to enable keyboard key repeat 2016-07-10 01:43:31 +03:00
Vinh Truong
5b8b9f8832 Fix incorrect printf token in nk_value_format_byte 2016-07-09 23:30:10 +03:00
Vinh Truong
e1655817b8 Fix fading glyphs with global_alpha < 1 2016-07-09 19:06:17 +03:00
Yaroslav Tsarko
e3a29e9fdf Merge remote-tracking branch 'upstream/master' 2016-07-01 09:38:27 +03:00
vurtun
605d59bf8e Fixed #173 draw list clearing bug 2016-06-29 06:54:29 +02:00
vurtun
4d390a9c46 Fixed some code style issues
Enforced the correct code style and tab index width of 4 instead of 2.
2016-06-25 10:39:49 +02:00
vurtun
b82cf7251e Merge branch 'master' of https://github.com/inolen/nuklear into inolen-master 2016-06-25 10:32:55 +02:00
Anthony Pesch
af451ebee2 Make panels use the max of the scaler size or scrollbar y size when calculating their height
Make horizontal scrollbars use the scrollbar y size when calculating their position
2016-06-23 22:55:37 -07:00
mogud
1b4ea11954 fix macro nk_tree_image_push_id: params error 2016-06-23 14:12:11 +08:00
vurtun
76ba0b2374 Fixed alignment bug after buffer reallocation
Previously if a dynamic back buffer is full and reallocated then the
current allocation alignment will be alignet at the direct memory
address instead of memory address minus size. This is now fixed and
alignment should work correctly.
2016-06-20 20:01:24 +02:00
Yaroslav Tsarko
3ac1ac5991 some very useful macros (for common MATH and ALIGNMENT operations)
are moved to library interface part in order to use them in client
code (especially in creating nuklear backends)
2016-06-17 12:41:17 +03:00
vurtun
c9f07101f3 Removed shadow variable 2016-06-16 20:48:59 +02:00
vurtun
848d35ea68 Fixed group inside group scrolling
This commit deactivates scrolling for each parent group and window
of a panel to only allow exactly *one* active scrollbar.
2016-06-16 20:25:26 +02:00
vurtun
30087c41ef Fixed missing NULL check
Forgot to check if `nk_input` is NULL
2016-06-16 20:07:18 +02:00
vurtun
c39afae44b Merge branch 'master' of https://github.com/vurtun/nuklear 2016-06-16 16:35:59 +02:00
vurtun
06ec76c3ff Added group scrollbar scroll wheel and shortcuts
It is now possible to use mouse scrolling as well as shortcuts for
windows as well as groups. But there is still some unwanted behavior
if you scroll the window and while scrolling hover over a group then
the group will be scrolled and not the window. I will look into fixing
it.
2016-06-16 16:10:11 +02:00
vurtun
758d9c405a Fixed copy & paste bug in scrollbar implementation
It should now be possible to just click on one of the empty spaces
inside scrollbars to jump one window frame down or up.
2016-06-15 21:34:49 +02:00
vurtun
b020c332d0 Added general scrollbar shortcuts
This commit extends nuklears scrollbar with some basic shortcuts.
Included are page up/down as well as jump to beginning and
end of window. The last scrollbar change is page down/up by mouse
click in empty scrollbar space.
2016-06-15 17:39:14 +02:00
vurtun
e7307ae2fd Fixed text clipping bug inside draw list
Text was previously wrongfully software clipped if text was only
partially visible. The wrong behavior is now fixed and text should
be clipped only if the text is completely outside the clipping rect.
2016-06-15 14:10:32 +02:00
vurtun
4d8738282a Fixed #165 C++11 specific error
Surprising turn out, the C++ standard comitee consists of a bunch of
retards invalidating completely fine code and requesting super
idiotic work arounds for their new versions. I have no fucking idea
why these spaces are required and honestly I don't even want to know.
Whatever the reason it should now compile fine with C++11 until the^
next C++ version will probably invalidate it again. To a better
future I can't wait.
2016-06-14 22:45:58 +02:00
vurtun
110a9a77fb Made reading out moved/scaled group bounds easier
Previously if you used movable or scalable groups you had to add
the group border width to the panel to access the updated position
or size. Nuklear now takes control of the process and the new
position/size can be read after `nk_group_end` from `nk_panel`
directly.
2016-06-14 12:35:03 +02:00
vurtun
c152abb78c Changed toggle to be font height dependent
Extended toggle style and changed toggle (checkbox + radio button) to
depend on the font height instead of row height. The main reason is
that it is easier to configure the cursor inside.
2016-06-14 12:22:05 +02:00
vurtun
8ed50e08d4 Fixed configuration of group border color
This commit adds a previously missing `group` flag to each group panel
and therefore allows to check for groups inside `nk_panel_end` and
draw the correct border color.
2016-06-14 09:49:09 +02:00
vurtun
ea4ac755de Fixed group/node movement and scaling
Fixed a small bug introduced by the last commit which prevent
groups from being moved. In addition I fixed an old scaling bug for
groups. It should now be possible to have movable and scalable
groups.
2016-06-13 20:02:44 +02:00
vurtun
4dc22cd99b Extended style/config and Fixed horizontal scroll
Fixed window y-padding and added scrollbar cursor padding and extended
scrollbar styling properties to separate between cursor and scrollbar.
In addition I added a property to control tab indentation. Finally fixed
clipped horizontal scrollbar for group.
2016-06-12 15:28:22 +02:00
vurtun
be2e35e3c1 Fixed clipped group scrollbar behavior Ro.2
While the last commit fixed some issues it still had a bug which
caused wrong scrollbar target size calculation. So this commit
hopefully fixes the problem.
2016-06-11 21:52:06 +02:00
vurtun
c4c3ce226f Fixed clipped group scrollbar behavior
Previously if a group had a scrollbar and is not completly visible
inside the window then the its scrollbar would use the clipped
height instead of its actual height as scroll reference. This should
now be fixed and work correctly.

In addition I split the tab/node button style into two one for the
minimized and one for the maximized state change.
2016-06-11 19:05:16 +02:00
vurtun
a4dce2565e Removed old commented out code 2016-06-11 11:13:52 +02:00
vurtun
07cffde659 Merge branch 'master' of https://github.com/ands/nuklear into ands-master 2016-06-11 11:11:44 +02:00
vurtun
3eafc226ef Fixed scaler drawing and window motion bug
Previously window borders were wrongfully drawn with already updated
size onto a window drawn with old size. This is now fixed and scaling
is a delayed by one frame.

In addition I hopefully finally fixed a window movement bug which
occurs if you drag one window header over another one really fast.
This would cause the previously not selected window to be wrongfully
selected and moved.
2016-06-10 22:43:45 +02:00
ands
6e41aa6ce3 Fixed a NULL dereferencing bug. 2016-06-10 21:34:21 +02:00
ands
a0f75bd5d9 don't depend on the title in nk_tree_push_hashed if a hash is already specified to allow editing it from inside the node/tab. 2016-06-10 19:33:47 +02:00
vurtun
1ac8021979 Fixed mouse dragging behavior
Fixed a bug inside the library and demos causing wrong dragging
behavior for `nk_property_xxx`.
2016-06-06 11:36:39 +02:00
vurtun
66c5c9fc64 Added optional font atlas temporary allocator
This commit adds another init function to font atlas which allows to
specify one allocator for temporary and one for permanent allocation.
In general this makes it managing memory a little bit more fine
grained. This is not a breaking change and the old API still works
without problems.
2016-06-06 10:11:08 +02:00
vurtun
c962163773 Fixed bug inside textedit redo stack 2016-06-04 16:16:10 +02:00
vurtun
3f935941f8 Added additional comments to asserts 2016-06-01 13:34:26 +02:00
vurtun
792a3af51e Fixed property value drawing bug under xlib
For some reason `xlib` still draws text even if the scissor rect has
a width or height of `0`. I don't know if this is a bug on my end or
on xlib but whatever the source it is now fixed.
2016-05-27 11:29:42 +02:00
Yaroslav Tsarko
de91bd6e03 fixed compilation when 'NK_INCLUDE_VERTEX_BUFFER_OUTPUT' macro isn`t defined
but 'NK_INCLUDE_FONT_BAKING' is
2016-05-27 10:12:59 +03:00
Yaroslav Tsarko
cc97f7bf4b fixed 'unsigned short' overflow when
drawing widget text with font size > widget height
2016-05-27 09:48:01 +03:00
vurtun
9c455006c7 Added icon tree nodes/tabs 2016-05-25 18:21:51 +02:00
vurtun
e6063b79aa Added chart line/column dependend coloring API
It's now possible to define a specific color for each line or
column entry inside a chart. This purely extends the API and all
previous implementation still work.
2016-05-25 10:58:00 +02:00
vurtun
945853e62c Added selectable label + images #151 (breaking)
This is a breaking change to hopefully noone. I removed all drawing
callbacks inside `nk_style` structs. The reason is that they are
quite ugly and a lot of work to maintain in the future. In addition
I added `nk_selectable_image_text`, `nk_selectable_image_label`,
`nk_select_image_text` and `nk_select_image_label` for combined
text and image selectables.
2016-05-24 17:34:28 +02:00
vurtun
25cfeb98af Added property OS cursor hiding for mouse grabbing 2016-05-23 14:56:22 +02:00
vurtun
8e3a5c74d3 Fixed #148 missing function definitions
Added missing function definitions for `nk_color_hsv_b`,
`nk_color_hsva_b` and `nk_strmatch_fuzzy_string`.
2016-05-22 07:38:41 +02:00
vurtun
2e975a3bd8 Fixed #145 scrollbar mouse grabbing behavior
While mouse grabbing already works in x-direction for vertical and
in y-direction for horizontal scrollbars moving over scrollbar
boundries in the other direction would fail. The problem is now fixed
and scrollbar should work as expected. Note: interestingly slider
already work correctly even though I did not do anything to make it
work correctly.
2016-05-20 19:38:19 +02:00
vurtun
eb500b0ab3 Fixed #143 nk_item_is_any_active behavior
Hopefully `nk_item_is_any_active` and `nk_window_is_any_hovered`
work correctly now by taking minimized windows as well as popup
windows into account.
2016-05-20 19:00:48 +02:00
vurtun
7cc3e03573 Fixed nk_edit tab handling 2016-05-20 11:30:58 +02:00
vurtun
cd209d6a35 Fixed #141 #142 text disapearing
Previously a bug would cause scrolling in x-direction to overshoot the
visible text space. This bug is now fixed and scrolling should work
correctly.
2016-05-20 11:15:37 +02:00
vurtun
3d5dac9762 Fixed #140 NK_KEY_LINE_START behavior
Hopefully NK_KEY_LINE_START now works correctly if cursor is at end
of text for movement as well as selection.
2016-05-20 10:52:15 +02:00
vurtun
a96ddc0b10 Fixed small double to float conversion warning 2016-05-19 20:04:07 +02:00
vurtun
539dde6cde Fixed #138 piemenu and combo open at same time
Fixed piemenu behavior inside extended example.
2016-05-19 16:11:54 +02:00
vurtun
af09e4898e Fixed bugs from #136 and pulished edit behavior
Hopefully fixed selection bug for empty lines and made edit widget
usable while being only partially visible. I also added two addition
modes for a vim like expierence with view, insert and replace mode
instead of default replace mode, but only added the new behavior into
the x11 demo so far.
2016-05-19 14:37:56 +02:00
vurtun
a03c887b71 Fixed #137 by only clipping not visible triangles
Triangle software clipping conditions was incorrect and clipped if
already one vertex was not visible.
2016-05-19 12:27:34 +02:00
vurtun
67588f3ba3 Fixed #135 rendering bug
This commit fixes a stupid reallocation bug I had inside the library.
Basically I get a pointer inside a growing buffer which can be
invalidated by a second allocation and regrowth of said buffer.
Under normal circumstances I do not do this but in one instance I
actually did. That is for allocation temporary normals. This issue
should now be fixed and work correctly.
2016-05-19 12:14:19 +02:00
vurtun
ed4a3133b8 Fixed some issues valgrind and ASAN found
This fixes some small harmless unitialized variable access violations
found by either valgrind or ASAN. Nothing really ground breaking but
still cleaner.
2016-05-18 20:19:48 +02:00
vurtun
570ce73404 Fixed #131 with moving unfocused windows
Previously you had to first activate a window by clicking if it was
visually blocked by another window to move it around which was a
little bit blocky. It should now be possible to directly move and
activate a window.
2016-05-16 14:38:43 +02:00
vurtun
847b9c4a19 Fixed wrong widget hovering for multiple windows
Previously buttons would show up as hovered if another widget was
being hovered in another window. This behavior is now fixed and
everything should work correctly now.
2016-05-16 12:22:11 +02:00
Micha Mettke
a91f801ae2 Merge pull request #126 from hobbitalastair/master
s/memset/memcpy/ - typo fix in documentation
2016-05-10 21:56:48 +02:00
vurtun
b712a3a163 Removed C89 errors and warnings and style issues 2016-05-10 14:05:55 +02:00
vurtun
7e96bfc586 Merge branch 'fixing_window_scaling' of https://github.com/jimon/nuklear into jimon-fixing_window_scaling 2016-05-10 13:36:10 +02:00
Dmytro Ivanov
21d2458bdc fixing window scaling 2016-05-09 21:35:39 +02:00
Dmytro Ivanov
72b06835a2 close popups by clicking anywhere outside of popup bounds 2016-05-08 22:04:20 +02:00
vurtun
74e115dac7 Fixed C++ error 2016-05-06 20:16:25 +02:00
vurtun
da13dc3261 Fixed aliasing/alignment issues with nk_pool
Fixed some non-portable implementation details inside window and
table memory pool which could cause problems for platforms other
than x86/x64 and fixed some strict aliasing problems.
2016-05-06 14:13:14 +02:00
vurtun
c51d0694ac Removed possible dead table memory bug for windows
Tables inside windows get removed if a windows is not longer in use
inside `nk_free_window`. But I noticed that they are only removed
if they were not used the last frame, because of a copy & paste bug.
I removed the additional check and every table should now rightfully
be marked as free. I don't know if this bug actually caused any
problems, since I checked memory consumption and there were no
symptoms of wrong behavior before.
2016-05-06 11:27:42 +02:00
Alastair Hughes
21c6c12537 s/memset/memcpy/ - typo fix in documentation 2016-05-06 20:39:02 +12:00
vurtun
ac8f0e2069 Extended chart API with slots
I extended the chart API to allow more than one graph and implemented
a testcase using this API inside the `overview.c` chart example.
2016-05-05 22:37:13 +02:00
vurtun
7810bc20bd Changed multi context chart name 2016-05-05 21:18:31 +02:00
Jan Viktorin
86547049df Support multiple data sets in a single chart
This patch hacks the chart API to support display of multiple data sets in a
single chart instances. Tested briefly with the line chart.

Signed-off-by: Jan Viktorin <iviktorin@fit.vutbr.cz>
2016-05-05 19:43:40 +02:00
vurtun
33185df10a Fixed wrong border line width for popups 2016-05-03 22:17:08 +02:00
vurtun
cc629f45ca Enhanced nk_tree_push_id uniqueness #106
Previously I only used the `__FILE__` and a user `ID` to make
sure to get an unqiue identifier out of it. Like @ands pointed out
this is not enough. Since it is possible to have multipe instances
with the same `title` in the same `__FILE__`. So to fix that I had
the idea to string concat `__FILE__` and `__LINE__` into a string.
This allows to have the same sequence of `IDs` in different places
in one `__FILE__`.
2016-05-03 13:23:04 +02:00
vurtun
31938dac3a Removed unnecessary menu clipping #119 2016-05-02 15:28:29 +02:00
vurtun
66ce0ce8e5 Added nk_item_any_active for #107 and fixed typo
Previously it was not possible to check if currently any window or
widget is active. To fix that I added function `nk_item_any_active`.
To get correct result you should only call it after all UI code
ran but before calling `nk_clear`. There is currently no other way to
achive the same result inside UI code.
2016-04-30 22:27:29 +02:00
vurtun
fa01e2a0db Fixed grapped dragging behavior #116
Fixed mouse grapping emulation for progressbars and window position
dragging which previously still got triggered if other widgets were
being dragged.
2016-04-29 17:25:49 +02:00
vurtun
c7d3901e05 Enhanced widget click and drag interaction #116
It is now possible to control button click behavior to trigger either
on button pressed or button released. By default nuklear now used
on button pressed but `#define NK_BUTTON_TRIGGER_ON_RELEASE` lets
you change button behavior to trigger on release. I furthermore
enhanced slider dragging behavior to not force you to hover the
slider at all times.
2016-04-28 22:51:09 +02:00
vurtun
8f03b5bcdd Set default types for nk_uint/nk_int to u/int #115 2016-04-27 23:15:52 +02:00
vurtun
4d36ca410e Fixed comment typo 2016-04-27 13:07:50 +02:00
vurtun
9974a55eb1 Fixed properties edit field width calculation
Editfield width inside properties were previously calculate by text
length + padding and always the size of the edit cursor, even in case
were no one is editing the property. Now the cursor size is only
added while editing.
2016-04-26 14:48:03 +02:00
vurtun
8ebd0afe79 Fixed window position/size modification
Fixed windows ignoring changes to its position, size or both if a
group layout is used.
2016-04-25 14:11:35 +02:00
vurtun
2a230e2bd6 Removed shadows variable warning 2016-04-25 10:13:09 +02:00
Doug Thayer
72b362325d Fix issue with adding multiple fonts
The total range count grabbed from nk_range_count was being used
to get the glyph count, which resulted in a buffer over-read.
2016-04-24 14:05:34 -07:00
vurtun
412f65fa65 Fix #108 pushing wrong texture in empty draw_list
Fixed a small copy & paste error which pushes the wrong texture
into an empty draw list. In normal cases this never occurs but is
still a big if used independent of libraries use cases.
2016-04-23 16:29:58 +02:00
vurtun
5da8216f71 Fixed property text input
Inserting text into a property would cause an assert because
I forgot to set the upper bounds of the text edit inside the property.
2016-04-23 12:28:45 +02:00
vurtun
bdbc8f9c26 Removed private underscore of nk_tree__push #106
`nk_tree__push` was not supposed to be seen as private but more like
the more extended way of handling duplicate tree elements. But I used
double underscore which is the general indicator for private. I renamed
it know to nk_tree_push_id, to hopefully make it clearer.
2016-04-23 10:34:50 +02:00
vurtun
3929ec8dee Added some additional documentation 2016-04-21 17:35:52 +02:00
vurtun
bc8db2e3f3 Fixed #97 with text input at end of edit field
This commit fixes a bug that occurs if you move the cursor inside
text and then back to the end of the text and insert a character.
Caused was the bug by an incorrect check if the cursor is at the
end of the string.
2016-04-21 12:39:07 +02:00
vurtun
7c9659f3b8 Fixed #99 forgot to set clipboard callbacks
Previously if you use `nk_edit_string` and use flag
`NK_EDIT_CLIPBOARD`, callbacks were not passed. I only tested it with
`nk_edit_buffer` and set the callbacks directly. This wrong behavior
is now fixed and should work copy & paste should behave correctly.
2016-04-21 11:04:18 +02:00
vurtun
7ccd95f2f1 Reverted qsort back to own implementation
Forgot the remove some test code for the last commit.
2016-04-20 18:36:51 +02:00
vurtun
1d7f0244f9 Revert float '=' cond and oversample default font
I previously used a conditional style so I don't have to compare
floats directly with eachother because of warning. This caused some
bugs and I now reverted back all conditions back to normal.
In addition I oversampled the default font to make it look better.
2016-04-20 18:28:04 +02:00
vurtun
18b93fcc8a Fixed #90 cppcheck warning and errors
Thanks to @codemeow I fixed some bugs and warnings found with
cppcheck. NOTE: it seems like all static analyzer fail to
detect the assert macro or hate combining assert ans if checks.
2016-04-20 10:31:20 +02:00
vurtun
4d02cf9c80 Removed unused variable 2016-04-19 19:46:13 +02:00
Emery Hemingway
92f5257e92 correct type definitions without NK_INCLUDE_FIXED_TYPES 2016-04-19 15:28:44 +02:00
Bruce Mitchener
da46d536f9 Fix some typos. 2016-04-19 15:23:33 +07:00
vurtun
9b2822c06e Fixed #63 error and wrong header dragging calc 2016-04-19 00:35:52 +02:00
Angus Holder
a6e980df6e Clearing up compiler warnings
Some minor issues: an unused variable, fixed a comparison of int against
float, and a pragma warning (pop) that didn't have a matching pragma
warning (push). Potentially more serious was a possible buffer overrun,
where a pointer was being tested against a null terminator, instead of
the char it points to.
2016-04-18 20:29:34 +01:00
Angus Holder
12f3c8406d Fixes for C++ compatibility, corrected an assert call
There were a few casts from void * missing causing problems when
compiling as C++, also the assert function from <assert.h> was being
used instead of NK_ASSERT(...) in one place.
2016-04-18 16:08:43 +01:00
vurtun
d7a9f14c1c Fixed some small bugs and added calc example
Fixed window movement for windows without header and some small
wrong calculation inside the panel layout code. In addition I
added another example implementing a simple calculator.
2016-04-15 20:13:50 +02:00
vurtun
b2c87ed7c0 Release Version 1.0
This is the first release version of nuklear (previously: zahnrad).
As for those who no the old version will notice: a lot has changed.

Most obvious should be the two biggest changes. First the name change
because I got critique that the name is hard to comprehend and
remember (understandable for non-germans) and the second is the
transistion from four files (zahnrad.h, zahnrad.c, stb_truetype
and stb_rect_pack) to one single header library file nuklear.h.
I am not 100% convinced that using a single header library is the
right choice here but so far I haven't encountered any problems.

Noticable should be as well that nuklear now directly embeds three
stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like
in previous versions the first two are optional and the library
can be compiled without. stb_textedit on the other hand powers
the text edit implementation for single as well as multiline
text manipulation. The text edit implementation is still relative
new and untested so you can expect some bugs I have not found yet.

In the demo department a lot changed as well. All platform demos
now don't compile one big demo but instead contain a simple
demo and small abstraction layer over the platform. Main benefit is
better understandablity improved ease of use. The old demo
is now split up and transfered into the example folder while each part
is self contained and compileable. (All examples use glfw I don't now
if this is the best platform but it is at least the simplest.
I also removed the apple demo because I don't have an apple system
and cannot make sure the new version runs with the old version.

Finally a lot of small bugs have been fixed as well as bugs found by
clang analyzer and coverity.
2016-04-14 16:26:15 +02:00