示例#1
0
文件: ms_updt.c 项目: Comanche93/eech
static void update_mslider_ui_object (ui_object *obj)
{

	float
		parent_x1,
		parent_y1,
		parent_x2,
		parent_y2,
		parent_x_origin,
		parent_y_origin;

	float
		min,
		max,
		x1,
		y1,
		x2,
		y2;

	ui_object
		*object_to_slide,
		*parent;

   area_ui_object
      *area;

	float
		old_viewport_x1,
		old_viewport_y1,
		old_viewport_x2,
		old_viewport_y2;

   // store parents viewport data

	old_viewport_x1 = active_viewport.x_min;
	old_viewport_y1 = active_viewport.y_min;
	old_viewport_x2 = active_viewport.x_max;
	old_viewport_y2 = active_viewport.y_max;

   area = obj->data;

	// Scroll if required

	if (scroll)
	{

		min = get_ui_object_slider_min (obj);
	
		max = get_ui_object_slider_max (obj);
	
		object_to_slide = get_ui_object_next (obj);
  
		scroll_slider (object_to_slide, min, max, scroll);
	}

	// store parents viewport data

	parent = get_ui_object_parent (obj);

	parent_x_origin = get_ui_object_x_origin (parent);

	parent_y_origin = get_ui_object_y_origin (parent);

	parent_x1 = get_ui_object_x (parent);

	parent_y1 = get_ui_object_y (parent);

	parent_x2 = parent_x1 + get_ui_object_x_size (parent);

	parent_y2 = parent_y1 + get_ui_object_y_size (parent);

   if (area->drawable)
   {

		ui_set_origin (0, 0);

      draw_ui_object (obj);

      if (area->child)
      {

			x1 = get_ui_object_x (obj);

			y1 = get_ui_object_y (obj);

			x2 = x1 + get_ui_object_x_size (obj);

			y2 = y1 + get_ui_object_y_size (obj);

			ui_clip_area (&x1, &y1, &x2, &y2);

			set_viewport (x1, y1, x2, y2);
	
			ui_set_origin (0, 0);
	
         update_ui_object (area->child);
      }
	}

	if (area->next)
	{

		parent = get_ui_object_parent (obj);

		if (parent)
		{
	
			set_viewport (parent_x1, parent_y1, parent_x2, parent_y2);
	
			ui_set_origin (parent_x_origin, parent_y_origin);
		}

		update_ui_object (area->next);
	}

	set_viewport (old_viewport_x1, old_viewport_y1, old_viewport_x2, old_viewport_y2);
}
示例#2
0
文件: vs_updt.c 项目: Comanche93/eech
static void update_vslider_ui_object (ui_object *obj)
{

	float
		parent_x1,
		parent_y1,
		parent_x2,
		parent_y2,
		parent_x_origin,
		parent_y_origin;

	float
		x1,
		y1,
		x2,
		y2;

	ui_object
		*parent;

   area_ui_object
      *area;

	float
		old_viewport_x1,
		old_viewport_y1,
		old_viewport_x2,
		old_viewport_y2;

   // store parents viewport data

	old_viewport_x1 = active_viewport.x_min;
	old_viewport_y1 = active_viewport.y_min;
	old_viewport_x2 = active_viewport.x_max;
	old_viewport_y2 = active_viewport.y_max;

   area = (area_ui_object *) obj->data;

	// store parents viewport data

	parent = get_ui_object_parent (obj);

	parent_x_origin = get_ui_object_x_origin (parent);

	parent_y_origin = get_ui_object_y_origin (parent);

	parent_x1 = get_ui_object_x (parent);

	parent_y1 = get_ui_object_y (parent);

	parent_x2 = parent_x1 + get_ui_object_x_size (parent);

	parent_y2 = parent_y1 + get_ui_object_y_size (parent);

	recalculate_slider_size (obj);

   if (area->drawable)
   {

		ui_set_origin (0, 0);

      draw_ui_object (obj);

      if (area->child)
      {

			x1 = get_ui_object_x (obj);

			y1 = get_ui_object_y (obj);

			x2 = x1 + get_ui_object_x_size (obj);

			y2 = y1 + get_ui_object_y_size (obj);

			ui_clip_area (&x1, &y1, &x2, &y2);

			set_viewport (x1, y1, x2, y2);
	
			ui_set_origin (0, 0);
	
         update_ui_object (area->child);
      }
	}

	set_viewport (old_viewport_x1, old_viewport_y1, old_viewport_x2, old_viewport_y2);

	if (area->next)
	{

		parent = get_ui_object_parent (obj);

		if (parent)
		{
	
			set_viewport (parent_x1, parent_y1, parent_x2, parent_y2);
	
			ui_set_origin (parent_x_origin, parent_y_origin);
		}

		update_ui_object (area->next);
	}
}
示例#3
0
static void update_menu_ui_object (ui_object *obj)
{

	float
		x1,
		y1,
		x2,
		y2,
		parent_x1,
		parent_y1,
		parent_x2,
		parent_y2,
		grand_parent_x_origin = 0.0,
		grand_parent_y_origin = 0.0;

	ui_object
		*stack_head,
		*grand_parent,
		*parent;

   area_ui_object
      *area;

   area = obj->data;

	// store parents viewport data

	parent = get_ui_object_parent (obj);

	grand_parent = get_ui_object_parent (parent);

	if (parent)
	{
	
  		if (grand_parent)
		{
	
			grand_parent_x_origin = get_ui_object_x_origin (grand_parent);

			grand_parent_y_origin = get_ui_object_y_origin (grand_parent);
		}

		ui_set_origin (grand_parent_x_origin, grand_parent_y_origin);

		parent_x1 = get_ui_object_x (parent);

		parent_y1 = get_ui_object_y (parent);

		parent_x2 = parent_x1 + get_ui_object_x_size (parent);

		parent_y2 = parent_y1 + get_ui_object_y_size (parent);

		x1 = parent_x1;

		y1 = parent_y1;

		x2 = parent_x2;

		y2 = parent_y2;

		ui_clip_area (&x1, &y1, &x2, &y2);

		x1 += grand_parent_x_origin;

		y1 += grand_parent_y_origin;

		x2 += grand_parent_x_origin;

		y2 += grand_parent_y_origin;

		set_viewport (x1, y1, x2, y2);
	}

   if (area->drawable)
   {

      draw_ui_object (obj);
	}

	// and its list head

	stack_head = obj->stack_head;

	if (stack_head)
	{
	
		parent = get_ui_object_parent (stack_head);
	
		grand_parent = get_ui_object_parent (parent);
	
		if (parent)
		{

			if (grand_parent)
			{
		
				grand_parent_x_origin = get_ui_object_x_origin (grand_parent);

				grand_parent_y_origin = get_ui_object_y_origin (grand_parent);
			}
	
			ui_set_origin (grand_parent_x_origin, grand_parent_y_origin);

			parent_x1 = get_ui_object_x (parent);

			parent_y1 = get_ui_object_y (parent);

			parent_x2 = parent_x1 + get_ui_object_x_size (parent);

			parent_y2 = parent_y1 + get_ui_object_y_size (parent);
	
			x1 = parent_x1;

			y1 = parent_y1;

			x2 = parent_x2;

			y2 = parent_y2;

			ui_clip_area (&x1, &y1, &x2, &y2);
	
			x1 += grand_parent_x_origin;

			y1 += grand_parent_y_origin;

			x2 += grand_parent_x_origin;

			y2 += grand_parent_y_origin;

			set_viewport (x1, y1, x2, y2);
		}
	
		if (area->drawable)
		{
	
			draw_ui_object (stack_head);
		}
	}

	// list head end

	if (area->next)
	{

		parent = get_ui_object_parent (obj);

		grand_parent = get_ui_object_parent (parent);

		if (parent)
		{

			if (grand_parent)
			{
		
				grand_parent_x_origin = get_ui_object_x_origin (grand_parent);

				grand_parent_y_origin = get_ui_object_y_origin (grand_parent);
			}

			ui_set_origin (grand_parent_x_origin, grand_parent_y_origin);
	
			parent_x1 = get_ui_object_x (parent);

			parent_y1 = get_ui_object_y (parent);

			parent_x2 = parent_x1 + get_ui_object_x_size (parent);

			parent_y2 = parent_y1 + get_ui_object_y_size (parent);
	
			x1 = parent_x1;

			y1 = parent_y1;

			x2 = parent_x2;

			y2 = parent_y2;
	
			x1 += grand_parent_x_origin;

			y1 += grand_parent_y_origin;

			x2 += grand_parent_x_origin;

			y2 += grand_parent_y_origin;

			set_viewport (x1, y1, x2, y2);
			
			parent_x1 += get_ui_object_x_origin (parent);

			parent_y1 += get_ui_object_y_origin (parent);

			ui_set_origin (parent_x1, parent_y1);
		}

		update_ui_object (area->next);
	}
}