~ubuntu-branches/ubuntu/edgy/glui/edgy

« back to all changes in this revision

Viewing changes to glui_column.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2001-09-23 12:57:28 UTC
  • Revision ID: james.westby@ubuntu.com-20010923125728-qbts7xit2eg1ogo2
Tags: upstream-2.1.0.beta
ImportĀ upstreamĀ versionĀ 2.1.0.beta

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
  
 
3
  GLUI User Interface Toolkit
 
4
  ---------------------------
 
5
 
 
6
     glui_column.cpp - GLUI_Column control class
 
7
 
 
8
 
 
9
          --------------------------------------------------
 
10
 
 
11
  Copyright (c) 1998 Paul Rademacher
 
12
 
 
13
  This program is freely distributable without licensing fees and is
 
14
  provided without guarantee or warrantee expressed or implied. This
 
15
  program is -not- in the public domain.
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
#include "glui.h"
 
20
#include "stdinc.h"
 
21
 
 
22
/**************************************** GLUI_Column::draw() ************/
 
23
 
 
24
void  GLUI_Column::draw( int x, int y )
 
25
{
 
26
  int   orig;
 
27
  int   panel_x, panel_y, panel_w, panel_h, panel_x_off, panel_y_off;
 
28
  int   y_diff;
 
29
  
 
30
  if ( NOT can_draw() )
 
31
    return;
 
32
 
 
33
  if ( int_val == 1 ) {  /* Draw a vertical bar */
 
34
    orig = set_to_glut_window();
 
35
 
 
36
    if ( parent() != NULL ) {
 
37
      get_this_column_dims(&panel_x, &panel_y, &panel_w, &panel_h, 
 
38
                           &panel_x_off, &panel_y_off);
 
39
 
 
40
      y_diff = y_abs - panel_y;
 
41
 
 
42
      if ( 0 ) {
 
43
        glLineWidth(1.0);
 
44
        glBegin( GL_LINES );
 
45
        glColor3f( .5, .5, .5 );
 
46
        glVertex2i( -GLUI_XOFF+1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );
 
47
        glVertex2i( -GLUI_XOFF+1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);
 
48
 
 
49
        glColor3f( 1.0, 1.0, 1.0 );
 
50
        glVertex2i( -GLUI_XOFF+2, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );
 
51
        glVertex2i( -GLUI_XOFF+2, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);
 
52
        glEnd();
 
53
      }
 
54
      else {
 
55
        glLineWidth(1.0);
 
56
        glBegin( GL_LINES );
 
57
        glColor3f( .5, .5, .5 );
 
58
        glVertex2i( -2, 0 );
 
59
        glVertex2i( -2, h );
 
60
        /*glVertex2i( 0, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );              */
 
61
        /*glVertex2i( 0, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);              */
 
62
 
 
63
        glColor3f( 1.0, 1.0, 1.0 );
 
64
        glVertex2i( -1, 0 );
 
65
        glVertex2i( -1, h );
 
66
        /*glVertex2i( 1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 );              */
 
67
        /*glVertex2i( 1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2);              */
 
68
        glEnd();
 
69
      }
 
70
                        
 
71
    }    
 
72
 
 
73
    restore_window(orig);
 
74
  }
 
75
}
 
76