Добавил:
Yanus
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:lab - pasha / Laboratory works / page4
.cpp// page4.cpp : implementation file
//
#include "stdafx.h"
#include "Laboratory works.h"
#include "page4.h"
#include "math.h"
page4 *cd4;
// page4 dialog
IMPLEMENT_DYNAMIC(page4, CDialog)
page4::page4(CWnd* pParent /*=NULL*/)
: CDialog(page4::IDD, pParent)
, edk(0)
{
}
page4::~page4()
{
}
void page4::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, edk);
DDV_MinMaxInt(pDX, edk, 0, 32766);
DDX_Control(pDX, IDC_LIST1, maxlist);
DDX_Control(pDX, IDC_LIST2, minlist);
}
BEGIN_MESSAGE_MAP(page4, CDialog)
ON_EN_CHANGE(IDC_EDIT1, OnEnChangeEdit1)
ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
ON_LBN_SELCHANGE(IDC_LIST1, OnLbnSelchangeList1)
ON_LBN_SELCHANGE(IDC_LIST2, OnLbnSelchangeList2)
END_MESSAGE_MAP()
// page4 message handlers
void page4::OnEnChangeEdit1()
{
UpdateData(TRUE);
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void page4::OnBnClickedButton1()
{ int min,max,bufmax,bufmin;
char strmin[10];
char strmax[10];
min=0;
max=0;
if (edk==0) {maxlist.AddString("0"); minlist.AddString("0");}
else {
min=fmod(edk,10); //itoa(min,strmin,10); minlist.AddString(strmin);
max=fmod(edk,10);
while(edk>=1) {
bufmin=fmod(edk,10); bufmax=fmod(edk,10);
edk=edk/10;
if (bufmin<min) min=bufmin;
if (bufmax>max) max=bufmax; }
itoa(min,strmin,10); minlist.AddString(strmin);
itoa(max,strmax,10); maxlist.AddString(strmax);
}
// TODO: Add your control notification handler code here
}
void page4::OnLbnSelchangeList1()
{
// TODO: Add your control notification handler code here
}
void page4::OnLbnSelchangeList2()
{
// TODO: Add your control notification handler code here
}
Соседние файлы в папке Laboratory works