more work on graph module.

This commit is contained in:
Martin Preuss
2024-06-16 23:59:09 +02:00
parent 43af8a8e75
commit 7ba618f832
2 changed files with 57 additions and 0 deletions

View File

@@ -21,6 +21,32 @@
<header type="sys" loc="pre">aqdiagram/graph/tick.h</header>
</headers>
<inlines>
<inline loc="end" access="public">
<content>
$(api) void $(struct_prefix)_AddNewTick($(struct_type) *st, const char *label, double v, int lvl, uint32_t flags);
</content>
</inline>
<inline loc="code">
<content>
void $(struct_prefix)_AddNewTick($(struct_type) *st, const char *label, double v, int lvl, uint32_t flags) \n
{ \n
AQDG_GRAPH_TICK *tick; \n
\n
tick=AQDG_Graph_Tick_new(); \n
AQDG_Graph_Tick_SetLabel(tick, label); \n
AQDG_Graph_Tick_SetValue(tick, v); \n
AQDG_Graph_Tick_SetLevel(tick, lvl); \n
AQDG_Graph_Tick_SetFlags(tick, flags); \n
if (st-&gt;tickList==NULL) \n
st-&gt;tickList=AQDG_Graph_Tick_List_new(); \n
AQDG_Graph_Tick_List_Add(tick, st-&gt;tickList); \n
} \n
</content>
</inline>
</inlines>
</lang>

View File

@@ -23,6 +23,8 @@
*/
static GWENHYWFAR_CB void _freeData(void *bp, void *p);
static int _calcContentDims(AQDG_OBJECT *object);
static int _draw(AQDG_OBJECT *object);
@@ -48,6 +50,9 @@ AQDG_OBJECT *AQDG_XAxisWidget_new(AQDG_OBJECT *parent, uint32_t options, AQDG_OB
xo->graphObject=graphObject;
xo->axisIndex=axisIndex;
AQDG_Object_SetCalcContentDimsFn(o, _calcContentDims);
AQDG_DrawableWidget_SetDrawFn(o, _draw);
return o;
}
@@ -65,4 +70,30 @@ GWENHYWFAR_CB void _freeData(void *bp, void *p)
int _calcContentDims(AQDG_OBJECT *object)
{
/* TODO
* - get axis
* - get ticks
* - calc max height of tick labels
* - add size of axis line + tick lines + spacing
*/
return 1;
}
int _draw(AQDG_OBJECT *object)
{
/* TODO */
return 1;
}