summaryrefslogtreecommitdiffstats
path: root/tools/designer/examples/receiver2/receiver.cpp
blob: 6ad18cc83da47fb240dd85802e685fb7e915d723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <qradiobutton.h>
#include <qspinbox.h>
#include "receiver.h"

void Receiver::setParent( TQDialog *parent )
{
    p = parent;
    setAmount();
}

void Receiver::setAmount() 
{
    TQSpinBox *amount = 
	(TQSpinBox *) p->child( "amountSpinBox", "TQSpinBox" );

    TQRadioButton *radio = 
	(TQRadioButton *) p->child( "stdRadioButton", "TQRadioButton" );
    if ( radio && radio->isChecked() ) {
	if ( amount )
	    amount->setValue( amount->maxValue() / 2 );
	return;
    }

    radio = 
	(TQRadioButton *) p->child( "noneRadioButton", "TQRadioButton" );
    if ( radio && radio->isChecked() )
	if ( amount )
	    amount->setValue( amount->minValue() );
}