Commit Graph

796 Commits

Author SHA1 Message Date
vurtun
4eb939f4db Added additional API for simple color styles
Extended the quite complex style and skinning API with another easier
to use API to set the color scheme of the UI only from color.
2016-03-31 19:31:02 +02:00
vurtun
a2f1778689 fixed left aligned header 2016-03-30 20:09:36 +02:00
vurtun
0aeaf9a73c updated Readme 2016-03-30 20:09:20 +02:00
vurtun
1b0e8e0021 updated Readme 2016-03-30 16:21:05 +02:00
vurtun
ca5ec8c2a4 removed test code 2016-03-30 16:20:29 +02:00
vurtun
9c13fbafea Optimized memory consumption in zr_convert
Fixed allocation of a new vertex draw command if the old command is
empty and therefore can be updated without side effects.
2016-03-30 16:18:24 +02:00
vurtun
781202223d Added font atlas, default font + compiler switches
This commit extends the optional currently existing low level font
baking API with another more high level font atlas API.
The font atlas takes away some fine grained memory control from the
user but is easier to use and to understand than the lower level API.

I added combined with the font atlas a optional default font which
allows running the library without a user provided truetype font.
While user friendly it is quite big (~12kb) so I added a compiler flag
to remove it from the library while compiling if not wanted.

Finally I added some additional compiler flags to allow easier to use
APIs. The downside is that all of them require the standard library,
so if you don't want to add the standard C library I would recommend
deactivating all flags marked as standard library flags.
2016-03-30 12:54:22 +02:00
vurtun
f21c835363 fixed piemenu 2016-03-28 12:36:56 +02:00
vurtun
3d00689133 removed unused variable 2016-03-28 11:48:14 +02:00
vurtun
9aa4d6bd91 added flag checkbox 2016-03-28 00:24:27 +02:00
vurtun
87c70bab5a updated Readme 2016-03-26 17:54:16 +01:00
vurtun
fcba0e676b Added skinning and extend customization
Previous visual changes in the library were quite limited with some
colors and some global properties. This commit changes all that and
provides way more control over every widgets visual appearance.
Changes include extended color selection, per widget properties and
the possibility to use skinning.
While the new API allows for a lot more control it is currently quite
low level and needs a lot more testing and probably another higher
level style API to make changes in code easier. I also had to remove
the style modification code inside the demo and will probably first
try to write another higher level API before adding it back in.

This commit also include some breaking changes to existing code like
the missing style stack API and some widget names changes due to
added granularity granted by the rewritten style.
2016-03-26 16:05:19 +01:00
vurtun
f9ea095e77 Fixed compiling without vertex ouput compile flag
Defining compile flag ZR_COMPILE_WIDTH_VERTEX_BUFFER with 0 would
cause compiler errors. This is now fixed and every compile flag
combination should now work as intended.
2016-03-16 13:18:23 +01:00
vurtun
2cedc57f5d Extend default draw command API
The default draw command buffering API now supports filled and
outlined shapes as well as two additional commands: polygon and
polyline. While zahnrad only requires a small number of basic
filled draw command shapes to actual function the underlying canvas
to convert from draw commands to vertex buffer commands allows
for lot more. So the gap should now be filled and drawing more
complex custom is now a little bit easier. I thought about adding a
path drawing API to the draw command API but decided it is not
worth the hassle, at least for now.
2016-03-16 13:01:47 +01:00
vurtun
467118a86e Removed UI recording and revert to old version
I spend the last week(s) with lot of time thinking about this and I
came to the conclusion that recording it is not really worth doing.
In theory it could be interesting but the truth is I don't want to
do any more complex refactoring anymore and want to have a break
from extending this library. I spend over a year on this and I think
it is time for me to move on to other things. I will continue fixing
errors or adding requested essential smaller features but no
more complex rewrites or risky changes.
2016-03-15 21:12:25 +01:00
vurtun
5e54247f6a Fixed property dragging behavior 2016-03-09 19:43:10 +01:00
vurtun
4de0917c50 Fixed small color picker bug 2016-03-09 19:38:42 +01:00
vurtun
5d54d65894 Removed textual UI representation 2016-03-09 13:12:30 +01:00
vurtun
4f677d200e Fixed C++ build errors 2016-03-08 08:58:55 +01:00
vurtun
68edafcd0c Added 'Enter' and 'Leave' widget events 2016-03-08 08:50:21 +01:00
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