finalcut/src/fradiobutton.cpp

97 lines
1.8 KiB
C++
Raw Normal View History

// File: fradiobutton.cpp
// Provides: class FRadioButton
2015-05-23 13:35:12 +02:00
#include "fapp.h"
#include "fradiobutton.h"
//----------------------------------------------------------------------
// class FRadioButton
//----------------------------------------------------------------------
// constructor and destructor
//----------------------------------------------------------------------
2015-10-10 04:01:22 +02:00
FRadioButton::FRadioButton(FWidget* parent)
: FToggleButton(parent)
2015-05-23 13:35:12 +02:00
{
2015-07-04 22:51:47 +02:00
init();
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
2015-09-22 04:18:20 +02:00
FRadioButton::FRadioButton ( const FString& txt, FWidget* parent )
: FToggleButton(txt, parent)
2015-05-23 13:35:12 +02:00
{
2015-07-04 22:51:47 +02:00
init();
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
FRadioButton::~FRadioButton() // destructor
2015-09-22 04:18:20 +02:00
{ }
2015-05-23 13:35:12 +02:00
// private methods of FRadioButton
2015-07-04 22:51:47 +02:00
//----------------------------------------------------------------------
void FRadioButton::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 FRadioButton::draw()
{
drawRadioButton();
drawLabel();
FToggleButton::draw();
}
//----------------------------------------------------------------------
void FRadioButton::drawRadioButton()
{
if ( ! isVisible() )
return;
setPrintPos (1,1);
setColor();
2015-10-11 21:56:16 +02:00
if ( isMonochron() )
{
if ( hasFocus() )
setReverse(false);
else
setReverse(true);
}
2015-05-23 13:35:12 +02:00
if ( checked )
{
if ( isNewFont() )
print (CHECKED_RADIO_BUTTON);
else
{
print ('(');
2016-11-20 21:15:43 +01:00
if ( isCygwinTerminal() )
print (0x04);
else
print (fc::Bullet); // Bullet ●
2015-05-23 13:35:12 +02:00
print (')');
}
}
else
{
if ( isNewFont() )
print (RADIO_BUTTON);
else
{
print ('(');
print (' ');
print (')');
}
}
2015-10-11 21:56:16 +02:00
if ( isMonochron() )
setReverse(false);
2015-05-23 13:35:12 +02:00
}