Exemple #1
0
static void
Draw(void *obj)
{
	AG_Combo *com = obj;

	AG_WidgetDraw(com->tbox);
	AG_WidgetDraw(com->button);
}
Exemple #2
0
static void
Draw(void *obj)
{
    AG_Widget *chld;

    OBJECT_FOREACH_CHILD(chld, obj, ag_widget)
    AG_WidgetDraw(chld);
}
Exemple #3
0
static void
Draw(void *obj)
{
	AG_MPane *mp = obj;
	int i;

	for (i = 0; i < mp->npanes; i++)
		AG_WidgetDraw(mp->panes[i]);
}
Exemple #4
0
static void
Draw(void *p)
{
	AG_Textbox *tb = p;

	STYLE(tb)->TextboxBackground(tb, tb->r, (tb->flags & AG_TEXTBOX_COMBO));

	if (tb->lbl != NULL)
		AG_WidgetDraw(tb->lbl);

	AG_PushClipRect(tb, tb->r);

	if (tb->flags & AG_TEXTBOX_MULTILINE) {
		int d;

		if (tb->vBar != NULL && AG_ScrollbarVisible(tb->vBar)) {
			d = WIDTH(tb->vBar);
			AG_DrawBox(tb,
			    AG_RECT(WIDTH(tb)-d, HEIGHT(tb)-d, d, d), -1,
			    agColors[TEXTBOX_COLOR]);
		} else if (tb->hBar != NULL && AG_ScrollbarVisible(tb->hBar)) {
			d = HEIGHT(tb->hBar);
			AG_DrawBox(tb,
			    AG_RECT(WIDTH(tb)-d, HEIGHT(tb)-d, d, d), -1,
			    agColors[TEXTBOX_COLOR]);
		}
		AG_WidgetUpdate(tb);
	}

	/* Render the Editable widget, inheriting our Font. */
	tb->ed->font = tb->font;
	AG_WidgetDraw(tb->ed);

	if (tb->hBar != NULL)
		AG_WidgetDraw(tb->hBar);
	if (tb->vBar != NULL)
		AG_WidgetDraw(tb->vBar);

	AG_PopClipRect(tb);
}
Exemple #5
0
static void
Draw(void *obj)
{
	AG_Box *box = obj;
	AG_Widget *chld;

	if (box->flags & AG_BOX_FRAME) {
		AG_DrawBox(box,
		    AG_RECT(0, 0, WIDTH(box), HEIGHT(box)),
		    box->depth, WCOLOR(box,AG_COLOR));
	}
	OBJECT_FOREACH_CHILD(chld, box, ag_widget)
		AG_WidgetDraw(chld);
}
Exemple #6
0
static void
Draw(void *p)
{
	AG_Button *bu = p;
	AG_Variable *binding;
	void *pState;
	int pressed;
	
	binding = AG_GetVariable(bu, "state", &pState);
	pressed = GetState(bu, binding, pState);
	AG_UnlockVariable(binding);

	if (AG_WidgetEnabled(bu)) {
		AG_DrawBox(bu,
		    AG_RECT(0, 0, WIDTH(bu), HEIGHT(bu)),
		    pressed ? -1 : 1,
		    WCOLOR(bu,0));
	} else {
		AG_DrawBoxDisabled(bu,
		    AG_RECT(0, 0, WIDTH(bu), HEIGHT(bu)),
		    pressed ? -1 : 1,
		    WCOLOR_DEF(bu,0),
		    WCOLOR_DIS(bu,0));
	}

	if (bu->lbl != NULL) {
		AG_WidgetDraw(bu->lbl);
	} else if (bu->surface != -1) {
		int w = WSURFACE(bu,bu->surface)->w;
		int h = WSURFACE(bu,bu->surface)->h;
		int x = 0, y = 0;

		switch (bu->justify) {
		case AG_TEXT_LEFT:	x = bu->lPad;			break;
		case AG_TEXT_CENTER:	x = WIDTH(bu)/2 - w/2;		break;
		case AG_TEXT_RIGHT:	x = WIDTH(bu) - w - bu->rPad;	break;
		}
		switch (bu->valign) {
		case AG_TEXT_TOP:	y = bu->tPad;			break;
		case AG_TEXT_MIDDLE:	y = HEIGHT(bu)/2 - h/2;		break;
		case AG_TEXT_BOTTOM:	y = HEIGHT(bu) - h - bu->bPad;	break;
		}
		if (pressed) {
			x++;
			y++;
		}
		AG_WidgetBlitSurface(bu, bu->surface, x, y);
	}
}
Exemple #7
0
static void
Draw(void *obj)
{
	AG_FontSelector *fs = obj;
	AG_Widget *chld;

	WIDGET_FOREACH_CHILD(chld, obj)
		AG_WidgetDraw(chld);
	
	AG_DrawBox(fs, fs->rPreview, -1, agColors[FIXED_BOX_COLOR]);
	if (fs->sPreview != -1) {
		AG_Surface *su = WSURFACE(fs,fs->sPreview);

		AG_WidgetBlitSurface(fs, fs->sPreview,
		    fs->rPreview.x + fs->rPreview.w/2 - su->w/2,
		    fs->rPreview.y + fs->rPreview.h/2 - su->h/2);
	}
}
Exemple #8
0
static void
SDLGL_RenderWindow(struct ag_window *win)
{
	AG_WidgetDraw(win);
}