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


C++ Allocation::bottom方法代码示例

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


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

示例1: 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

示例2: draw

void Background::draw(Canvas* c, const Allocation& a) const {
    Extension ext;
    ext.set(c, a);
    if (c->damaged(ext)) {
        c->fill_rect(a.left(), a.bottom(), a.right(), a.top(), color_);
    }
    MonoGlyph::draw(c, a);
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:8,代码来源:background.cpp

示例3: draw

void MonoKitFrame::draw(Canvas* c, const Allocation& a) const {
    BevelFrame::draw(c, a);
    if (!state_->test(TelltaleState::is_enabled)) {
        c->fill_rect(
            a.left(), a.bottom(), a.right(), a.top(), info_->gray_out()
        );
    }
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:8,代码来源:mono_kit.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: draw

void Slider::draw(Canvas* c, const Allocation& a) const {
    SliderImpl& s = *impl_;
    c->push_clipping();
    c->clip_rect(a.left(), a.bottom(), a.right(), a.top());
    if (s.showing_old_thumb_) {
        s.old_thumb_->draw(c, s.old_thumb_->allocation());
    }
    s.thumb_patch_->draw(c, s.thumb_patch_->allocation());
    c->pop_clipping();
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:10,代码来源:slider.c

示例6: 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

示例7: print

void FieldStringEditor::print(Printer* p, const Allocation& a) const {
    const Font* f = output_->GetFont();
    const Color* fg = output_->GetFgColor();
    FontBoundingBox b;
    f->font_bbox(b);
    Coord x = a.left(), y = a.bottom() + b.font_descent();
    FieldStringEditor* e = (FieldStringEditor*)this;
    for (const char* s = e->Text(); *s != '\0'; s++) {
	Coord w = f->width(*s);
	p->character(f, *s, w, fg, x, y);
	x += w;
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:13,代码来源:field.c

示例8: 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

示例9: width

void XYView::scene2view(const Allocation& a) const {
    float m00 = width()/a.x_allotment().span();
    float m11 = height()/a.y_allotment().span();

    //takes a canvas transformation from scene to parent glyph coordinates
    // transforms vectors from original to xyview
    XYView* xyv = (XYView*)this;
    xyv->scene2viewparent_ = Transformer(
                                 m00, 0,
                                 0, m11,
                                 left() - a.left()*m00,
                                 bottom() - a.bottom()*m11
                             );
//print_t("scene2view", scene2viewparent_);
}
开发者ID:vortexlaboratory,项目名称:neuron,代码行数:15,代码来源:xyview.cpp

示例10: draw_frame

void MonoKitFrame::draw_frame(Canvas* c, const Allocation& a, Coord t) const {
    const MonoKitInfo& i = info();
    const Color* c1, * c2, * c3;
    c2 = i.flat();
    if (state_->test(TelltaleState::is_enabled_active)) {
        c1 = i.light();
        c3 = i.dark();
    } else if (choosable_ && state_->test(TelltaleState::is_enabled_chosen)) {
        c1 = i.dark();
        c3 = i.light();
    } else {
        c1 = c2;
        c3 = c2;
    }
    Bevel::rect(c, c1, c2, c3, t, a.left(), a.bottom(), a.right(), a.top());
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:16,代码来源:mono_kit.c

示例11: event

boolean GlyphGrabber::event (Event& e) {
    Graphic31* root = _gviewer->root();
    Tool31& tool = _gviewer->tool();
    Canvas* c = e.window()->canvas();
    c->push_clipping();
    c->clip_rect(_a->left(), _a->bottom(), _a->right(), _a->top());
    boolean ok = root->grasp(e, tool);
    Event ev;
    Session* s = Session::instance();
    while(ok) {
        s->read(ev);
        ok = root->manipulating(ev, tool);
    }
    ok = root->effect(ev, tool);
    c->pop_clipping();
    return ok;
}    
开发者ID:barak,项目名称:ivtools-cvs,代码行数:17,代码来源:glyphviewer.c

示例12: reallocate

void TBScrollBoxImpl::reallocate() {
    if (canvas_ == nil) {
	return;
    }
    ScrollBox* s = scrollbox_;
    GlyphIndex n = s->count();
    end_ = n;
    TBScrollBoxList& list = visible_;
    list.remove_all();
    Requisition req;
    TBScrollBoxInfo info;
    Extension e_i;
    const Requirement& r = req.y_requirement();
    Coord p = allocation_.top();
    Coord bottom = allocation_.bottom();
    bool found_start = false;
    for (GlyphIndex i = start_; i < n; i++) {
	Glyph* g = s->component(i);
	if (g != nil) {
	    g->request(req);
	    Coord span = r.natural();
	    if (!Math::equal(span, Coord(0), float(1e-2))) {
		if (!found_start) {
		    start_ = i;
		    found_start = true;
		}
		Coord alignment = r.alignment();
		p -= span;
		if (p < bottom) {
		    end_ = i;
		    break;
		}
		info.glyph_ = g;
		Allotment& ax = info.allocation_.x_allotment();
		ax = allocation_.x_allotment();
		Allotment& ay = info.allocation_.y_allotment();
		ay.span(span);
		ay.origin(p + Coord(alignment * span));
		ay.alignment(alignment);
		list.append(info);
		g->allocate(canvas_, info.allocation_, e_i);
	    }
	}
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:45,代码来源:scrbox.cpp

示例13: print

void TBScrollBox::print(Printer* c, const Allocation& a) const {
    TBScrollBoxImpl& sb = *impl_;
    sb.check(c, a);
    Extension& e = sb.extension_;
    if (sb.canvas_->damaged(e)) {
	if (sb.changed_) {
	    sb.refresh();
	}
	c->push_clipping();
	c->clip_rect(a.left(), a.bottom(), a.right(), a.top());
	for (ListItr(TBScrollBoxList) i(sb.visible_); i.more(); i.next()) {
	    const TBScrollBoxInfo& info = i.cur_ref();
	    Glyph* g = info.glyph_;
	    g->print(c, info.allocation_);
	}
	c->pop_clipping();
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:18,代码来源:scrbox.cpp

示例14: pick

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();
            }
        }
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:19,代码来源:page.c

示例15: pick

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();
            }
        }
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:20,代码来源:box.cpp


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