Ejemplo n.º 1
0
void    GLUI_ActiveText::draw( int x, int y )
{
  GLUI_DRAWINGSENTINAL_IDIOM;

  draw_active_area();

  draw_active_box(0, w-1, 0, h);

}
Ejemplo n.º 2
0
void    GLUI_Mouse_Interaction::draw( int x, int y )
{
  GLUI_DRAWINGSENTINAL_IDIOM
  int text_width	= string_width( this->name );
  int x_left			= this->w/2 - text_width/2;

  if ( NOT draw_active_area_only ) {
    draw_name( x_left, h-4 );
    draw_active_box( x_left-4, x_left+string_width( name )+4, 
		     h, h-14 );
  }

  draw_active_area();
}
Ejemplo n.º 3
0
void    GLUI_Slider::draw( int x, int y )
{
    int orig;

    if ( NOT glui )
        return;

    orig = set_to_glut_window();


    draw_emboss_box(        0,
                            w,
                            GLUI_SLIDER_NAME_TOP_BORDER +
                            GLUI_SLIDER_FONT_HEIGHT - 1 -
                            GLUI_SLIDER_FONT_MID_HEIGHT,
                            h );

    draw_bkgd_box( GLUI_SLIDER_NAME_INDENT-1,
                   GLUI_SLIDER_NAME_INDENT +
                   string_width(name.string) +
                   2*GLUI_SLIDER_NAME_SIDE_BORDER - 1,
                   0,
                   0 +
                   GLUI_SLIDER_FONT_FULL_HEIGHT +
                   GLUI_SLIDER_NAME_TOP_BORDER +
                   GLUI_SLIDER_NAME_BOTTOM_BORDER);

    draw_name(      GLUI_SLIDER_NAME_INDENT +
                    GLUI_SLIDER_NAME_SIDE_BORDER,
                    GLUI_SLIDER_FONT_HEIGHT-1 +
                    GLUI_SLIDER_NAME_TOP_BORDER);

    draw_active_area();

    restore_window(orig);

    draw_active_box(        GLUI_SLIDER_NAME_INDENT,
                            GLUI_SLIDER_NAME_INDENT +
                            string_width(name.string) +
                            2*GLUI_SLIDER_NAME_SIDE_BORDER - 1,
                            0,
                            GLUI_SLIDER_FONT_FULL_HEIGHT +
                            GLUI_SLIDER_NAME_TOP_BORDER +
                            GLUI_SLIDER_NAME_BOTTOM_BORDER - 1);

}
void    GLUI_Mouse_Interaction::draw( int x, int y )
{
  int orig;
  int text_width	= string_width( this->name );
  int x_left			= this->w/2 - text_width/2;
  
  if ( NOT glui )
    return;

  if ( NOT draw_active_area_only ) {
    orig = set_to_glut_window();
    draw_name( x_left, h-4 );
    restore_window(orig);

    draw_active_box( x_left-4, x_left+string_width( name.string )+4, 
		     h, h-14 );
  }

  draw_active_area();
}
Ejemplo n.º 5
0
void    GLUI_Graph::draw( int x, int y )
{

  GLUI_DRAWINGSENTINAL_IDIOM;

	draw_emboss_box(	0,
							w,
							GLUI_GRAPH_NAME_TOP_BORDER +
							GLUI_GRAPH_FONT_HEIGHT - 1 -
							GLUI_GRAPH_FONT_MID_HEIGHT,
							h );

	draw_bkgd_box( GLUI_GRAPH_NAME_INDENT-1,
						GLUI_GRAPH_NAME_INDENT +
						string_width(name) +
						2*GLUI_GRAPH_NAME_SIDE_BORDER - 1,
						0,
						0 +
						GLUI_GRAPH_FONT_FULL_HEIGHT +
						GLUI_GRAPH_NAME_TOP_BORDER +
						GLUI_GRAPH_NAME_BOTTOM_BORDER);

	draw_name(	GLUI_GRAPH_NAME_INDENT +
					GLUI_GRAPH_NAME_SIDE_BORDER,
					GLUI_GRAPH_FONT_HEIGHT-1 +
					GLUI_GRAPH_NAME_TOP_BORDER);

	draw_active_area();

	draw_active_box(	GLUI_GRAPH_NAME_INDENT,
							GLUI_GRAPH_NAME_INDENT +
							string_width(name) +
							2*GLUI_GRAPH_NAME_SIDE_BORDER - 1,
							0,
							GLUI_GRAPH_FONT_FULL_HEIGHT +
							GLUI_GRAPH_NAME_TOP_BORDER +
							GLUI_GRAPH_NAME_BOTTOM_BORDER - 1);

}
Ejemplo n.º 6
0
void   GLUI_Rollout::draw( int x, int y )
{
  GLUI_DRAWINGSENTINAL_IDIOM
  
  int left, right, top, bottom;

  left   = 5;
  right  = w-left;
  top    = 3;
  bottom = 3+16;

  if ( is_open ) 
    draw_emboss_box( 0, w, top+3, h );
  else
    draw_emboss_box( 0, w, top+3, h-7 );

  glui->draw_raised_box( left, top, w-left*2, 16 );

  if ( glui )
    glColor3ub(glui->bkgd_color.r,glui->bkgd_color.g,glui->bkgd_color.b);
  glDisable( GL_CULL_FACE );
  glBegin( GL_QUADS );
  glVertex2i( left+1, top+1 );      glVertex2i( right-1, top+1 );
  glVertex2i( right-1, bottom-1 );  glVertex2i( left+1, bottom-1 );
  glEnd();

  draw_name( left+8, top+11 );

  if ( active ) 
    /*draw_active_box( left+4, left+string_width( name.c_str() )+12,       */
    draw_active_box( left+4, right-17, 
		     top+2, bottom-2 );


  /**   Draw '+' or '-'  **/

  glBegin( GL_LINES );
  if ( is_open ) {
    if ( enabled )		glColor3f( 0.0, 0.0, 0.0 );
    else			glColor3f( 0.5, 0.5, 0.5 );
    glVertex2i(right-14,(top+bottom)/2);  glVertex2i(right-5,(top+bottom)/2);

    glColor3f( 1.0, 1.0, 1.0 );
    glVertex2i(right-14,1+(top+bottom)/2);glVertex2i(right-5,1+(top+bottom)/2);
  }
  else
  {
    glColor3f( 1.0, 1.0, 1.0 );
    glVertex2i(right-9,top+3);							glVertex2i(right-9,bottom-4);
    glVertex2i(right-14,(top+bottom)/2);		glVertex2i(right-5,(top+bottom)/2);

    if ( enabled )		glColor3f( 0.0, 0.0, 0.0 );
    else			glColor3f( 0.5, 0.5, 0.5 );
    glVertex2i(right-14,-1+(top+bottom)/2);
    glVertex2i(right-5,-1+(top+bottom)/2);
    glVertex2i(right-10,top+3);
    glVertex2i(right-10,bottom-4);
  }
  glEnd();

  glLineWidth( 1.0 );
  
  if (currently_inside) {draw_pressed(); /* heavy black outline when pressed */ }
}