6
#include <qradiobutton.h>
11
* Constructs a CTrigger which is a child of 'parent', with the
14
CTrigger::CTrigger( QWidget* parent, const char* name )
15
: QGroupBox( parent, name )
17
setFrameShape( QGroupBox::WinPanel );
18
setFrameShadow( QGroupBox::Raised );
19
setAlignment( int( QGroupBox::AlignHCenter ) );
21
TriggerText = new QLineEdit( this, "TriggerText" );
22
// TriggerText->setMaxLength( 80 );
24
Activate = new QRadioButton( this, "Activate" );
29
* Destroys the object and frees any allocated resources
33
// no need to delete child widgets, Qt does it all for us
37
* Sets the strings of the subwidgets using the current
40
void CTrigger::languageChange()
42
setTitle( tr( "Trigger" ) );
43
TriggerText->setText( tr( "CQ CQ" ) );
44
Activate->setText( tr( "Activate" ) );
47
void CTrigger::resizeEvent( QResizeEvent * )
49
calculateSizeofComponents();
52
void CTrigger::calculateSizeofComponents()
54
#define LEFTANDRIGHTMARGIN 5
56
#define LABELHEIGHT 30
57
int xpos,ypos,width,height,innerwidth,innerheight;
59
height=this->height();
60
xpos=width*LEFTANDRIGHTMARGIN/100;
62
innerwidth=width-2*xpos;
63
innerheight=height*LABELHEIGHT/100;
64
TriggerText->setGeometry(xpos,ypos,innerwidth,innerheight);
65
ypos=ypos+innerheight;
66
Activate->setGeometry(xpos+1,ypos,innerwidth-2,innerheight);
67
this->setFrameRect(QRect(0,0,width,height));