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 );
00015 buffer.drawHLine( 1, mHeight - 1, mWidth - 2, sc::HorizontalLine );
00016 buffer[ 0 ] = sc::UpperLeftCorner;
00017 buffer[ mWidth - 1 ] = sc::UpperRightCorner;
00018 buffer[ ( mHeight - 1 ) * mWidth ] = sc::LowerLeftCorner;
00019 buffer[ mHeight * mWidth - 1 ] = sc::LowerRightCorner;
00020 buffer.drawVLine( 0, 1, mHeight - 2, sc::VerticalLine );
00021 buffer.drawVLine( mWidth - 1, 1, mHeight - 2, sc::VerticalLine );
00022 buffer.setText( caption, 1, 0 );
00023 }
00024
00025 }