finalcut/src/fcheckbox.cpp

81 lines
1.6 KiB
C++
Raw Normal View History

2015-05-23 13:35:12 +02:00
// fcheckbox.cpp
// class FCheckBox
#include "fcheckbox.h"
//----------------------------------------------------------------------
// class FCheckBox
//----------------------------------------------------------------------
// constructor and destructor
//----------------------------------------------------------------------
FCheckBox::FCheckBox(FWidget* parent) : FToggleButton(parent)
{
2015-07-04 22:51:47 +02:00
init();
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
FCheckBox::FCheckBox ( const FString& txt,
FWidget* parent ) : FToggleButton(txt, parent)
{
2015-07-04 22:51:47 +02:00
init();
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
FCheckBox::~FCheckBox() // destructor
{
}
// private methods of FCheckBox
2015-07-04 22:51:47 +02:00
//----------------------------------------------------------------------
void FCheckBox::init()
{
label_offset_pos = 4;
button_width = 4;
setVisibleCursor();
2015-07-04 22:51:47 +02:00
}
2015-05-23 13:35:12 +02:00
//----------------------------------------------------------------------
void FCheckBox::draw()
{
setUpdateVTerm(false);
drawCheckButton();
drawLabel();
setUpdateVTerm(true);
FToggleButton::draw();
}
//----------------------------------------------------------------------
void FCheckBox::drawCheckButton()
{
if ( ! isVisible() )
return;
gotoxy (xpos+xmin-1, ypos+ymin-1);
setColor (foregroundColor, backgroundColor);
if ( checked )
{
if ( isNewFont() )
print (CHECKBOX_ON);
else
{
print ('[');
print ('x');
print (']');
}
}
else
{
if ( isNewFont() )
print (CHECKBOX);
else
{
print ('[');
print (' ');
print (']');
}
}
}