finalcut/src/fcheckbox.cpp

93 lines
1.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// File: fcheckbox.cpp
// Provides: class FCheckBox
#include "fcheckbox.h"
//----------------------------------------------------------------------
// class FCheckBox
//----------------------------------------------------------------------
// constructor and destructor
//----------------------------------------------------------------------
FCheckBox::FCheckBox(FWidget* parent)
: FToggleButton(parent)
{
init();
}
//----------------------------------------------------------------------
FCheckBox::FCheckBox (const FString& txt, FWidget* parent)
: FToggleButton(txt, parent)
{
init();
}
//----------------------------------------------------------------------
FCheckBox::~FCheckBox() // destructor
{ }
// private methods of FCheckBox
//----------------------------------------------------------------------
void FCheckBox::init()
{
label_offset_pos = 4;
button_width = 4;
setVisibleCursor();
}
//----------------------------------------------------------------------
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 ( isMonochron() )
{
if ( hasFocus() )
setReverse(false);
else
setReverse(true);
}
if ( checked )
{
if ( isNewFont() )
print (CHECKBOX_ON);
else
{
print ('[');
print (fc::Times); // Times ×
print (']');
}
}
else
{
if ( isNewFont() )
print (CHECKBOX);
else
{
print ('[');
print (' ');
print (']');
}
}
if ( isMonochron() )
setReverse(false);
}