Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

group_box.cpp

Go to the documentation of this file.
00001 #include "group_box.h"
00002 #include "cursive.h"
00003 #include <ncurses.h>
00004 
00005 namespace crs {
00006 
00007   group_box::group_box( const std::string &Caption, base_control *Parent, 
00008       const unsigned int Left, const unsigned int Top, const unsigned int Width, const unsigned int Height ):
00009   base_control( Parent, 0, Left, Top, Width, Height ), caption( Caption ) { 
00010   }
00011 
00012   void group_box::draw() {
00013     base_control::draw();
00014     buffer.drawHLine( 1, 0, mWidth - 2, sc::HorizontalLine );           // upper border
00015     buffer.drawHLine( 1, mHeight - 1, mWidth - 2, sc::HorizontalLine ); // lower border
00016     buffer[ 0 ] = sc::UpperLeftCorner;                                  // upper left corner
00017     buffer[ mWidth - 1 ] = sc::UpperRightCorner;                        // upper right corner
00018     buffer[ ( mHeight - 1 ) * mWidth ] = sc::LowerLeftCorner;           // lower left corner
00019     buffer[ mHeight * mWidth - 1 ] = sc::LowerRightCorner;              // lower right corner
00020     buffer.drawVLine( 0, 1, mHeight - 2, sc::VerticalLine );            // left border
00021     buffer.drawVLine( mWidth - 1, 1, mHeight - 2, sc::VerticalLine );   // right border
00022     buffer.setText( caption, 1, 0 );
00023   }
00024 
00025 }

Generated on Mon May 19 20:36:04 2003 for cursive by doxygen1.2.18