Create the Class and Controls

To create the class and controls associated with the MFC dialog

  1. Add a new class for the dialog.
  2. In the MFC Class Wizard, enter AsdkAcUiDialogSample for the dialog name, and click Finish.
  3. Add the following member variables:
    • For the IDC_BUTTON_ANGLE and IDC_BUTTON_POINT resources, add CButton controls called m_ctrlAngleButton and m_ctrlPickButton, respectively.
    • For the IDC_EDIT_ANGLE, IDC_EDIT_XPT, IDC_EDIT_YPT, and IDC_EDIT_ZPT resources, add CEdit controls called m_ctrlAngleEdit, m_ctrlXPtEdit, m_ctrlYPtEdit, and m_ctrlZPtEdit, respectively.
    • For the IDC_LIST_BLOCKS resource, add a CListBox control called m_ctrlBlockList.
    • For the IDC_COMBO_REGAPPS resource, add a CComboBox control called m_ctrlRegAppComboBox.
  4. Open the AsdkAcUiDialogSample.h header file and change the derivation of the new dialog class. It should be derived from CAcUiDialog:
class AsdkAcUiDialogSample : public CAcUiDialog

Change the types to use the AcUi controls. In AsdkAcUiDialogSample.h, change the control list to the following:

CAcUiSymbolComboBox   m_ctrlRegAppComboBox;
CAcUiListBox          m_ctrlBlockListBox;
CAcUiPickButton       m_ctrlPickButton;
CAcUiPickButton       m_ctrlAngleButton;
CAcUiAngleEdit        m_ctrlAngleEdit;
CAcUiNumericEdit      m_ctrlXPtEdit;
CAcUiNumericEdit      m_ctrlYPtEdit;
CAcUiNumericEdit      m_ctrlZPtEdit;

Add helper functions and member variables to track the point and angle values. These should be added to the public section of the class:

AcGePoint3d m_ptValue;
double m_dAngle;
void DisplayPoint();
bool ValidatePoint();
void DisplayAngle();
bool ValidateAngle();
void DisplayBlocks();
void DisplayRegApps();