/***************************************************************************
                            QRadioButton.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 12:08:37 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QRadioButton.h>
#include <qtobjc/QRadioButton.h>
#include <qtobjc/QPoint.h>

#include <qtobjc/QPainter.h>

@implementation  QRadioButton


- initWithWidget: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QRadioButton((qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QRadioButton((qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent name: (NSString *)name
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QRadioButton1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent 
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QRadioButton1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (BOOL) isChecked
{
	return (BOOL) qt_QRadioButton_isChecked((qt_QRadioButton *)[self qt]);
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QRadioButton_sizeHint((qt_QRadioButton *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- setChecked: (BOOL)check
{
	qt_QRadioButton_setChecked((qt_QRadioButton *)[self qt], (int)check);
	return self;
}

- (BOOL) hitButton: (QPoint*)arg1
{
	return (BOOL) qt_QRadioButton_hitButton((qt_QRadioButton *)[self qt], (qt_QPoint*) [arg1 qt]);
}

- drawButton: (QPainter *)arg1
{
	qt_QRadioButton_drawButton((qt_QRadioButton *)[self qt], (qt_QPainter *) [arg1 qt]);
	return self;
}

- drawButtonLabel: (QPainter *)arg1
{
	qt_QRadioButton_drawButtonLabel((qt_QRadioButton *)[self qt], (qt_QPainter *) [arg1 qt]);
	return self;
}

- updateMask
{
	qt_QRadioButton_updateMask((qt_QRadioButton *)[self qt]);
	return self;
}

@end
