void GLUI_Button::draw( int x, int y ) { if (currently_inside) draw_pressed(); else { glui->draw_raised_box( 0, 0, w, h ); draw_text( 0 ); } }
void ui_button::draw(){ if(activate){ glDisable(GL_TEXTURE_2D); if(currently_inside) draw_pressed(); else { draw_text(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 */ } }