Example #1
0
void Deck::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    if (card_ >= 0 && card_ < count()) {
	Glyph* g = component(card_);
        if (g != nil) {
	    h.begin(depth, this, card_);
	    g->pick(c, a, depth + 1, h);
	    h.end();
        }
    }
}
Example #2
0
void GlyphViewer::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    const Event* e = h.event();
    if (e->control_is_down()) {
        InputHandler::pick(c, a, depth, h);
    } else if (e->type() == Event::down) {
        h.begin(depth, this, 0, _grabber);
        MonoGlyph::pick(c, a, depth, h);
        h.end();
    }
}
Example #3
0
void Page::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    if (background_ != nil) {
        background_->pick(c, a, depth, h);
    }
    GlyphIndex count = info_->count();
    for (GlyphIndex index = 0; index < count; ++index) {
        PageInfo& info = info_->item_ref(index);
        if (info.glyph_ != nil && !(info.status_ & PageInfoHidden)) {
            Allocation& a = info.allocation_;
            if (h.right() >= a.left() && h.left() < a.right() &&
                h.top() >= a.bottom() && h.bottom() < a.top()
            ) {
		h.begin(depth, this, index);
                info.glyph_->pick(c, a, depth + 1, h);
		h.end();
            }
        }
    }
}
Example #4
0
void TBScrollBox::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    TBScrollBoxImpl& sb = *impl_;
    sb.check(c, a);
    if (h.left() < a.right() && h.right() >= a.left() &&
	h.bottom() < a.top() && h.top() >= a.bottom()
    ) {
	if (sb.changed_) {
	    sb.refresh();
	}
	GlyphIndex n = sb.start_;
	for (ListItr(TBScrollBoxList) i(sb.visible_); i.more(); i.next()) {
	    const TBScrollBoxInfo& info = i.cur_ref();
	    Glyph* g = info.glyph_;
	    h.begin(depth, this, n);
	    g->pick(c, info.allocation_, depth + 1, h);
	    h.end();
	    ++n;
	}
    }
}
Example #5
0
File: box.cpp Project: PNCG/neuron
void Box::pick(Canvas* c, const Allocation& a, int depth, Hit& h) {
    if (h.right() >= a.left() && h.left() < a.right() &&
            h.top() >= a.bottom() && h.bottom() < a.top()
       ) {
        BoxImpl* b = impl_;
        Extension ext;
        ext.clear();
        AllocationInfo& info = b->info(c, a, ext);
        Allocation* aa = info.component_allocations();
        GlyphIndex n = count();
        for (GlyphIndex i = 0; i < n; i++) {
            Glyph* g = component(i);
            if (g != nil) {
                h.begin(depth, this, i);
                g->pick(c, aa[i], depth + 1, h);
                h.end();
            }
        }
    }
}