| Article | 60000107 |
| Type | HowTo |
| Product | Engine |
| Version | 6 |
| Date Added | 4/5/2007 |
| Submitted by | Patty Snow |
| Keywords |
The vdrawcontrol has exported the following methods for grid manage:
Also the DiplayFrame gets the following on or more following values :
- Default = 1 + 2 + 4 + 32,
- HideAll = 0,
- ShowAll = 1 + 2 + 4 + 8 + 16 + 32,
- ShowStatusBar = 1,
- ShowHorizontalScroll = 2,
- ShowVerticalScroll = 4,
- ShowPropertyGrid = 8,
- ShowCommandLine = 16,
- ShowLayoutTab = 32,
You can add the vdraw.ocx in a form and 3 buttons and write code like :
void CVdTest1Dlg::OnDocprop() //
{
// Select the document object in the property grid
m_vd.SetGrid_SelectedObject(m_vd.GetActiveDocument());
}
void CVdTest1Dlg::OnFigprops()
{
// Create a line and select the line in property grid
m_vd.GetActiveDocument().New();
double p1[3] = {1,1,0};
double p2[3] = {2,2,0};
COleSafeArray vp1;
COleSafeArray vp2;
vp1.CreateOneDim(VT_R8,3,&p1);
vp2.CreateOneDim(VT_R8,3,&p2);
CvdLine line = m_vd.GetActiveDocument().GetEntities().AddLine(vp1,vp2);
line.Invalidate();
m_vd.SetGrid_SelectedObject(line);
}
void CVdTest1Dlg::OnSelctionprops()
{
// Create a circle and a selection set with all objects in the entities collection and select the selection in the property grid
m_vd.GetActiveDocument().New();
double p1[3] = {1,1,0};
COleSafeArray vp1;
vp1.CreateOneDim(VT_R8,3,&p1);
CvdCircle circle = m_vd.GetActiveDocument().GetEntities().AddCircle(vp1,1.0);
circle.Invalidate();
CvdSelection set = m_vd.GetActiveDocument().GetSelections().Add("TEST");
set.Select(COleVariant("All"),COleVariant(),COleVariant());
m_vd.SetGrid_SelectedObject(set);
}