4.2 步骤3添加菜单消息处理函数 (1)编辑对话框资源 左上角坐标(Ⅺ1,Y1) EditEdit 右下角坐标(×2,Y2) Edit Edit 确定 取消 静态文本框, IDC STATIO,左上角坐标(Ⅹ1,Y1) 静态文本框, IDC STATIO,右下角坐标(2,Y2) 编辑框, IDC EDIT X1 编辑框, IDC EDIT Y1 编辑框, IDC EDIT X2 编辑框, IDC EDIT Y2 按扭控件,IDOK,确定 按扭控件, IDCANCEL,取消
步骤3 添加菜单消息处理函数 (1) 编辑对话框资源 静态文本框,IDC_STATIC,左上角坐标(X1,Y1) 静态文本框,IDC_STATIC,右下角坐标(X2,Y2) 编辑框,IDC_EDIT_X1 编辑框,IDC_EDIT_Y1 编辑框,IDC_EDIT_X2 编辑框,IDC_EDIT_Y2 按扭控件,IDOK,确定 按扭控件,IDCANCEL,取消 4.2
4.2 步骤3添加菜单消息处理函数 (2)为对话框添加控件关联变量 IDC EDIT XI, int, m nXI IDC EDIT Y1, int, m nXI IDC EDIT X2, int, m nXl IDC EDIT Y2, int, m nXI (3)在主框架中加入变量并初始化 int m nRectLeft int m nRectTop int m nRectRight int m rEct bottom int m n CircleLeft int m n Circle Top int m n Circle right int m n Circle bottom
步骤3 添加菜单消息处理函数 (2)为对话框添加控件关联变量 IDC_EDIT_X1,int,m_nX1 IDC_EDIT_Y1,int,m_nX1 IDC_EDIT_X2,int,m_nX1 IDC_EDIT_Y2,int,m_nX1 (3)在主框架中加入变量并初始化 int m_nRectLeft; int m_nRectTop; int m_nRectRight; int m_nRectBottom; int m_nCircleLeft; int m_nCircleTop; int m_nCircleRight; int m_nCircleBottom; 4.2
4.2 步骤3添加菜单消息处理函数 CMainFrame: CMainFrameo l/ TODO: add member initialization code here m nRectLeft 50 m rEct Top =50 n nRectRight =200 n nRectBottom =150: m nCircleLeft 50 nCircle Top =50 m nCircle Right 200; m n circle bottom =150
CMainFrame::CMainFrame() { // TODO: add member initialization code here m_nRectLeft = 50; m_nRectTop = 50; m_nRectRight = 200; m_nRectBottom = 150; m_nCircleLeft = 50; m_nCircleTop = 50; m_nCircleRight = 200; m_nCircleBottom = 150; } 步骤3 添加菜单消息处理函数 4.2