Commit Graph

745 Commits

Author SHA1 Message Date
vurtun
de384a805b changed layout param from zr_size to int 2016-02-14 22:06:12 +01:00
vurtun
741217af1f Changed property dragging behavior for easier use
Previously dragging was activated in properties by clicking on the
label or value and edit mode by clicking inside the empty space.
While it worked it was not as nice to use as intended. Now
it dragging mode is activated by dragging on the empty space or label
and edit mode by clicking on the label.
2016-02-12 20:59:49 +01:00
vurtun
98da4841dd Fixed canvas arc and therefore piemenu drawing
I forgot to add the center point to drawing an arc which resulted
in half spheres. It is now fixed and should work as intended.
2016-02-12 20:30:06 +01:00
vurtun
730fd24746 Fixed popup drawing inside groups
Previously the popup buffer state was stored inside the group
panel layout instead of the window layout. This caused
overdraw for popups and the underlying window. To fix that now
all popups are stored inside the root window panel layout
and everything is drawn correctly.
2016-02-12 19:09:36 +01:00
vurtun
890430db76 Fixed node editor node linking
Because clicking was changed to happen on button up instead
of button down linking was bugged. It has been fixed and should
work now was expected.
2016-02-12 17:51:59 +01:00
vurtun
fdbcc52629 Merged examples and demos into one (first step)
While dividing previously spared me from a lot of work and problems
it is probably best to have everything working for every or as many
platforms as possible. Some platforms fail to provide good ways
to support everything (e.g.:X11 does not have pixmap clipping with
different width/height or alpha-blending) but all OpenGL demos
outside allegro (needs some additional work) should be able to run.
2016-02-11 23:29:02 +01:00
vurtun
18520b418a Added additional text alignment flags
Previously the ussage code had to draw text at the correct Y position
inside a rectangle to have the text centered in the middle. This is
inside the libray itself and can be controlled by additional
alignment flags. In addition a bug was removed that can occurs if you
draw images using the vertex buffer API. The check if an image is
an subimage was incorrect and therefore used the wrong API to draw
the image. The check is now fixed and everything should work fine.
2016-02-10 15:20:23 +01:00
vurtun
f5b6010a01 Added additional selectable color themes to demo
This commit extents the provided number of themes inside the demo
and updates the default style by using a smaller default padding
value for windows.
2016-02-09 15:16:05 +01:00
vurtun
c80a4809fd fixed bugs coverity found 2016-02-07 21:31:57 +01:00
vurtun
5e9486c70a Finally fixed GCC and Clang C++ errors
I totally forgot to compile under C++ and only now noticed it.
And there were a lot of C++ specific errors and warning that
creeped into the codebase. Hopefully everything should
compile just fine under C++ now at it does least for GCC and
Clang.
2016-02-07 18:39:07 +01:00
vurtun
9859d4d40d Added userdata to context,command,draw_command #48
As described in #48 I added optional userdata to zr_context,
zr_command and zr_draw_command. WARNING: I did not extensivly tested
this so any kind of feedback would be great. I also deactivated the
feature my default so to activate it you need to define
`ZR_COMPILE_WITH_COMMAND_USERDATA`. I also thought about deviding it
up into command userdata and draw command userdata but that would
only complicate things further and it is not really neccessary.
2016-02-06 23:38:08 +01:00
vurtun
1db24e4ca3 Fixed property input for negative values
zr_strtof did not have a conversion case for negative float values
which caused problems for negative float text input. In addition
zr_filter_decimal had a bug that did not allow '-' as correct input.
Both bugs have been fixed and it should work now.
2016-02-06 16:45:35 +01:00
vurtun
835e3a04bb Fixed drawing and backspace bug inside zr_edit_xxx
Previously newlines were drawn inside an edit box if some text was
selected. That bug is now fixed. In addition backspace and delete
had the same result in deleting the current character under the
cursor. Now it has the respectable implementation.
While this commit fixes some issues with newlines they are still
bugged and an absolute pain to debug and fix.
2016-02-06 14:27:26 +01:00
vurtun
8f9fa3ee4d updated Readme 2016-02-03 11:28:58 +01:00
vurtun
c85ed0c50c Restructered context functions for better clarity 2016-02-02 22:30:22 +01:00
vurtun
c4916f62dd renamed zr_layout to zr_panel 2016-02-02 15:43:19 +01:00
Micha Mettke
6d8f2e4033 Merge pull request #46 from richi/CoreGraphics
Additional CoreGraphics Example
2016-02-01 22:50:56 +01:00
richi
292c33d78b Additional CoreGraphics Example
iOS_CoreGraphics does contain a simple example running
Zahnrad on top of the native CoreGraphics API.
2016-02-01 21:15:25 +01:00
Micha Mettke
e7439a34df Merge pull request #45 from richi/master
vertexes -> vertices
2016-02-01 13:37:25 +01:00
richi
c3da9dc2b6 vertexes -> vertices 2016-02-01 09:42:05 +01:00
vurtun
6af22b621f fixed missing C++ void* to char* cast 2016-02-01 09:26:22 +01:00
vurtun
1c3d60c260 Convert overdraw in general case to special case
One of the big problems with transparency while using the vertex
buffer output is that repeated overdraw causes artifacts.
Inherintly that is not a problem if there is no overdraw except
zr_widget_field which relies on it for text selection. So I
previously used overdraw for every text, which caused problems.
With this update only zr_widget_field uses overdraw while
every normal text does not.
2016-02-01 09:26:22 +01:00
vurtun
b2e99df63d Added enter event to edit widget
Decided to add support for commit the content of a edit wiget
content by enter if a flag was set. Tried to add other flags
like auto complete but failed for now to find a good way.
Also more importantly added `zr_edit_box` to filter callback.
2016-02-01 09:26:22 +01:00
vurtun
88e40646b8 fixed missing C++ void* to char* cast 2016-01-31 20:12:05 +01:00
vurtun
983a23a130 Convert overdraw in general case to special case
One of the big problems with transparency while using the vertex
buffer output is that repeated overdraw causes artifacts.
Inherintly that is not a problem if there is no overdraw except
zr_widget_field which relies on it for text selection. So I
previously used overdraw for every text, which caused problems.
With this update only zr_widget_field uses overdraw while
every normal text does not.
2016-01-30 14:54:22 +01:00
vurtun
c628115369 Added enter event to edit widget
Decided to add support for commit the content of a edit wiget
content by enter if a flag was set. Tried to add other flags
like auto complete but failed for now to find a good way.
Also more importantly added `zr_edit_box` to filter callback.
2016-01-30 11:46:54 +01:00
vurtun
96fe7f7775 Added a global alpha modifier to zr_convert
Previously it was not possible to control the visibility or rather
the transparency of all render vertex buffer output. For that to
change another settings was added to zr_convert_config to control
the visibility. To achieve the same result as previously it is now
required to fill that property with 1.0f. To make all GUI element
as a whole more transparent a value between 0.0 and 1.0 can be
selected with 0.0 being completely hidden and 1.0f completly
visible.
2016-01-28 22:24:54 +01:00
vurtun
967b6feb30 updated Readme 2016-01-28 15:56:15 +01:00
vurtun
7fa59b8ba5 Removed commented out old code 2016-01-27 10:51:58 +01:00
vurtun
19a49780f7 Added event based updates back into examples
After some thought I decided to turn all examples back into
event based updated UIs. While it is possible to run all
examples without vsync with good performance it is probably best to
keep the examples in a accessable format which makes it possible
to be just by as many people as possible.
2016-01-26 22:52:09 +01:00
vurtun
5c8cc7228c removed tab input code 2016-01-26 21:38:54 +01:00
vurtun
9757f59c66 Finally fixed the oldest bug in this library
For now month I failed to find out why text calculation was
bugged for zahnrads own vertex buffer font. I finally found
the problem and fixed it.
2016-01-26 14:56:28 +01:00
vurtun
0970db1088 Removed event based updates for examples
Previously all examples used an event based update scheme since
they caused performance issues on Linux. Further testing revealed
that vsync + tripple buffering causes problems and just needs to be
turned off to smoothly run all examples.
2016-01-25 23:42:21 +01:00
vurtun
168c45e72c corrected combobox text background color
The selected item text of text combo boxes used the window color
as background instead of the combo box own background color.
2016-01-25 23:10:56 +01:00
vurtun
1365fb59ef Fixed text drawing for vertex buffer output
Previoulsy if you select text while using the vertex buffer
output inside a single line edit widget you would get a drawing bug
and the selected text would get transparent. This was caused by
overdraw by the selected text while the unselected text is still
visible.
To fix this behavior the text background is cleared before drawing.
This will cost another rectangle for each text which is quite
wasteful. Probably have to think about way to only draw the
rectangle if really necessary.
2016-01-25 22:41:35 +01:00
vurtun
fe2e863a72 Fixed currently active txt input user modification
If a currently active `zr_edit_string` or `zr_edit_buffer` string
buffers is modified outside both of these function then the
controlling cursor could get out of bounds.
To make sure this does not happen anymore I added some check to
make sure cursors are always valid.
2016-01-23 19:40:02 +01:00
vurtun
0bceb4b37d Removed disabled multiline editbox with scrollbar
Need to revert a previously added change to read only
edit boxes which deactivated the input but thereby
also deactivated the scrollbar behavior which is not
wanted.
2016-01-21 22:08:20 +01:00
vurtun
40c74cab1f updated contributing 2016-01-21 18:52:03 +01:00
vurtun
d4b89415e1 Added commiting changes in zr_property using enter
Previously if you want to edit the content if a zr_property the
cursor would appear at the beginning of the line which makes
editing the content cumbersome since you then have to move the
cursor to the end of the line to start editing. In addition
it was required to commit the edited value inside the zr_property
by clicking outside the zr_property.

