Source Code (Use browser search to find items of interest.)
Class Index
kfract'ColorDlg (./kdegraphics/kfract/kfractdlgs.h:166)
class ColorDlg : public QDialog
{
Q_OBJECT
public:
ColorDlg( DrawView::ColorScheme scheme,
QWidget *parent = 0, const char *name = 0 );
signals:
void colorChanged( DrawView::ColorScheme new_scheme );
protected:
private slots:
void colorAccept();
private:
QRadioButton *hsv_button, *rgb_button;
};
kfract'ColorDlg::ColorDlg() (./kdegraphics/kfract/kfractdlgs.C:655)
ColorDlg::ColorDlg( DrawView::ColorScheme scheme,
QWidget *parent, const char *name ) :
QDialog( parent, name, TRUE )
{
QButtonGroup *bg;
QPushButton *ok, *cancel;
hsv_button = new QRadioButton( i18n("Less colours"), this );
CHECK_PTR( hsv_button );
hsv_button->setGeometry( D_LM + 40, D_TM, 155, 20 );
rgb_button = new QRadioButton( i18n("More colours"), this );
CHECK_PTR( rgb_button );
rgb_button->setGeometry( D_LM + 40, D_TM + 30, 155, 20 );
if ( scheme == DrawView::Rgb )
{
rgb_button->setChecked( TRUE );
}
else
{
hsv_button->setChecked( TRUE );
}
bg = new QButtonGroup( this );
CHECK_PTR( bg );
bg->hide();
bg->insert( hsv_button );
bg->insert( rgb_button );
ok = new QPushButton( this );
CHECK_PTR( ok );
ok->setText( i18n("OK") );
ok->setGeometry( D_LM, D_TM + 60, 60, 30 );
connect( ok, SIGNAL( clicked() ), SLOT( colorAccept() ) );
cancel = new QPushButton( this );
CHECK_PTR( cancel );
cancel->setText( i18n("Cancel") );
cancel->setGeometry( 135, D_TM + 60, 60, 30 );
connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
setCaption( i18n("Colour schemes") );
adjustSize();
setFixedSize( width(), height() );
}
kfract'ColorDlg::colorAccept() (./kdegraphics/kfract/kfractdlgs.C:700)
void ColorDlg::colorAccept()
{
if ( hsv_button->isChecked() )
{
emit colorChanged( DrawView::Hsv );
}
else
{
emit colorChanged( DrawView::Rgb );
}
accept();
}
//##############################################################