WWW.REFERATCENTRAL.ORG.UA - Я ТУТ НАВЧАЮСЬ

... відкритий, безкоштовний архів рефератів, курсових, дипломних робіт

ГоловнаІнформатика, Компютерні науки → Розробка обўєктно-орієнтованих програм мовою C++ в середовищі Windows 95/98 (на основі бібліотеки MFC пакету VISUAL C++ 6.0) - Курсова робота

Розробка обўєктно-орієнтованих програм мовою C++ в середовищі Windows 95/98 (на основі бібліотеки MFC пакету VISUAL C++ 6.0) - Курсова робота


while(isdigit(str1[n]))
{
t[i++]=str1[n];
n++;
}
if(i>0)
{t[i]='';i=0;arr[m++]=atoi(t);}
n++;
}
int a=50,b=80;
i=0;
//initialization of matrix by the numbers inputed in edit box
//int matrix[20][20];
for(m=0;mfor(n=0;nmatrix[m][n]=arr[i++];
_int16 *NewArray16=new _int16[ind*inde];
m=0;
for(i=0;ifor(j=0;jNewArray16[m++]=(_int16)matrix[i][j];
for(m=0;mSetCheck(radio1);
cbpr2->SetCheck(radio2);
cbpr3->SetCheck(radio3);
return TRUE; */
{
char temp1[10];
CDialog::OnInitDialog();
CListBox *d=(CListBox*)GetDlgItem(IDC_LIST2);
for(int i1=0;i1AddString(temp1);
}
char temp2[10];
CDialog::OnInitDialog();
CListBox *k=(CListBox*)GetDlgItem(IDC_LIST3);
for(int i2=0;i2AddString(temp2);
}
return TRUE;
}
void CMyDialog::OnLIST2()
{
//here we are getting list pointer with indentifier IDC_LIST1
CListBox* lbd=(CListBox*)GetDlgItem(IDC_LIST2);
//after obtaining the pointer,we are defining index of selected element
inde=lbd->GetCurSel();
//find out name of selected element
lbd->GetText(inde,listStr);
MessageBox(listStr,"Selection is");
}
void CMyDialog::OnLIST3()
{
//here we are getting list pointer with indentifier IDC_LIST1
CListBox* lbk=(CListBox*)GetDlgItem(IDC_LIST3);
//after obtaining the pointer,we are defining index of selected element
ind=lbk->GetCurSel();
//find out name of selected element
lbk->GetText(ind, listStr);
MessageBox(listStr,"Selection is");
}
float C;
const char szPashaWndTitle[] = "Pasha's application uses MFC";
const StepNum = 20;
bool bRunned;
class CPashaWnd : public CFrameWnd
{
public:
_int16 *NewArray16;
CPashaWnd()
{
NumOfRow = 2;
bRunned = false;
RECT r;
r.top=r.left=50;
r.bottom=r.right=500;
Create(NULL,"In any business the most difficul is beginning",
WS_OVERLAPPEDWINDOW|WS_VISIBLE,r,NULL,MAKEINTRESOURCE(IDR_MENU1));
};
~CPashaWnd() {};
afx_msg void OnOPEN();
afx_msg void OnHELP();
afx_msg void OnSAVE();
afx_msg void OnINFO();
afx_msg void OnRENAME();
afx_msg void OnCreateChildWindow();
afx_msg void OnQUIT();
afx_msg void OnDialog();
afx_msg void OnRUUN();
afx_msg void OnRESULT();
afx_msg void OnPaint();
afx_msg void OnRogy();
afx_msg void OnINPUT();
DECLARE_MESSAGE_MAP()
int NumOfRow;
};
BEGIN_MESSAGE_MAP( CPashaWnd, CFrameWnd)
ON_COMMAND( ID_CHILD,OnCreateChildWindow)
ON_COMMAND( ID_CHILDNEXT,OnRogy)
ON_COMMAND( ID_FILE_OPEN, OnOPEN)
ON_COMMAND( ID_FILE_INFO, OnINFO)
ON_COMMAND( ID_FILE_HELP, OnHELP)
ON_COMMAND( ID_FILE_SAVE, OnSAVE)
ON_COMMAND( ID_RUUN_RUUN, OnRUUN)
ON_COMMAND( AFX_ID_FILE_RENAME, OnRENAME)
ON_COMMAND( AFX_ID_FILE_QUIT, OnQUIT)
// ON_COMMAND( AFX_ID_RUN_RUN, OnRUN)
ON_COMMAND( AFX_ID_RESUET_RESUET, OnRESULT)
ON_COMMAND( AFX_ID_FILE_Dialog, OnDialog)
END_MESSAGE_MAP()
//-------------------------------------------------------------------
class CChildWnd:public CFrameWnd
{
protected:
POINT p;
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP();
public:
CChildWnd(CWnd *pParent)
{
CRect wndSize(0,0,300,300);
Create(NULL,"ChildWindow",WS_OVERLAPPEDWINDOW|
WS_CHILD,wndSize,pParent);
}
};
BEGIN_MESSAGE_MAP(CChildWnd,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
void CChildWnd::OnPaint()
{
CPaintDC dc(this);
if (!bRunned)
{
char str2[20];
CPen pen,pen1;
CRect rect;
CString tmp = _T("");
sprintf(str2," %f ",average);
pen.CreatePen(PS_SOLID, 2, RGB(0,250,0));
pen1.CreatePen(PS_SOLID, 2, RGB(255,255,255));
dc.SelectObject(&pen);
GetClientRect(&rect);
int step = (rect.right - rect.left) / StepNum;
int x = average * step + 50;
step = (rect.bottom - rect.top) / Nmax;
pen.DeleteObject();
CBrush brush,brush1,brush2,brush3;
brush.CreateSolidBrush(RGB(255,255,255));
brush2.CreateSolidBrush(RGB(255,200,255));
brush3.CreateSolidBrush(RGB(0,0,0));
brush1.CreateSolidBrush(RGB(255,255,255));
dc.SelectObject(&brush);
int y = rect.bottom - index*step;
int k,d,dy = 1;
int flag=1;
int top = 5;
k = top;
while(top < y)
{
dc.SelectObject(&brush2);
dc.SelectObject(&pen);
dc.Ellipse(x, k, x+30, k-30);
for(d=0;dy)
{ k = y;
dy = -dy/2;
flag = -1;
top += step; }
if(k0)
{t[i]='';i=0;arr[m++]=atoi(t);}
n++;
}
int a=50,b=80;
i=0;
//initialization of matrix by the numbers inputed in edit box
//int matrix[20][20];
for(m=0;mfor(n=0;nmatrix[m][n]=arr[i++];
_int16 *NewArray16=new _int16[ind*inde];
m=0;
for(i=0;ifor(j=0;jNewArray16[m++]=(_int16)matrix[i][j];
for(m=0;m{
NewArray16[m]=(_int16)matrix[i][j];
if(j==inde)
{
i++;j=0;
}
j++;
if(i==ind)
break;
}
int x=40,y=50;char buf[10];
//filling the screen by numbers that are in matrix
int temp;
int max = matrix[0][ind-1];
dc.TextOut(x,y-20,"Matrix");
for(m=0;m{
for(n=0;n{
temp=matrix[m][n];
sprintf(buf,"%d",temp);
dc.TextOut(x,y,buf,strlen(buf));
x+=30;
}
y+=20;
x=40;
}
{
//for (i = 0; i max)
//max=matrix[i][ind - i - 1];
}
ifstream in("out.dat");
if(!in)
cout<> min >> max >> average;
in.close();
}; max = 10;
dc.TextOut(50,180,"Mах");
sprintf(buf,"%d",max);
dc.TextOut(90,180,buf);
}
//------------------------------------------------------------------
/*void CPashaWnd::OnRUN()
{
CClientDC dc(this);
char t[10];
int arr[10];
int i=0,n=0,j=0,m=0;
while(str1[n]!='')
{
while(isdigit(str1[n]))
{
t[i++]=str1[n];
n++;
}
if(i>0)
{t[i]='';i=0;arr[m++]=atoi(t);}
n++;
}
int a=50,b=80;
i=0;
//initialization of matrix by the numbers inputed in edit box
//int matrix[20][20];
for(m=0;mfor(n=0;nmatrix[m][n]=arr[i++];
_int16*NewArray16=new _int16[ind*inde];
m=0;
for(i=0;ifor(j=0;jNewArray16[m++]=(_int16)matrix[i][j];
for(m=0;m{
NewArray16[m]=(_int16)matrix[i][j];
if(j==inde)
{
i++;j=0;
}
j++;
if(i==ind)
break;
}
/*int x=40,y=50;char buf[10];
//filling the screen by numbers that are in matrix
int temp;
dc.TextOut(x,y-20,"Matrix");
for(m=0;m{
for(n=0;n{
Loading...

 
 

Цікаве