With this commit if you click inside the property to start editing
the cursor will be placed at the end of the text input. In addition
it is now possible to commit written changes by pressing enter.
2016-01-21 18:46:54 +01:00
vurtun
69ec0178f9 Fixed logic for flag ZR_EDIT_READ_ONLY in zr_edit
zr_edit_string and zr_edit_buffer with varying flags did not have the
correct implementation for the read only mode flag and allowed
writing in some instances and showed a cursor while active
for other. Some additional check have been added to make sure that
read only edit buffer cannot be modified anymore.
2016-01-21 17:26:57 +01:00
vurtun
e015c447ec Added defines to prevent symbol collision with stb
If you already have stb_rect_pack.h and stb_truetype.h inside your
project zahnrad will cause symbol collisions since it will import
the implementation a second time.

To prevent this from happening I added two defines which can be set
to 1 to disable the implementation generation of both stb_truetype.h
as well as stb_rect_pack.h in zahnrad.
2016-01-21 00:41:02 +01:00
vurtun
c98153b59a removed need to pass string id to combobox 2016-01-20 19:36:40 +01:00
Micha Mettke
14a38dde61 Merge pull request #44 from richi/master
Show and hide onscreen keyboard
2016-01-20 13:49:57 +01:00
richi
67c5d53348 Calling zr_layout_peek first
Calling zr_layout_peek before zr_edit_string
2016-01-20 13:45:19 +01:00
richi
b73aa6ae74 Automatically show and hide the onscreen keyboard
This is an example how to show and hide a onscreen keyboard. The logic
is implemented in zr_touch_edit_string
2016-01-20 12:43:58 +01:00
richi
aa64398646 ifndef MIN, MAX and CLAMP
Does make live a lot easier for backends.
2016-01-20 12:35:31 +01:00
richi
ba9ca057f2 Merge remote-tracking branch 'vurtun/master' 2016-01-20 11:00:32 +01:00
vurtun
4e7c183aa6 Merge branch 'master' of https://github.com/vurtun/gui 2016-01-20 03:15:56 +01:00
vurtun
096cf3d27f extended to return more state information 2016-01-20 03:15:38 +01:00
Micha Mettke
a2e741d540 Merge pull request #43 from richi/master
Text input on iOS and tvOS
2016-01-20 02:15:40 +01:00