马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 chkang 于 2014-10-26 17:17 编辑
小弟新手,做了一个dialog combo的例子,实现的功能为:通过选择不同的combo选项,实现显示不同的展示框。结果不知哪里没有设置好,成了下面的模样,两个frame重合了,请高手指点:
实现的代码如下:
_PlaneTypeFrame = new CATDlgFrame(this, "PlaneTypeFrame", CATDlgGridLayout);
SetHorizontalAttachment(0,CATDlgTopOrLeft,_PlaneTypeFrame,NULL);
_PlaneTypeLabel = new CATDlgLabel(_PlaneTypeFrame, "PlaneTypeLabel");
_PlaneTypeLabel -> SetGridConstraints(0, 0, 1, 1, CATGRID_4SIDES);
_PlaneTypeCombo = new CATDlgCombo(_PlaneTypeFrame, "PlaneTypeCombo", CATDlgCmbDropDown);
_PlaneTypeCombo -> SetGridConstraints(0, 1, 1, 1, CATGRID_4SIDES);
CATUnicodeString LineNLS ;
LineNLS = CATMsgCatalog::BuildMessage("TrainningCreatePlaneDlg",
"PlaneTypeCombo.ThreePoint",NULL,0,"Through three point");
_PlaneTypeCombo->SetLine(LineNLS);
LineNLS = CATMsgCatalog::BuildMessage("TrainningCreatePlaneDlg",
"PlaneTypeCombo.PointAndLine",NULL,0,"Through point and line");
_PlaneTypeCombo->SetLine(LineNLS);
LineNLS = CATMsgCatalog::BuildMessage("TrainningCreatePlaneDlg",
"PlaneTypeCombo.TwoLine",NULL,0,"Through two line");
_PlaneTypeCombo->SetLine(LineNLS);
_PlaneByThreePoint = new CATDlgFrame(this, "PlaneByThreePoint", CATDlgGridLayout);
_PlaneByThreePoint->SetVisibility(CATDlgHide);
_pListFrame[ThreePoint] = _PlaneByThreePoint ;
_FirstPointLabel = new CATDlgLabel(_PlaneByThreePoint, "FirstPointLabel");
_FirstPointLabel -> SetGridConstraints(0, 0, 1, 1, CATGRID_4SIDES);
_FirstPointEditor = new CATDlgEditor(_PlaneByThreePoint, "FirstPointEditor", CATDlgEdtReadOnly);
_FirstPointEditor -> SetGridConstraints(0, 1, 1, 1, CATGRID_4SIDES);
_SecondPointLabel = new CATDlgLabel(_PlaneByThreePoint, "SecondPointLabel");
_SecondPointLabel -> SetGridConstraints(1, 0, 1, 1, CATGRID_4SIDES);
_SecongPointEditor = new CATDlgEditor(_PlaneByThreePoint, "SecongPointEditor", CATDlgEdtReadOnly);
_SecongPointEditor -> SetGridConstraints(1, 1, 1, 1, CATGRID_4SIDES);
_ThirdPointLabel = new CATDlgLabel(_PlaneByThreePoint, "ThirdPointLabel");
_ThirdPointLabel -> SetGridConstraints(2, 0, 1, 1, CATGRID_4SIDES);
_ThirdPointEditor = new CATDlgEditor(_PlaneByThreePoint, "ThirdPointEditor", CATDlgEdtReadOnly);
_ThirdPointEditor -> SetGridConstraints(2, 1, 1, 1, CATGRID_4SIDES);
_PointAndLineFrame = new CATDlgFrame(this, "PointAndLineFrame", CATDlgGridLayout);
_PointAndLineFrame->SetVisibility(CATDlgHide);
_pListFrame[PointAndLine] = _PointAndLineFrame ;
_OnePointLabel = new CATDlgLabel(_PointAndLineFrame, "OnePointLabel");
_OnePointLabel -> SetGridConstraints(0, 0, 1, 1, CATGRID_4SIDES);
_OneLineLabel = new CATDlgLabel(_PointAndLineFrame, "OneLineLabel");
_OneLineLabel -> SetGridConstraints(1, 0, 1, 1, CATGRID_4SIDES);
_Editor015 = new CATDlgEditor(_PointAndLineFrame, "Editor015", CATDlgEdtReadOnly);
_Editor015 -> SetGridConstraints(0, 1, 1, 1, CATGRID_4SIDES);
_Editor016 = new CATDlgEditor(_PointAndLineFrame, "Editor016", CATDlgEdtReadOnly);
_Editor016 -> SetGridConstraints(1, 1, 1, 1, CATGRID_4SIDES);
_TwoLineFrame = new CATDlgFrame(this, "TwoLineFrame", CATDlgGridLayout);
_TwoLineFrame->SetVisibility(CATDlgHide);
_pListFrame[TwoLine] = _TwoLineFrame ;
_FirstLineLabel = new CATDlgLabel(_TwoLineFrame, "FirstLineLabel");
_FirstLineLabel -> SetGridConstraints(0, 0, 1, 1, CATGRID_4SIDES);
_SecondLineLabel = new CATDlgLabel(_TwoLineFrame, "SecondLineLabel");
_SecondLineLabel -> SetGridConstraints(1, 0, 1, 1, CATGRID_4SIDES);
_FirstLineEditor = new CATDlgEditor(_TwoLineFrame, "FirstLineEditor", CATDlgEdtReadOnly);
_FirstLineEditor -> SetGridConstraints(0, 1, 1, 1, CATGRID_4SIDES);
_SecondLineEditor = new CATDlgEditor(_TwoLineFrame, "SecondLineEditor", CATDlgEdtReadOnly);
_SecondLineEditor -> SetGridConstraints(1, 1, 1, 1, CATGRID_4SIDES);
_CurrentSelection = ThreePoint;
_PlaneTypeCombo->SetSelect(_CurrentSelection,0);
SetHorizontalAttachment(5,CATDlgTopOrLeft,_pListFrame[_CurrentSelection],NULL);
_pListFrame[_CurrentSelection]->SetVisibility(CATDlgShow);
AddAnalyseNotificationCB (_PlaneTypeCombo,
_PlaneTypeCombo->GetComboSelectNotification(),
(CATCommandMethod)&TrainningCreatePlaneDlg::OnComboSelectNotification,
NULL);
|