Page 1 of 1

Add a Gauge at run time. Problems

Posted: Thu Nov 27, 2003 5:28 am
by 9078641
After creating a gauge at run time it is visble, but I cannot access it to do anything with it.

m_ChartGauge.Series(0).GetAsGauge().SetValue(50.0); // does not work

Here is the create() function of a formview where I also create the gauge.

BOOL C_ControlPanel::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
if ( ! CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext) )
{
return false;
}

if (!m_ChartGauge.Create(lpszClassName,
"",
dwStyle,
CRect(0,300,120,400),
this,
IDC_TCHART_GAUGE,
pContext ))
{
return FALSE;
}

m_ChartGauge.SetVisible(true); // OK the gauge iis visible

m_ChartGauge.AddSeries(scGauge); // is this needed ?

m_ChartGauge.Series(0).GetAsGauge().SetValue(50.0); // does not work

return TRUE;

}

Posted: Sun Nov 30, 2003 8:18 pm
by Pep
>m_ChartGauge.AddSeries(scGauge); // is this needed ?
Where are you creating the scGauge series ?

Could you please send me one example with which I can reproduce the problem "as is" here.
You can send it to the steema.public.attachments newsgroup or to pep@steema.com

Josep Lluis Jorge
http://support.steema.com