Example #1
0
int CGraphWnd::AddPoint(int graphnum, double x, double y, BOOL bRedraw, int index/* = -1*/)
{
    int ind, res;
    CGraphProps* graph = GetGraph(graphnum);
    if (graph == NULL) return -1;
    if (index == -1)
    {
        ind = graph->AddPoint(x, y, TRUE, &res);
    } else
    {
        ind = graph->InsertPoint(index, x, y, TRUE);
    };

    if (graph_frame != NULL)
    {
        SGraphChange sgc;
        sgc.graphnum = graphnum;
        sgc.index = ind;
        sgc.bRedraw = bRedraw;
        sgc.main_wnd_ptr = this;

        graph_frame->UpdateViews(GRAPH_POINT_ADDED, &sgc);
    };
    return index;
}