home *** CD-ROM | disk | FTP | other *** search
- // MfcAppDlg.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include <afxcview.h>
- #include "mfcapp.h"
- #include "varlist.h"
- #include "MfcAppDlg.h"
- #include "sds.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- #define ARRAYELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
-
- /////////////////////////////////////////////////////////////////////////////
- // CMfcAppDlg dialog
-
- CMfcAppDlg::CMfcAppDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CMfcAppDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMfcAppDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
- void CMfcAppDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMfcAppDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CMfcAppDlg, CDialog)
- //{{AFX_MSG_MAP(CMfcAppDlg)
- ON_NOTIFY(NM_CLICK, IDC_VAR_LIST, OnDblclkVarList)
- ON_NOTIFY(NM_DBLCLK, IDC_VAR_LIST, OnDblclkVarList)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMfcAppDlg message handlers
-
- BOOL CMfcAppDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- LV_COLUMN lvcol;
- char sBuffer[50];
-
- // First set up the headers in the list conrol.
- CListCtrl* pVarList = (CListCtrl*)GetDlgItem(IDC_VAR_LIST);
-
- // Column 1.
- lvcol.mask = LVCF_TEXT | LVCF_WIDTH;
- lvcol.iSubItem = 0;
- lvcol.cx = 100;
- strcpy(sBuffer, "SysVar");
- lvcol.pszText = sBuffer;
- lvcol.cchTextMax = strlen(sBuffer);
- pVarList->InsertColumn(0, &lvcol);
-
- // Column 2.
- lvcol.cx = 245;
- strcpy(sBuffer, "Value");
- lvcol.cchTextMax = strlen(sBuffer);
- pVarList->InsertColumn(1, &lvcol);
-
- // Now populate the list.
- AddItems();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void CMfcAppDlg::OnDblclkVarList(NMHDR* pNMHDR, LRESULT* pResult)
- {
- char sXBuf[10], sYBuf[10], sZBuf[10], text[100], tmp[255];
- int index, resVal;
- sds_resbuf result;
-
- BOOL readOnly = FALSE;
- is2DPoint = FALSE;
- CListCtrl* pVarList = (CListCtrl*)GetDlgItem(IDC_VAR_LIST);
-
- // Look for the selected item. We'll go backwards just for sport.
- for(index = (pVarList->GetItemCount()-1); index!=-1; --index) {
- if (pVarList->GetItemState(index,LVIS_SELECTED)) {
- pVarList->GetItemText(index, 0, text, 100);
- break;
- }
- }
-
- // Now re-check the string in the array for a leading underscore.
- // If one exists, this is a read only variable. In such a case,
- // we will simply put up a message box with the current value and
- // an OK button.
- readOnly = varlist[index][0] == '_' ? TRUE : FALSE;
-
- // Now get the current value of the variable selected.
- sds_getvar(text, &result);
-
- switch (result.restype) {
- case RTSTR: // This is a string variable.
- {
- // If this variable is read only, put up a message box with
- // the current value.
- if (readOnly) {
- char msg[255];
- if (!strlen(result.resval.rstring))
- sprintf(msg, "%s not currently set.", text);
- else
- sprintf(msg, "%s currently %s.", text, result.resval.rstring);
- MessageBox( msg, "Read Only variable:", MB_OK);
- return;
- }
-
- CStrDlg inPutDlg(this);
- // Since MFC supplies us with Dialog Data Exchange and Validation,
- // All we need to do is set the edit boxes variable to the current
- // value of the variable, and it will appear in the dialog as the
- // default when the dialog is displayed. Magic.
- inPutDlg.m_NewVal = result.resval.rstring;
-
- // Now show the dialog.
- int retVal = inPutDlg.DoModal();
- if (retVal == IDOK) { // OK was pressed.
- // Make sure we have enough string space to copy what the user
- // has entered into the edit field.
- result.resval.rstring = (char*)malloc(strlen(LPCSTR(inPutDlg.m_NewVal)) + 1);
- // Pressing OK with Dialog Data Exchange updates the variable for us.
- strcpy(result.resval.rstring , inPutDlg.m_NewVal);
- // Now actually set the variable to what the user has requested.
- // Icad will let us know if it was a bogus value.
- resVal = sds_setvar(text, &result);
-
- // If the value was ok, the update the List control.
- if (resVal == RTNORM) {
- LV_ITEM lvitem;
- lvitem.iItem = index;
- lvitem.pszText = result.resval.rstring ;
- lvitem.mask = LVIF_TEXT;
- lvitem. stateMask = 0;
- lvitem.iSubItem = 1;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
- pVarList->SetItem(&lvitem);
- } else {
- // sds_setvar() has returned RTERROR for some reason.
- // So let the user know.
- sprintf(tmp, "Unable to set %s to %s!", text, result.resval.rstring);
- AfxMessageBox(tmp, MB_OK, 0);
- }
- // Remove string space allocated above.
- free(result.resval.rstring);
- }
- }
- break;
-
- case RTREAL:
- {
- // If this variable is read only, put up a message box with
- // the current value.
- if (readOnly) {
- char msg[255];
- sprintf(msg, "%s currently %f.", text, result.resval.rreal);
- MessageBox(msg, "Read Only variable:", MB_OK);
- return;
- }
-
- CRealDlg inPutDlg(this);
- char tmpBuffer[50];
- inPutDlg.m_RealVal = result.resval.rreal;
- // Since MFC supplies us with Dialog Data Exchange and Validation,
- // All we need to do is set the edit boxes variable to the current
- // value of the variable, and it will appear in the dialog as the
- // default when the dialog is displayed. Magic.
-
- // Now show the dialog.
- int retVal = inPutDlg.DoModal();
-
- if (retVal == IDOK) { // OK was pressed.
- // Pressing OK with Dialog Data Exchange updates the variable for us.
- result.resval.rreal = inPutDlg.m_RealVal;
- // Now actually set the variable to what the user has requested.
- // Icad will let us know if it was a bogus value.
- resVal = sds_setvar(text, &result);
-
- // If the value was ok, the update the List control.
- if (resVal == RTNORM) {
- LV_ITEM lvitem;
- lvitem.iItem = index;
- FloatToString(result.resval.rreal, tmpBuffer, 6);
- lvitem.pszText = tmpBuffer;
- lvitem.mask = LVIF_TEXT;
- lvitem. stateMask = 0;
- lvitem.iSubItem = 1;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
- pVarList->SetItem(&lvitem);
- } else {
- // sds_setvar() has returned RTERROR for some reason.
- // So let the user know.
- sprintf(tmp, "Unable to set %s to %f!", text, result.resval.rstring);
- MessageBox(tmp, MB_OK, 0);
- }
- }
- }
- break;
- case RTSHORT:
- {
- // If this variable is read only, put up a message box with
- // the current value.
- if (readOnly) {
- char msg[255];
- sprintf(msg, "%s currently %d.", text, result.resval.rint);
- MessageBox(msg, "Read Only variable:", MB_OK);
- return;
- }
-
- CShortDlg inPutDlg(this);
- char tmpBuffer[50];
- // Since MFC supplies us with Dialog Data Exchange and Validation,
- // All we need to do is set the edit boxes variable to the current
- // value of the variable, and it will appear in the dialog as the
- // default when the dialog is displayed. Magic.
- inPutDlg.m_IntVal = result.resval.rint;
-
- // Now show the dialog.
- int retVal = inPutDlg.DoModal();
- if (retVal == IDOK) { // OK was pressed.
- // Pressing OK with Dialog Data Exchange updates the variable for us.
- result.resval.rint = inPutDlg.m_IntVal;
- // Now actually set the variable to what the user has requested.
- // Icad will let us know if it was a bogus value.
- resVal = sds_setvar(text, &result);
-
- // If the value was ok, the update the List control.
- if (resVal == RTNORM) {
- LV_ITEM lvitem;
- lvitem.iItem = index;
- itoa(result.resval.rint, tmpBuffer, 10);
- lvitem.pszText = tmpBuffer;
- lvitem.mask = LVIF_TEXT;
- lvitem. stateMask = 0;
- lvitem.iSubItem = 1;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
- pVarList->SetItem(&lvitem);
- } else {
- // sds_setvar() has returned RTERROR for some reason.
- // So let the user know.
- sprintf(tmp, "Unable to set %s to %d!", text, result.resval.rint);
- MessageBox(tmp, MB_OK, 0);
- }
- }
- }
- break;
-
- case RTPOINT:
- {
- is2DPoint = TRUE;
- // If this variable is read only, put up a message box with
- // the current value.
- if (readOnly) {
- char msg[255];
- sprintf(msg, "%s currently ", text);
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcat(msg, " (");
- strcat(msg, sXBuf);
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(msg, " ");strcat(msg, sYBuf);strcat(msg, ")");
-
- MessageBox(msg, "Read Only variable:", MB_OK);
- return;
- }
-
- CPointDlg inPutDlg(this);
- char tmpBuffer[50];
- // Since MFC supplies us with Dialog Data Exchange and Validation,
- // All we need to do is set the edit boxes variable to the current
- // value of the variable, and it will appear in the dialog as the
- // default when the dialog is displayed. Magic.
- inPutDlg.m_Point_X = result.resval.rpoint[0];
- inPutDlg.m_Point_Y = result.resval.rpoint[1];
-
- // Now show the dialog.
- int retVal = inPutDlg.DoModal();
- if (retVal == IDOK) { // OK was pressed.
- // Pressing OK with Dialog Data Exchange updates the variable for us.
- result.resval.rpoint[0] = inPutDlg.m_Point_X;
- result.resval.rpoint[1] = inPutDlg.m_Point_Y;
- // Now actually set the variable to what the user has requested.
- // Icad will let us know if it was a bogus value.
- resVal = sds_setvar(text, &result);
-
- // If the value was ok, the update the List control.
- if (resVal == RTNORM) {
- LV_ITEM lvitem;
- lvitem.iItem = index;
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcpy(tmpBuffer, "(");
- strcat(tmpBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sYBuf);strcat(tmpBuffer, ")");
-
- lvitem.pszText = tmpBuffer;
- lvitem.mask = LVIF_TEXT;
- lvitem. stateMask = 0;
- lvitem.iSubItem = 1;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
- pVarList->SetItem(&lvitem);
- } else {
- // sds_setvar() has returned RTERROR for some reason.
- // So let the user know.
-
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcpy(tmpBuffer, "(");
- strcat(tmpBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sYBuf);strcat(tmpBuffer, ")");
- sprintf(tmp, "Unable to set %s to %s!", text, tmpBuffer);
- MessageBox(tmp, MB_OK, 0);
- }
- }
- }
- break;
- case RT3DPOINT:
- {
- // If this variable is read only, put up a message box with
- // the current value.
- if (readOnly) {
- char msg[255];
- sprintf(msg, "%s currently ", text);
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcat(msg, " (");
- strcat(msg, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(msg, " ");strcat(msg, sYBuf);
-
- FloatToString(result.resval.rpoint[2], sZBuf, 6);
- strcat(msg, " ");strcat(msg, sZBuf);strcat(msg, ")");
-
- MessageBox(msg, "Read Only variable:", MB_OK);
- return;
- }
-
- CPointDlg inPutDlg(this);
- char tmpBuffer[50];
-
- // Since MFC supplies us with Dialog Data Exchange and Validation,
- // All we need to do is set the edit boxes variable to the current
- // value of the variable, and it will appear in the dialog as the
- // default when the dialog is displayed. Magic.
- inPutDlg.m_Point_X = result.resval.rpoint[0];
- inPutDlg.m_Point_Y = result.resval.rpoint[1];
- inPutDlg.m_Point_Z = result.resval.rpoint[2];
-
- // Now show the dialog.
- int retVal = inPutDlg.DoModal();
- if (retVal == IDOK) { // OK was pressed.
- // Pressing OK with Dialog Data Exchange updates the variable for us.
- result.resval.rpoint[0] = inPutDlg.m_Point_X;
- result.resval.rpoint[1] = inPutDlg.m_Point_Y;
- result.resval.rpoint[2] = inPutDlg.m_Point_Z;
- // Now actually set the variable to what the user has requested.
- // Icad will let us know if it was a bogus value.
- resVal = sds_setvar(text, &result);
-
- // If the value was ok, the update the List control.
- if (resVal == RTNORM) {
- LV_ITEM lvitem;
- lvitem.iItem = index;
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcpy(tmpBuffer, "(");
- strcat(tmpBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sYBuf);
-
- FloatToString(result.resval.rpoint[1], sZBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sZBuf);strcat(tmpBuffer, ")");
-
- lvitem.pszText = tmpBuffer;
- lvitem.mask = LVIF_TEXT;
- lvitem. stateMask = 0;
- lvitem.iSubItem = 1;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
- pVarList->SetItem(&lvitem);
- } else {
- // sds_setvar() has returned RTERROR for some reason.
- // So let the user know.
-
- // Floats need to be converted to strings.
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- // Build up the string we are about to put in the
- // message box.
- strcpy(tmpBuffer, "(");
- strcat(tmpBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sYBuf);
-
- FloatToString(result.resval.rpoint[1], sZBuf, 6);
- strcat(tmpBuffer, " ");strcat(tmpBuffer, sZBuf);strcat(tmpBuffer, ")");
-
- sprintf(tmp, "Unable to set %s to %s!", text, tmpBuffer);
- MessageBox(tmp, MB_OK, 0);
- }
- }
- }
- break;
- default:
- break;
- }
-
- *pResult = 0;
- }
-
- void CMfcAppDlg::AddItems()
- {
- LV_ITEM lvitem;
- char sBuffer[100];
- char sXBuf[15], sYBuf[15], sZBuf[15];
- sds_resbuf result;
- BOOL readOnly = FALSE;
-
- CListCtrl* pVarList = (CListCtrl*)GetDlgItem(IDC_VAR_LIST);
-
- for (int i = 0; i < ARRAYELEMENTS(varlist); i++) {
-
- strcpy(sBuffer, varlist[i]);
-
- lvitem.iItem = i;
- lvitem.pszText = NULL;
- lvitem.mask = LVIF_TEXT;
- lvitem.stateMask = 0;
- lvitem.iSubItem = 0;
- lvitem.iImage = 0;
- lvitem.lParam = NULL;
- lvitem.iIndent = 0;
-
- if (sBuffer[0] == '_') {
- readOnly = TRUE;
- sds_getvar(sBuffer+1, &result);
- lvitem.pszText = sBuffer + 1;
- lvitem.cchTextMax = strlen(sBuffer + 1);
-
- pVarList->InsertItem(&lvitem);
- } else {
- sds_getvar(sBuffer, &result);
- lvitem.pszText = sBuffer;
- lvitem.cchTextMax = strlen(sBuffer);
-
- pVarList->InsertItem(&lvitem);
- }
-
- lvitem.iSubItem = 1;
-
- switch (result.restype) {
- case RTSTR:
- if (strlen(result.resval.rstring) > 0) {
- lvitem.pszText = result.resval.rstring;
- } else {
- lvitem.pszText = "\"\"";
- }
- break;
- case RTREAL:
- FloatToString(result.resval.rreal, sBuffer, 6);
- lvitem.pszText = sBuffer;
- break;
- case RTSHORT:
- itoa(result.resval.rint, sBuffer, 10);
- lvitem.pszText = sBuffer;
- break;
- case RTPOINT:
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- strcpy(sBuffer, "(");
- strcat(sBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(sBuffer, " ");strcat(sBuffer, sYBuf);strcat(sBuffer, ")");
-
- lvitem.pszText = sBuffer;
- break;
- case RT3DPOINT:
- FloatToString(result.resval.rpoint[0], sXBuf, 6);
- strcpy(sBuffer, "(");
- strcat(sBuffer, sXBuf);
-
- FloatToString(result.resval.rpoint[1], sYBuf, 6);
- strcat(sBuffer, " ");strcat(sBuffer, sYBuf);
-
- FloatToString(result.resval.rpoint[2], sZBuf, 6);
- strcat(sBuffer, " ");strcat(sBuffer, sZBuf);strcat(sBuffer, ")");
-
- lvitem.pszText = sBuffer;
- break;
- default:
- itoa(i, sBuffer, 10);
- strcat(sBuffer, " --**");
- lvitem.pszText = sBuffer;
- break;
- }
-
- char readOnlyBuf[255];
- if (readOnly == TRUE) {
- readOnly = FALSE;
- sprintf(readOnlyBuf, "%s %s", lvitem.pszText, " (Read Only)");
- lvitem.pszText = readOnlyBuf;
- }
-
- lvitem.cchTextMax = strlen(lvitem.pszText);
- pVarList->SetItem(&lvitem);
- }
- }
-
- void CMfcAppDlg::FloatToString(double value, char *psBuffer, short prec)
- {
- int dec, sign;
- short place = 0;
- char *psTemp = _fcvt(value, prec, &dec, &sign);
-
- if (dec >= 20) {
- _gcvt( value, 6, psBuffer );
- return;
- }
- memset(psBuffer, '\0', prec + 4);
-
- if (sign) {
- strcpy(psBuffer, "-");
- place++;
- }
- dec = (dec > 4) ? 4 : (dec < -4) ? -4 : dec;
- if (dec <= 0) {
- if (prec) {
- strcat(psBuffer, "0.");
- place += 2;
- } else {
- strcat(psBuffer, "0");
- place++;
- }
- memset(psBuffer + place, '0', abs(dec));
- strcat(psBuffer, psTemp);
- } else {
- strncat(psBuffer, psTemp, dec);
- if (prec)
- strcat(psBuffer, ".");
- strcat(psBuffer, psTemp + dec);
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CStrDlg dialog
-
- CStrDlg::CStrDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CStrDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CStrDlg)
- m_NewVal = _T("");
- //}}AFX_DATA_INIT
- }
-
-
- void CStrDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CStrDlg)
- DDX_Text(pDX, IDC_STRING_VALUE_EDITBOX, m_NewVal);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CStrDlg, CDialog)
- //{{AFX_MSG_MAP(CStrDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CStrDlg message handlers
-
- /////////////////////////////////////////////////////////////////////////////
- // CRealDlg dialog
-
- CRealDlg::CRealDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CRealDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CRealDlg)
- m_RealVal = 0.0;
- //}}AFX_DATA_INIT
- }
-
-
- void CRealDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CRealDlg)
- DDX_Text(pDX, IDC_REAL_VALUE_EDITBOX, m_RealVal);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CRealDlg, CDialog)
- //{{AFX_MSG_MAP(CRealDlg)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CRealDlg message handlers
- /////////////////////////////////////////////////////////////////////////////
- // CShortDlg dialog
-
- CShortDlg::CShortDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CShortDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CShortDlg)
- m_IntVal = 0;
- //}}AFX_DATA_INIT
- }
-
-
- void CShortDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CShortDlg)
- DDX_Text(pDX, IDC_SHORT_VALUE_EDITBOX, m_IntVal);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CShortDlg, CDialog)
- //{{AFX_MSG_MAP(CShortDlg)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CShortDlg message handlers
- /////////////////////////////////////////////////////////////////////////////
- // CPointDlg dialog
-
- CPointDlg::CPointDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CPointDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CPointDlg)
- m_Point_X = 0.0;
- m_Point_Y = 0.0;
- m_Point_Z = 0.0;
- //}}AFX_DATA_INIT
- }
-
-
- void CPointDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPointDlg)
- DDX_Text(pDX, IDC_POINT_X_EDIT, m_Point_X);
- DDX_Text(pDX, IDC_POINT_Y_EDIT, m_Point_Y);
- DDX_Text(pDX, IDC_POINT_Z_EDIT, m_Point_Z);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CPointDlg, CDialog)
- //{{AFX_MSG_MAP(CPointDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CPointDlg message handlers
-
- BOOL CPointDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // For 2D points, hide the Z input edit box and static text.
- if(((CMfcAppDlg*)GetParent())->is2DPoint) {
- GetDlgItem(IDC_POINT_Z_EDIT)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_POINT_Z)->ShowWindow(SW_HIDE);
- }
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
-
-