Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "StdMeshersGUI_QuadrangleParamWdg.h"
00024
00025 #include "SMESHGUI.h"
00026
00027 #include "SUIT_ResourceMgr.h"
00028
00029
00030 #include <QButtonGroup>
00031 #include <QRadioButton>
00032 #include <QLabel>
00033 #include <QGridLayout>
00034
00035
00036 #include <SALOMEconfig.h>
00037 #include CORBA_CLIENT_HEADER(SMESH_BasicHypothesis)
00038
00039 #define SPACING 6
00040 #define MARGIN 0
00041
00042
00043
00044
00045
00046 StdMeshersGUI_QuadrangleParamWdg::StdMeshersGUI_QuadrangleParamWdg (QWidget * parent)
00047 : QWidget(parent),
00048 myType(0)
00049 {
00050 myType = new QButtonGroup (this);
00051
00052 QGridLayout* typeLay = new QGridLayout( this );
00053
00054 typeLay->setMargin(MARGIN);
00055 typeLay->setSpacing(SPACING);
00056
00057 QString aTypeKey ("SMESH_QUAD_TYPE_%1");
00058 QString aPictKey ("ICON_StdMeshers_Quadrangle_Params_%1");
00059
00060 int itype = 0;
00061 for (; itype < int(StdMeshers::QUAD_NB_TYPES); itype++) {
00062 QRadioButton* rbi = new QRadioButton (tr(aTypeKey.arg(itype).toLatin1()), this);
00063 QPixmap pmi (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr(aPictKey.arg(itype).toLatin1())));
00064 QLabel* pli = new QLabel (this);
00065 pli->setPixmap(pmi);
00066 typeLay->addWidget(rbi, itype, 0, 1, 1);
00067 typeLay->addWidget(pli, itype, 1, 1, 1);
00068 myType->addButton(rbi, itype);
00069 }
00070 myType->button(0)->setChecked(true);
00071
00072 setLayout(typeLay);
00073 setMinimumWidth(300);
00074 }
00075
00076
00077
00078
00079
00080 StdMeshersGUI_QuadrangleParamWdg::~StdMeshersGUI_QuadrangleParamWdg()
00081 {
00082 }
00083
00084
00085
00086
00087
00088 void StdMeshersGUI_QuadrangleParamWdg::SetType (int theType)
00089 {
00090 myType->button(theType)->setChecked(true);
00091 }
00092
00093
00094
00095
00096
00097 int StdMeshersGUI_QuadrangleParamWdg::GetType()
00098 {
00099 return myType->checkedId();
00100 }