Commit Graph

926 Commits

Author SHA1 Message Date
vurtun b0cc043879 added missing ifdefs for windows 2016-03-08 08:44:31 +01:00
vurtun b09849f41a Added script to UI bytecode compile + file browser
This is quite a big commit which adds an experimental text script to
UI bytecode compiler. The compiler is still under heavy development
and can and will be under heavy changes, so use with caution.

In addition I added the old file browser for unix like platforms
back into the demo. At the moment it only supports windows but
the only part of the file browser that is platform dependend
is the directory content loader which should be easy to implement
in other platforms as well.
2016-03-07 18:17:15 +01:00
vurtun 5ac6e31128 updated Readme 2016-03-05 14:45:20 +01:00
vurtun 13104c91e7 updated readme 2016-03-04 20:46:45 +01:00
vurtun a52f25c7a8 Fixed small dynamic window/popup drawing bug 2016-03-04 18:51:49 +01:00
vurtun be1bf23385 Fixed property drag behavior #58 2016-03-04 17:37:57 +01:00
vurtun 32277127ac Added color picker widget
An additional widget for picking a color was added. Color picker use
the new draw call command multicolor rectangle which is not supported
everywhere. All demos using the optional vertex buffer output can use
the color picker without problems. Other platforms need to support
a drawing function or do not it.
2016-03-04 17:13:30 +01:00
vurtun 33af175b7e Added color conversion to and from hex string 2016-03-03 21:16:25 +01:00
vurtun bcec92f1de Fixed activation after exposing window
New windows who have been exposed now are directly activated and
the last activated window is now correctly deactivated. Previously
some cases in which no current window was active caused problem
like not working scrollbar.
2016-03-03 17:11:07 +01:00
vurtun 71fca46589 Updated Readme 2016-03-03 17:10:55 +01:00
vurtun 344be6eed2 Added window (de)activation into demo menu
Extended the demo window with a submenu which allows to activated or
deactivate windows. In this particular case the sequence in which the
control and demo window in contrast to all the other windows are
placed is important but only in this demo since querying is done by
the control window.
2016-03-03 14:36:28 +01:00
vurtun 7c0ad0aeb8 Fixed window hiding/exposing drawing bug
Toggling between hidden and shown window would previously cause
drawing bugs and in the worse case would destroy the drawing loop.
The bug is now fixed by stepping over each window which is hidden
inside the draw call loop.
2016-03-03 14:33:51 +01:00
vurtun 3d905b2451 Fixed small C++ error since `new` is a keyword 2016-03-03 13:17:32 +01:00
vurtun acb2a31b82 Fixed window hiding and exposing bug
Previously rapidly closing and exposing windows caused the library
to freeze. This had two reasons one was a bug in the list insert
and remove code the other was in the fact that if the currently
active window is removed no other window would active which resulted
in a blocking UI. Both problems are now fixed but there is a small
visual bug which is triggered if a window is toggled.
2016-03-03 13:12:20 +01:00
vurtun e847001728 Fixed small opcode format bug
The wrong opcode for `zr_layout_pop` caused a segmations fault.
The format is now fixed and everything should be ok now.
2016-03-03 11:07:59 +01:00
vurtun b0630e82d7 Fixed #57 C89 violations
C89 does not support or rather allow void pointer to function
pointer conversion and back. While gcc notices and warns
about the issue clang will just stay silent and let it slide.
So note to self compile with gcc to check for C89 violations.
2016-03-03 10:58:18 +01:00
vurtun 53a6a4590d Added the previously mising close window function 2016-03-02 19:06:31 +01:00
vurtun 047deec3cd Added time and date combobox to demo
Extended the demo with two additional very helpful comboboxes.
The first one is a simple time picker and the other one is a
date picker with year, month, week day selection.
2016-03-02 17:58:22 +01:00
vurtun ffe7d7586b Extended the chart API granularity
Two additional high level functions have been added using the chart
API for better ease of use. Both calculate the min and max value
while one works on an array and the other ones is based on a
callback.
2016-03-02 17:56:49 +01:00
vurtun 4c9eb66b7d Fixed #55 with `zr_window_set_focus` not working
While setting a window to active `zr_window_set_focus` did not
transfer the window on top of the window stack. This wrong
behavior should now be fixed and do what it is supposed to do.
2016-03-02 13:12:43 +01:00
vurtun 8159391640 Added Title alignment flags to menu header fix #53
Previously all menu titles were centered in X- and Y-axis without any
way to control the alignment. Since it was requested I added an
alignment flag to `zr_menu_text_begin`. To achieve the same outcome
like before this commit the flag has to be `ZR_TEXT_DEFAULT_CENTER`.
2016-03-02 09:45:06 +01:00
vurtun 1125016d0a Fixed simple allegro example text drawing bug
I forgot to change text drawing in the native allegro drawing API.
It should now be fixed and draw correctly. Furthmore I increased the
size of the demo window menu items to ensure that the checkbox text
is correctly drawn without clipping.
2016-03-01 19:52:18 +01:00
vurtun c19a6a1bbe Finished experimental recording features
First version supporting the new record and play feature which allows
to `record` a number of API calls and lets you replay them at a later
point of time. This could be the basis for creating an Editor and
other more advanced features. While I tested the functionality there
still could be a number of bugs and I would recommend waiting
until all bugs are removed before using it.
2016-03-01 18:48:19 +01:00
vurtun f035897056 second step 2016-02-28 14:00:10 +01:00
vurtun d0d5414164 first step 2016-02-24 13:19:39 +01:00
vurtun fc85f33e93 Fixed Readme example 2016-02-16 18:48:40 +01:00
vurtun ae1e3fc003 Fixed C++ errors that depend on typesafe enums
Fixed one of the small issues between C and C++. The handling of
enums. While C uses weak types and compiling `zr_flags` or
`enum zr_text_alignment` did not cause any problems, trying to do the
same with C++ results in errors or in this case a linking
error since while the function exist with `zr_flags` it does not
exist with `enum zr_text_alignment` (another problem of function
overloading...)
2016-02-16 13:42:20 +01:00
vurtun 9ab708e543 Fixed some c++ errors that slipped through 2016-02-15 19:37:31 +01:00
vurtun e4448f5881 Added additional widget utility functions 2016-02-15 19:03:21 +01:00
vurtun f727058044 Fixed rgb->hsv conversion and extended granularity
The conversion function from rgb color to hsv color was bugged and
provided wrong values. It is now fixed and hopefully is now correct.
In addition a number of utility functions have been added to make
conversion between user provided color format and zahnrads own
format easier.
2016-02-15 02:19:09 +01:00
vurtun 6adbb375de updated apple demos 2016-02-14 22:06:51 +01:00
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