本文整理汇总了C++中IdList::First方法的典型用法代码示例。如果您正苦于以下问题:C++ IdList::First方法的具体用法?C++ IdList::First怎么用?C++ IdList::First使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdList
的用法示例。
在下文中一共展示了IdList::First方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseRightUp
void GraphicsWindow::MouseRightUp(double x, double y) {
SS.extraLine.draw = false;
InvalidateGraphics();
// Don't show a context menu if the user is right-clicking the toolbar,
// or if they are finishing a pan.
if(ToolbarMouseMoved((int)x, (int)y)) return;
if(orig.startedMoving) return;
if(context.active) return;
if(pending.operation == DRAGGING_NEW_LINE_POINT ||
pending.operation == DRAGGING_NEW_CUBIC_POINT)
{
// Special case; use a right click to stop drawing lines, since
// a left click would draw another one. This is quicker and more
// intuitive than hitting escape. Likewise for new cubic segments.
ClearPending();
return;
}
context.active = true;
if(!hover.IsEmpty()) {
MakeSelected(&hover);
SS.ScheduleShowTW();
}
GroupSelection();
bool itemsSelected = (gs.n > 0 || gs.constraints > 0);
if(itemsSelected) {
if(gs.stylables > 0) {
ContextMenuListStyles();
AddContextMenuItem("Assign to Style", CONTEXT_SUBMENU);
}
if(gs.n + gs.constraints == 1) {
AddContextMenuItem("Group Info", CMNU_GROUP_INFO);
}
if(gs.n + gs.constraints == 1 && gs.stylables == 1) {
AddContextMenuItem("Style Info", CMNU_STYLE_INFO);
}
if(gs.withEndpoints > 0) {
AddContextMenuItem("Select Edge Chain", CMNU_SELECT_CHAIN);
}
if(gs.constraints == 1 && gs.n == 0) {
Constraint *c = SK.GetConstraint(gs.constraint[0]);
if(c->HasLabel() && c->type != Constraint::COMMENT) {
AddContextMenuItem("Toggle Reference Dimension",
CMNU_REFERENCE_DIM);
}
if(c->type == Constraint::ANGLE ||
c->type == Constraint::EQUAL_ANGLE)
{
AddContextMenuItem("Other Supplementary Angle",
CMNU_OTHER_ANGLE);
}
}
if(gs.comments > 0 || gs.points > 0) {
AddContextMenuItem("Snap to Grid", CMNU_SNAP_TO_GRID);
}
if(gs.points == 1) {
Entity *p = SK.GetEntity(gs.point[0]);
Constraint *c;
IdList<Constraint,hConstraint> *lc = &(SK.constraint);
for(c = lc->First(); c; c = lc->NextAfter(c)) {
if(c->type != Constraint::POINTS_COINCIDENT) continue;
if(c->ptA.v == p->h.v || c->ptB.v == p->h.v) {
break;
}
}
if(c) {
AddContextMenuItem("Delete Point-Coincident Constraint",
CMNU_DEL_COINCIDENT);
}
}
AddContextMenuItem(NULL, CONTEXT_SEPARATOR);
if(LockedInWorkplane()) {
AddContextMenuItem("Cut", CMNU_CUT_SEL);
AddContextMenuItem("Copy", CMNU_COPY_SEL);
}
}
if(SS.clipboard.r.n > 0 && LockedInWorkplane()) {
AddContextMenuItem("Paste", CMNU_PASTE_SEL);
}
if(itemsSelected) {
AddContextMenuItem("Delete", CMNU_DELETE_SEL);
AddContextMenuItem(NULL, CONTEXT_SEPARATOR);
AddContextMenuItem("Unselect All", CMNU_UNSELECT_ALL);
}
// If only one item is selected, then it must be the one that we just
// selected from the hovered item; in which case unselect all and hovered
// are equivalent.
if(!hover.IsEmpty() && selection.n > 1) {
AddContextMenuItem("Unselect Hovered", CMNU_UNSELECT_HOVERED);
}
//.........这里部分代码省略.........