1
/****************************************************************************
3
GLUI User Interface Toolkit
4
---------------------------
6
glui_separator.cpp - GLUI_Separator control class
9
--------------------------------------------------
11
Copyright (c) 1998 Paul Rademacher
13
WWW: http://sourceforge.net/projects/glui/
14
Forums: http://sourceforge.net/forum/?group_id=92496
16
This library is free software; you can redistribute it and/or
17
modify it under the terms of the GNU Lesser General Public
18
License as published by the Free Software Foundation; either
19
version 2.1 of the License, or (at your option) any later version.
21
This library is distributed in the hope that it will be useful,
22
but WITHOUT ANY WARRANTY; without even the implied warranty of
23
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24
Lesser General Public License for more details.
26
You should have received a copy of the GNU Lesser General Public
27
License along with this library; if not, write to the Free Software
28
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30
*****************************************************************************/
32
#include "glui_internal_control.h"
34
/****************************** GLUI_Separator::GLUI_Separator() **********/
36
GLUI_Separator::GLUI_Separator( GLUI_Node *parent )
39
parent->add_control( this );
42
/****************************** GLUI_Separator::draw() **********/
44
void GLUI_Separator::draw( int x, int y )
46
GLUI_DRAWINGSENTINAL_IDIOM
49
int cont_x, cont_y, cont_w, cont_h, cont_x_off, cont_y_off;
51
if ( parent() != NULL ) {
52
get_this_column_dims(&cont_x, &cont_y, &cont_w, &cont_h,
53
&cont_x_off, &cont_y_off);
55
width = cont_w - cont_x_off*2;
61
indent = (int) floor(width * .05);
65
glColor3f( .5, .5, .5 );
66
glVertex2i( indent, GLUI_SEPARATOR_HEIGHT/2-1 );
67
glVertex2i( width-indent, GLUI_SEPARATOR_HEIGHT/2-1 );
69
glColor3f( 1., 1., 1. );
70
glVertex2i( indent, GLUI_SEPARATOR_HEIGHT/2 );
71
glVertex2i( width-indent, GLUI_SEPARATOR_HEIGHT/2 );