more work on graph module.
This commit is contained in:
@@ -21,6 +21,32 @@
|
|||||||
<header type="sys" loc="pre">aqdiagram/graph/tick.h</header>
|
<header type="sys" loc="pre">aqdiagram/graph/tick.h</header>
|
||||||
</headers>
|
</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->tickList==NULL) \n
|
||||||
|
st->tickList=AQDG_Graph_Tick_List_new(); \n
|
||||||
|
AQDG_Graph_Tick_List_Add(tick, st->tickList); \n
|
||||||
|
} \n
|
||||||
|
</content>
|
||||||
|
</inline>
|
||||||
|
</inlines>
|
||||||
|
|
||||||
</lang>
|
</lang>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static GWENHYWFAR_CB void _freeData(void *bp, void *p);
|
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->graphObject=graphObject;
|
||||||
xo->axisIndex=axisIndex;
|
xo->axisIndex=axisIndex;
|
||||||
|
|
||||||
|
AQDG_Object_SetCalcContentDimsFn(o, _calcContentDims);
|
||||||
|
AQDG_DrawableWidget_SetDrawFn(o, _draw);
|
||||||
|
|
||||||
return o;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user