summaryrefslogtreecommitdiffstats
path: root/tools/designer/examples/receiver2/receiver.cpp
blob: 2f6f1153a346f71c3905668fabc47630132a0882 (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 <tqradiobutton.h>
#include <tqspinbox.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() );
}