Je voie que la moquerie est de mise ... ( salut à toi djibasaran )
difficile de mettre un bout de code car tout est imbriqué.
peut-etre ca ? c'est ce que je fais normalement partout ...
void COscilloUSBDlg::OnPaint()
{
if(!Refresh)
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
CRect rectAff;
CDC *pDC1 =m_color_CH1.GetDC();
m_color_CH1.GetClientRect(rectAff); PaintPDC(pDC1,rectAff,Systeme.Color.CH1);
CDC *pDC2 =m_color_CH2.GetDC();
m_color_CH2.GetClientRect(rectAff); PaintPDC(pDC2,rectAff,Systeme.Color.CH2);
CDC *pDC3 =m_color_CH3.GetDC();
m_color_CH3.GetClientRect(rectAff); PaintPDC(pDC3,rectAff,Systeme.Color.CH1);
CDC *pDC4 =m_color_CH4.GetDC();
m_color_CH4.GetClientRect(rectAff); PaintPDC(pDC4,rectAff,Systeme.Color.CH2);
CDC *pDC5 =m_color_CH5.GetDC();
m_color_CH5.GetClientRect(rectAff); PaintPDC(pDC5,rectAff,Systeme.Color.XY);
CDC *pDC6 =m_color_Curseur.GetDC();
m_color_Curseur.GetClientRect(rectAff); PaintPDC(pDC6,rectAff,Systeme.Color.CURSEUR);
RefreshGraph(this,true);
}
void RefreshGraph(PVOID para,bool All)
{
COscilloUSBDlg *Dlg=(COscilloUSBDlg*)para;
CDC *pDC1=Dlg->m_Picture1.GetDC();
CDC *pDC2=Dlg->m_Picture2.GetDC();
Dlg->m_Picture1.GetClientRect(rectAff1);
Dlg->m_Picture2.GetClientRect(rectAff2);
if(Systeme.LanceAcqui)
Redraw(pDC1,rectAff1,pDC2,rectAff2,Systeme.GraphTypeLine,Oscillo,All);
else
Redraw(pDC1,rectAff1,pDC2,rectAff2,Systeme.GraphTypeLine,SaveOscillo,All);
Dlg->ReleaseDC(pDC1);
Dlg->ReleaseDC(pDC2);
}
void Redraw(CDC *pDC1,CRect rectAff1,CDC *pDC2,CRect rectAff2,byte Mode,_OSCILLO pOscillo,bool All)
{
/************************************************************/
/************************************************************/
long lOscilloMaxData,Xea,Yea,i;
CRect MiniRect;
CBrush brush,*oldbrush;
double tempo;
/*--------------------------------------------------------*/
/* Recupere le context de peripherique et Affiche l'ecran */
/*--------------------------------------------------------*/
brush.CreateSolidBrush(RGB(192,192,192));
if(All) pDC2->Rectangle(rectAff2);
MiniRect=rectAff2;
AfficheEcran(pDC1,rectAff1,All);
/*--------------------------------------------------------*/
/* Boucle Tant que l'on a pas tout affiché */
/*--------------------------------------------------------*/
if(Acqui.Redraw.Enable)
{
//----------------------------------------------------------------------------//
if(!Systeme.LanceAcqui && All)
{
tempo = (double)MiniRect.right/8000*Acqui.Redraw.AdressStart;
MiniRect.left= (int) tempo;
tempo = (double)MiniRect.right/8000 * (Acqui.Redraw.AdressStart+Acqui.Redraw.NbEchantillons);
MiniRect.right=(int) tempo;
oldbrush=pDC2->SelectObject(&brush);
pDC2->Rectangle(MiniRect);
pDC2->SelectObject(oldbrush);
i=0;
lOscilloMaxData = 8000;
Yea = rectAff2.Height();
Xea = rectAff2.Width() / lOscilloMaxData;
Xea=0;
do
{
if(pOscillo.paraCANAL[0].On)AffichePoint(pDC2,rectAff2,Xea,Acqui.Buffer1[i],Systeme.Color.CH1);
if(pOscillo.paraCANAL[1].On)AffichePoint(pDC2,rectAff2,Xea,Acqui.Buffer2[i],Systeme.Color.CH2);
Xea = i++ * rectAff2.right/lOscilloMaxData;
}
while(i<Acqui.Redraw.AdressMax);
}
//----------------------------------------------------------------------------//
i=0;
lOscilloMaxData = 10*pOscillo.paraBASETEMPS.PointDiv;
Yea = rectAff1.Height();
Xea = rectAff1.Width() / lOscilloMaxData;
Xea=0;
if(Acqui.Redraw.AdressStart) Systeme.RedrawMemory=true;
do
{
Affichage(pDC1,rectAff1,Acqui.Redraw.AdressStart+i,Xea,Mode,pOscillo.paraCANAL[0].On,pOscillo.paraCANAL[1].On);
Xea = i++ * rectAff1.right/lOscilloMaxData;
}
while(i<Acqui.Redraw.NbEchantillons);
//----------------------------------------------------------------------------//
}
}
voilà je veux bien t'envoyer le code mais c'est barbare car tout imbriqué ... si tu peux m'aider Vecchio je suis preneur
sinon pour mon probleme de CheckBox qui disparait ? pas d'idée.... ?
MisterMok