Source Code (Use browser search to find items of interest.)
Class Index
kcalc'ConfigDlg (./kdeutils/kcalc/configdlg.h:47)
class ConfigDlg : public QDialog {
Q_OBJECT
public:
ConfigDlg(QWidget *parent=0, const char *name=0,
KApplication* k=NULL, DefStruct *defstruct=NULL);
~ConfigDlg() {}
DefStruct *defst ;
QLineEdit *mail;
QLineEdit *print;
private slots:
void okButton();
void cancelbutton();
void set_fore_color();
void set_background_color();
void help();
signals:
void color_change();
public:
bool colors_changed;
private:
QGroupBox *box;
QPushButton *ok;
QPushButton *cancel;
QLabel *label1;
QFrame *qframe1;
QPushButton *button1;
QLabel *label2;
QFrame *qframe2;
QPushButton *button2;
QLabel *label3;
QFrame *qframe3;
QPushButton *button3;
QLabel *label4;
QFrame *qframe4;
QPushButton *button4;
KApplication* mykapp; // never use kapp;
QLabel *label5;
QLabel *label6;
QLabel *label7;
QLabel *label8;
QGroupBox *gbox;
QCheckBox *cb;
QCheckBox *cb2;
QSpinBox* precspin;
QSpinBox* precspin2;
QCheckBox *mybox;
QCheckBox *frame3d;
QButtonGroup *stylegroup;
QLabel *stylelabel;
QRadioButton *trigstyle;
QRadioButton *statstyle;
};
kcalc'ConfigDlg::ConfigDlg() (./kdeutils/kcalc/configdlg.cpp:42)
ConfigDlg::ConfigDlg(QWidget *parent, const char *name,
KApplication *_mykapp, DefStruct *defstruct)
: QDialog(parent, name)
{
// Torben
mykapp = _mykapp;
defst = defstruct;
box = new QGroupBox(this, "box");
box->setGeometry(10,10,320,260);
box->setTitle(i18n("Defaults"));
label1 = new QLabel(this);
label1->setGeometry(30,40,135,25);
label1->setText(i18n("Foreground Color:"));
qframe1 = new QFrame(this);
qframe1->setGeometry(155,40,30,25);
qframe1->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
qframe1->setBackgroundColor(defst->forecolor);
button1 = new QPushButton(this);
button1->setGeometry(205,40,100,25);
button1->setText(i18n("Change"));
connect(button1,SIGNAL(clicked()),this,SLOT(set_fore_color()));
label2 = new QLabel(this);
label2->setGeometry(30,75,135,25);
label2->setText(i18n("Background Color:"));
qframe2 = new QFrame(this);
qframe2->setGeometry(155,75,30,25);
qframe2->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
qframe2->setBackgroundColor(defst->backcolor);
button2 = new QPushButton(this);
button2->setGeometry(205,75,100,25);
button2->setText(i18n("Change"));
connect(button2,SIGNAL(clicked()),this,SLOT(set_background_color()));
label5 = new QLabel(this);
label5->setGeometry(30,115,100,25);
label5->setText(i18n("Precision:"));
int maxprec;
#ifdef HAVE_LONG_DOUBLE
maxprec = 16 ;
#else
maxprec = 12 ;
#endif
precspin = new QSpinBox(0, maxprec, 1, this);
precspin->setGeometry(205,115,40,23);
if( defst->precision <= maxprec)
precspin->setValue(defst->precision);
else
precspin->setValue(maxprec);
cb = new QCheckBox(this);
cb->setGeometry(30,145,130,25);
cb->setText(i18n("Set Fixed Precision at:"));
if(defst->fixed)
cb->setChecked(true);
int fixprec;
#ifdef HAVE_LONG_DOUBLE
fixprec = 14 ;
#else
fixprec = 10 ;
#endif
precspin2 = new QSpinBox(0, fixprec, 1, this);
precspin2->setGeometry(205,145,40,23);
if( defst->fixedprecision <= fixprec)
precspin2->setValue(defst->fixedprecision);
else
precspin2->setValue(fixprec);
button3 = new QPushButton(this);
button3->setGeometry(205,225,100,25);
button3->setText(i18n("Help"));
connect(button3,SIGNAL(clicked()),this,SLOT(help()));
cb2 = new QCheckBox(this);
cb2->setGeometry(30,170,130,25);
cb2->setText(i18n("Beep on Error"));
if(defst->beep)
cb2->setChecked(true);
stylegroup = new QButtonGroup(this,"stylegroup");
stylegroup->setGeometry(20,190,170,60);
stylegroup->setFrameStyle(QFrame::NoFrame);
trigstyle = new QRadioButton(i18n("Trigonometry Mode"),stylegroup,"trigstyle");
trigstyle->move(10,15);
trigstyle->adjustSize();
trigstyle->setChecked(defst->style == 0);
statstyle = new QRadioButton(i18n("Statistical Mode"),stylegroup,"Stats");
statstyle->move(10,40);
statstyle->adjustSize();
statstyle->setChecked(defst->style ==1);
connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton()));
}
kcalc'ConfigDlg::help() (./kdeutils/kcalc/configdlg.cpp:166)
void ConfigDlg::help(){
mykapp->invokeHTMLHelp("","");
}
kcalc'ConfigDlg::okButton() (./kdeutils/kcalc/configdlg.cpp:172)
void ConfigDlg::okButton(){
defst->precision = precspin->value();
defst->fixedprecision = precspin2->value();
defst->fixed = cb->isChecked();
defst->beep = cb2->isChecked();
if( trigstyle->isChecked())
defst->style = 0;
else
defst->style = 1;
}
kcalc'ConfigDlg::cancelbutton() (./kdeutils/kcalc/configdlg.cpp:186)
void ConfigDlg::cancelbutton() {
reject();
}
kcalc'ConfigDlg::set_fore_color() (./kdeutils/kcalc/configdlg.cpp:193)
void ConfigDlg::set_fore_color(){
KColorDialog::getColor(defst->forecolor);
qframe1->setBackgroundColor(defst->forecolor);
}
kcalc'ConfigDlg::set_background_color() (./kdeutils/kcalc/configdlg.cpp:202)
void ConfigDlg::set_background_color(){
KColorDialog::getColor(defst->backcolor);
qframe2->setBackgroundColor(defst->backcolor);
}