예제 #1
0
void configDialog::initPlots3DPage()
{
	ApplicationWindow *app = (ApplicationWindow *)parentWidget();
	plots3D = new QWidget( generalDialog, "plots3D" );

	QVBox  *box=new QVBox (plots3D, "box"); 
	box->setSpacing (5);

	QButtonGroup *GroupBox77 = new QButtonGroup(2,QGroupBox::Horizontal,QString::null, box, "GroupBox7" );
	lblResolution = new QLabel(GroupBox77, "lblResolution",0 ); 
	boxResolution = new QSpinBox(1, 100, 1, GroupBox77, "boxResolution" );
	boxResolution->setValue(app->plot3DResolution);

	boxShowLegend = new QCheckBox(GroupBox77, "boxShowLegend" );
	boxShowLegend->setChecked(app->showPlot3DLegend);

	boxShowProjection = new QCheckBox(GroupBox77, "boxShowProjection" );
	boxShowProjection->setChecked(app->showPlot3DProjection);

	boxSmoothMesh = new QCheckBox(GroupBox77, "boxSmoothMesh" );
	boxSmoothMesh->setChecked(app->smooth3DMesh);

	GroupBox3DCol = new QButtonGroup(4,QGroupBox::Horizontal,tr( "Colors" ),box, "GroupBox3DCol" );
	btnFromColor = new QPushButton( GroupBox3DCol, "btnFrom" );
	btnLabels = new QPushButton( GroupBox3DCol, "btnLabels" );
	btnMesh = new QPushButton( GroupBox3DCol, "btnMesh" );	
	btnGrid = new QPushButton( GroupBox3DCol, "btnGrid" );
	btnToColor = new QPushButton( GroupBox3DCol, "btnTo" );
	btnNumbers = new QPushButton( GroupBox3DCol, "btnNumbers" );
	btnAxes = new QPushButton( GroupBox3DCol, "btnAxes" );
	btnBackground3D = new QPushButton( GroupBox3DCol, "btnBackground" );

	GroupBox3DFonts = new QButtonGroup(3,QGroupBox::Horizontal,tr( "Fonts" ),box, "GroupBox3DFonts" );
	btnTitleFnt = new QPushButton( GroupBox3DFonts, "btnTitleFnt" );
	btnLabelsFnt = new QPushButton( GroupBox3DFonts, "btnLabelsFnt" );
	btnNumFnt = new QPushButton( GroupBox3DFonts, "btnNumFnt" );
   	
	QVBoxLayout* hlayout2 = new QVBoxLayout(plots3D, 0, 5, "hlayout2");
	hlayout2->addWidget(box);
	
	connect( btnAxes, SIGNAL( clicked() ), this, SLOT(pick3DAxesColor() ) );
	connect( btnLabels, SIGNAL( clicked() ), this, SLOT(pick3DLabelsColor() ) );
	connect( btnNumbers, SIGNAL( clicked() ), this, SLOT(pick3DNumbersColor() ) );
	connect( btnBackground3D, SIGNAL( clicked() ), this, SLOT(pick3DBackgroundColor()));
	connect( btnFromColor, SIGNAL( clicked() ), this, SLOT(pickDataMinColor() ) );
	connect( btnToColor, SIGNAL( clicked() ), this, SLOT(pickDataMaxColor() ) );
	connect( btnGrid, SIGNAL( clicked() ), this, SLOT(pickGridColor() ) );
	connect( btnMesh, SIGNAL( clicked() ), this, SLOT(pickMeshColor() ) );

	connect( btnNumFnt, SIGNAL( clicked() ), this, SLOT(pick3DNumbersFont() ) );
	connect( btnTitleFnt, SIGNAL( clicked() ), this, SLOT(pick3DTitleFont() ) );
	connect( btnLabelsFnt, SIGNAL( clicked() ), this, SLOT(pick3DAxesFont() ) );
}
void Plot3DDialog::initColorsPage()
{
    QVBoxLayout* vl1 = new QVBoxLayout();
	btnFromColor = new QPushButton(tr( "Ma&x" ));
    vl1->addWidget(btnFromColor);
	btnToColor = new QPushButton(tr( "&Min" ));
    vl1->addWidget(btnToColor);
	btnColorMap = new QPushButton(tr( "Color Ma&p" ));
    vl1->addWidget(btnColorMap);
    vl1->addStretch();

    QGroupBox *gb1 = new QGroupBox(tr( "Data" ));
    gb1->setLayout(vl1);

    QVBoxLayout* vl2 = new QVBoxLayout();
	btnMesh = new QPushButton(tr( "&Line" ));
    vl2->addWidget(btnMesh);
	btnBackground = new QPushButton(tr( "&Background" ));
    vl2->addWidget(btnBackground);
    vl2->addStretch();

    QGroupBox *gb2 = new QGroupBox(tr( "General" ));
    gb2->setLayout(vl2);

    QGridLayout *gl1 = new QGridLayout();
	btnAxes = new QPushButton(tr( "&Axes" ));
    gl1->addWidget(btnAxes, 0, 0);
	btnLabels = new QPushButton(tr( "Lab&els" ));
    gl1->addWidget(btnLabels, 0, 1);
	btnNumbers = new QPushButton(tr( "&Numbers" ));
    gl1->addWidget(btnNumbers, 1, 0);
	btnGrid = new QPushButton(tr( "&Grid" ));
    gl1->addWidget(btnGrid, 1, 1);
    gl1->setRowStretch(2, 1);

    AxesColorGroupBox = new QGroupBox(tr( "Coordinate System" ));
    AxesColorGroupBox->setLayout(gl1);

    QHBoxLayout* hb1 = new QHBoxLayout();
	hb1->addWidget(gb1);
    hb1->addWidget(gb2);
    hb1->addWidget(AxesColorGroupBox);

    QHBoxLayout* hb2 = new QHBoxLayout();
    hb2->addStretch();
	hb2->addWidget(new QLabel( tr( "Opacity" )));
	boxTransparency = new QSpinBox();
    boxTransparency->setRange(0, 100);
    boxTransparency->setSingleStep(5);
    hb2->addWidget(boxTransparency);

	QVBoxLayout* vl = new QVBoxLayout();
	vl->addLayout(hb2);
	vl->addLayout(hb1);

    colors = new QWidget();
    colors->setLayout(vl);
	generalDialog->insertTab(colors, tr( "&Colors" ) );

	connect( btnAxes, SIGNAL( clicked() ), this, SLOT(pickAxesColor() ) );
	connect( btnLabels, SIGNAL( clicked() ), this, SLOT(pickLabelColor() ) );
	connect( btnNumbers, SIGNAL( clicked() ), this, SLOT(pickNumberColor() ) );
	connect( btnBackground, SIGNAL( clicked() ), this, SLOT(pickBgColor() ) );
	connect( btnFromColor, SIGNAL( clicked() ), this, SLOT(pickFromColor() ) );
	connect( btnToColor, SIGNAL( clicked() ), this, SLOT(pickToColor() ) );
	connect( btnColorMap, SIGNAL( clicked() ), this, SLOT(pickDataColorMap() ) );
	connect( btnGrid, SIGNAL( clicked() ), this, SLOT(pickGridColor() ) );
	connect( btnMesh, SIGNAL( clicked() ), this, SLOT(pickMeshColor() ) );
	connect( boxTransparency, SIGNAL( valueChanged(int) ), this, SLOT(changeTransparency(int) ) );
}