TChart::~TChart() { BckgBrush.DeleteObject(); DestroyElements(); menu1.DestroyMenu(); DestroyWindow(); }
void TChart::OnDestroy() { font1.DeleteObject(); font2.DeleteObject(); DestroyElements(); __super::OnDestroy(); }
void DefinitionParser::clear() { textLine_.clear(); parentsStack_.clear(); currentNumberedList_.clear(); numListsStack_.clear(); if (NULL != lastListNesting_) { free(lastListNesting_); lastListNesting_ = NULL; } DestroyElements(elements_); elements_.clear(); }
void TChart::InitBasicElements() { ColorsStyle tempStyle; TChartElement *elmnt=NULL; TChartAxis *taxis=NULL; AxisStyle style; DestroyElements(); void *x; if((x=buffer.GainAcsess(WRITE))!=NULL) { GetClientRect(&DrawArea); BMPanvasGuard guard(x); BMPanvas& bmp(guard); bmp.Create(this,DrawArea.Width(),DrawArea.Height(),24); bmp.SetBkMode(TRANSPARENT); elmnt=new TChartBackground("Background"); elmnt->Create(this,ColorsStyle(RGB(140,140,140))); elmnt->SetVisible(true);RegisterChartElement(elmnt); Frame=new TChartFrame("Frame"); Frame->Create(this,ColorsStyle(RGB(80,80,80))); Frame->SetVisible(true); RegisterChartElement(Frame); style.axisVisbl=style.ticksVisbl=style.gridVisbl=TRUE; style.layout=LEFT_AXIS; style.tickstyle=TICK_OUT; style.gridColor.PColor=RGB(140,140,140); taxis=new TChartAxisVertical("LeftAxis"); taxis->Create(Frame,style); LeftAxis=taxis; RegisterChartElement(taxis); style.layout=BOTTOM_AXIS; taxis=new TChartAxisHorizontal("BottomAxis"); taxis->Create(Frame,style); BottomAxis=taxis; RegisterChartElement(taxis); style.layout=RIGHT_AXIS; style.ticksVisbl=style.gridVisbl=FALSE; taxis=new TChartAxisVertical("RightAxis"); taxis->Create(Frame,style); RegisterChartElement(taxis); style.layout=TOP_AXIS; taxis=new TChartAxisHorizontal("TopAxis"); taxis->Create(Frame,style); RegisterChartElement(taxis); if(LeftAxis!=NULL) LeftAxis->SetMinMax(MinMax.minY,MinMax.maxY); if(BottomAxis!=NULL) BottomAxis->SetMinMax(MinMax.minX,MinMax.maxX); sbuf.Create(this,Frame->DrawArea.Width(),Frame->DrawArea.Height(),24); AreaOfInterest tempArea; tempArea=Frame->DrawArea; tempArea.Proceed=&TChart::OnPlotDblClick; Clickers.Add(tempArea); tempArea=CRect(LeftAxis->End,LeftAxis->Beg); tempArea.left-=20; tempArea.Proceed=&TChart::OnAxisDblClick; Clickers.Add(tempArea); UpdateNow(REPAINT_DEFAULT); } }