#include "cctrlparambase.h"

CCtrlParamBase::CCtrlParamBase(QWidget *parent) : CMWidget(parent)
{
    m_hor=QSizePolicy::Preferred;
    m_ver=QSizePolicy::Fixed;
    staticname=new QLabel(this);
    staticuint=new QLabel(this);
    layout=new QHBoxLayout(this);
    layout->addWidget(staticname);
    staticname->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    staticuint->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    staticname->setText("name:");
    staticuint->setText("mm");
    staticname->setAlignment(Qt::AlignRight);
    staticuint->setAlignment(Qt::AlignLeft);
    layout->setSpacing(2);
    layout->setContentsMargins(2, 2, 2, 2);
    layout->setSpacing(0);
    layout->setMargin(0);
    setContentsMargins(0,0,0,0);

    staticname->setAlignment(Qt::AlignRight);
    m_iprecise=0;
	m_pParam=0;
}

void CCtrlParamBase::MParamInit(Variant* pParam, QString name)
{
    m_pParam=pParam;
    QString s=name;
    if(name.isEmpty())
    {
        s=m_pParam->m_sName;
    }
    s.replace(QString("_"), QString(" "));
    staticname->setText(QString::fromUtf8("%1:").arg(s));
    staticuint->setText(pParam->m_sUnit);
    MFresh();
}

void CCtrlParamBase::MTimeFresh()
{
    MFresh();
}

void CCtrlParamBase::MFresh()
{

}

void CCtrlParamBase::MApply()
{
}

