1 /****************************************************************************
2 GLUI User Interface Toolkit
3 ---------------------------
5 glui_column.cpp - GLUI_Column control class
8 --------------------------------------------------
10 Copyright (c) 1998 Paul Rademacher
12 WWW: http://sourceforge.net/projects/glui/
13 Forums: http://sourceforge.net/forum/?group_id=92496
15 This library is free software; you can redistribute it and/or
16 modify it under the terms of the GNU Lesser General Public
17 License as published by the Free Software Foundation; either
18 version 2.1 of the License, or (at your option) any later version.
20 This library is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 Lesser General Public License for more details.
25 You should have received a copy of the GNU Lesser General Public
26 License along with this library; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *****************************************************************************/
31 #include "glui_internal_control.h"
33 /******************************** GLUI_Column::GLUI_Column() ************/
35 GLUI_Column::GLUI_Column( GLUI_Node *parent, int draw_bar )
38 int_val = draw_bar; /* Whether to draw vertical bar or not */
40 parent->add_control( this );
43 /**************************************** GLUI_Column::draw() ************/
45 void GLUI_Column::draw( int x, int y )
47 int panel_x, panel_y, panel_w, panel_h, panel_x_off, panel_y_off;
50 if ( int_val == 1 ) { /* Draw a vertical bar */
51 GLUI_DRAWINGSENTINAL_IDIOM
52 if ( parent() != NULL ) {
53 get_this_column_dims(&panel_x, &panel_y, &panel_w, &panel_h,
54 &panel_x_off, &panel_y_off);
56 y_diff = y_abs - panel_y;
61 glColor3f( .5, .5, .5 );
62 glVertex2i( -GLUI_XOFF+1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );
63 glVertex2i( -GLUI_XOFF+1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);
65 glColor3f( 1.0, 1.0, 1.0 );
66 glVertex2i( -GLUI_XOFF+2, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );
67 glVertex2i( -GLUI_XOFF+2, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);
73 glColor3f( .5, .5, .5 );
76 /*glVertex2i( 0, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); */
77 /*glVertex2i( 0, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); */
79 glColor3f( 1.0, 1.0, 1.0 );
82 /*glVertex2i( 1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); */
83 /*glVertex2i( 1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); */