本文整理汇总了C++中CByteArray::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CByteArray::Copy方法的具体用法?C++ CByteArray::Copy怎么用?C++ CByteArray::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CByteArray
的用法示例。
在下文中一共展示了CByteArray::Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoWithRgn
void CPrefView::DoWithRgn(int ID)
{
int MaxL=m_pM->m_robast-1; //m_pG->m_scale->GetGradation()-1;
CByteArray* P;
int ps=0;
m_Grid.SetHighLight(0);
CApprox Model;
Model.SetDimention(2);
int maxDim=m_Grid.GetCols()*m_Grid.GetRows();
double *w=new double[maxDim];
double **MX=Model.Matrix(maxDim,2);
double xn[2];
int NumPoints=0;
int sl_ps=m_Slider.GetPos();
CString Buff=m_pG->m_scale->GetLex(ps);
int xx=m_Grid.GetCol(); int yy=m_Grid.GetRow();
int xs=m_Grid.GetColSel(); int ys=m_Grid.GetRowSel();
int i0=min(ys,yy); int i1=max(ys,yy);
int j0=min(xs,xx); int j1=max(xs,xx);
if (ID==ID_MENUITEM_UNDO)
{
P=(CByteArray*)m_UndoP.RemoveTail();
m_pM->m_P.Copy(*P);
delete P;
i0=1; i1=m_Grid.GetRows()-1;
j0=1; j1=m_Grid.GetCols()-1;
}
else
{
P=new CByteArray();
P->Copy(m_pM->m_P);
m_UndoP.AddTail(P);
if (m_UndoP.GetCount()>10)
{
P=(CByteArray*)m_UndoP.RemoveHead();
delete P;
}
}
if (ID==ID_MENUITEM_COPY) m_clP.SetSize(i1-i0+1);
if (ID==ID_MENUITEM_INSERT)
{
if (m_clP.GetSize()==0)
{
AfxMessageBox("В буфере не данных!!!");
return;
}
if ((i1==i0)&&(j1==j0))
{
i1=i0+m_clP.GetSize()-1;
j1=j0+m_clP[0].GetSize()-1;
}
if ((m_clP.GetSize()!=(i1-i0+1))
||(i1>=m_Grid.GetRows())||(j1>=m_Grid.GetCols()))
{
AfxMessageBox("Не верный размер области вставки");
return;
}
}
int n=m_pG->m_agr.GetCount();
int* u= new int[n];
for (int j=0; j<n; j++) u[j]=m_U[j];
m_ComboX.GetWindowText(Buff);
int x=GetIndex(Buff,m_pG);
int y=0;
m_ComboY.GetWindowText(Buff);
if (Buff!="") y=GetIndex(Buff,m_pG);
for (int i=i0; i<=i1; i++)
{
if (ID==ID_MENUITEM_COPY) m_clP[i-i0].SetSize(j1-j0+1);
if ((ID==ID_MENUITEM_INSERT)&&(m_clP[i-i0].GetSize()!=(j1-j0+1)))
{
AfxMessageBox("Не верный размер области вставки");
delete [] u;
return;
}
m_Grid.SetRow(i);
for (int j=j0; j<=j1; j++)
{
m_Grid.SetCol(j);
u[x]=j-1;
if (!Buff.IsEmpty()) u[y]=i-1;
switch (ID)
{
case ID_MENUITEM_INCL:
ps=m_pM->GetPreferance(u);
if (ps<MaxL) ps++;
break;
case ID_MENUITEM_DECL:
ps=m_pM->GetPreferance(u);
if ((ps>0)&&(ps<=MaxL)) ps--;
break;
case ID_MENUITEM_COPY:
ps=m_pM->GetPreferance(u);
m_clP[i-i0][j-j0]=ps;
break;
case ID_MENUITEM_INSERT:
//.........这里部分代码省略.........