当前位置: 首页>>代码示例>>C++>>正文


C++ Hit::target方法代码示例

本文整理汇总了C++中Hit::target方法的典型用法代码示例。如果您正苦于以下问题:C++ Hit::target方法的具体用法?C++ Hit::target怎么用?C++ Hit::target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hit的用法示例。


在下文中一共展示了Hit::target方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pick

boolean StandardPicker::pick(Canvas* c, Glyph* glyph, int depth, Hit& h) {
	if (!h.event()) {
		return false;
	}
	const Event& e = *h.event();
	if (e.grabber()) {
		h.target(depth, glyph, 0, e.grabber());
		return true;
	}
	event(e);
	
	long cnt = handlers_[ms_]->count();
	for (long i=0; i < cnt; ++i) {
		ButtonHandler& b = *handlers_[ms_]->item(i);
		if (b.eb_ == Event::any || b.eb_ == mb_) {
			if (b.handler_) {
				h.target(depth, glyph, 0, b.handler_);
			}else{
				b.rband_->canvas(c);
				h.target(depth, glyph, 0, b.rband_);
			}
			return true;
		}
	}
	return false;
}
开发者ID:bhache,项目名称:pkg-neuron,代码行数:26,代码来源:ocpicker.cpp

示例2: pick

void XYView_helper::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    if (MyMath::inside(h.left(), h.bottom(), v_->left(), v_->bottom(),
                       v_->right(), v_->top())) {
        if (h.event()->grabber()) { // fixes a bug but I dont know why
#if 1
//The above fix broke the handling of keystrokes for crosshairs and Rotate3D
//It was needed so that buttons would appear normal when moving quickly from
// a button through a box to a scene. Now we put in the right handler in
//case event was a keystroke.
            if (h.event()->type() == Event::key) {
                h.target(depth, this, 0, h.event()->grabber());
            }
#endif
            return;
        }
        current_pick_view_ = v_;
        MonoGlyph::pick(c, a, depth, h);
        if (h.event()->type() == Event::down) {
#if 0
            printf("XYView_helper hit (%g, %g)  event (%g, %g)\n", h.left(), h.bottom(),
                   h.event()->pointer_x(), h.event()->pointer_y());
            printf(" allocation lb=(%g, %g), rt=(%g,%g)\n", a.left(), a.bottom(), a.right(), a.top());
#endif
        }
    }
}
开发者ID:vortexlaboratory,项目名称:neuron,代码行数:26,代码来源:xyview.cpp

示例3: pick

void Space::pick(Canvas*, const Allocation& a, int depth, Hit& h) {
    Coord x = h.left();
    Coord left = a.left();
    Coord right = a.right();
    if (x >= left && x < right) {
        h.target(depth, this, (x > (left+right)/2) ? 1 : 0);
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:8,代码来源:layout.c

示例4: pick

void FieldStringEditor::pick(
    Canvas*, const Allocation& a, int depth, Hit& h
) {
    const Event* ep = h.event();
    if (ep != nil && h.left() < a.right() && h.right() >= a.left() &&
	h.bottom() < a.top() && h.top() >= a.bottom()
    ) {
	h.target(depth, this, 0);
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:10,代码来源:field.c

示例5: pick

void MonoKitFrame::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    if (target_) {
        Coord x = h.left();
        Coord y = h.bottom();
        if (x >= a.left() && x < a.right() && y >= a.bottom() && y < a.top()) {
            h.target(depth, this, 0);
        }
    } else {
        BevelFrame::pick(c, a, depth, h);
    }
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:11,代码来源:mono_kit.c

示例6: pick

void Text::pick(Canvas*, const Allocation&, int depth, Hit& h) {
  const Event* e = h.event();
  EventButton t = (e == nil) ? Event::none : e->pointer_button();
  EventType t1 = (e == nil) ? Event::undefined : e->type();
  if (t == Event::left || t == Event::right ||
      t == Event::middle || t1 == Event::key) {
    Coord x = e->pointer_x();
    Coord y = e->pointer_y();
    Allocation* a = allocation_;
    if (x >= a->left() && x <= a->right() && y >= a->bottom() && y <= a->top()) {
      h.target(depth, this, 0, handler());
    }
  }
}
开发者ID:PNCG,项目名称:neuron,代码行数:14,代码来源:iv3text.cpp

示例7: pick_menu

void ScenePicker::pick_menu(Glyph* glyph, int depth, Hit& h) {
	h.target(depth, glyph, 0, spi_);
}
开发者ID:nrnhines,项目名称:nrn,代码行数:3,代码来源:scenepic.cpp


注:本文中的Hit::target方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。