50 #include <Wt/WItemDelegate.h> 51 #include <Wt/WLineEdit.h> 57 #include "FieldDefBase.h" 79 m_placeholderText(ph),
103 m_placeholderText(ph),
111 void Wtx::Dbo::FieldDefBase::init()
118 tableDef().push_back( *
this );
126 const char * Wtx::Dbo::FieldDefBase::fieldName()
const 131 const std::string & Wtx::Dbo::FieldDefBase::aliasName()
const 136 int Wtx::Dbo::FieldDefBase::width()
const 141 void Wtx::Dbo::FieldDefBase::setWidth(
int value )
146 int Wtx::Dbo::FieldDefBase::height()
const 151 void Wtx::Dbo::FieldDefBase::setHeight(
int value )
156 bool Wtx::Dbo::FieldDefBase::isReadOnly()
const 161 void Wtx::Dbo::FieldDefBase::setIsReadOnly(
bool value )
163 m_isReadOnly = value;
166 bool Wtx::Dbo::FieldDefBase::isUnique()
const 171 void Wtx::Dbo::FieldDefBase::setIsUnique(
bool value )
176 bool Wtx::Dbo::FieldDefBase::isVisible()
const 181 void Wtx::Dbo::FieldDefBase::setIsVisible(
bool value )
186 const std::string & Wtx::Dbo::FieldDefBase::label()
const 191 void Wtx::Dbo::FieldDefBase::setLabel(
const std::string & value )
196 const std::string & Wtx::Dbo::FieldDefBase::placeholderText()
const 198 return m_placeholderText;
201 void Wtx::Dbo::FieldDefBase::setPlaceholderText(
const std::string & value )
203 m_placeholderText = value;
206 const std::string & Wtx::Dbo::FieldDefBase::info()
const 211 void Wtx::Dbo::FieldDefBase::setInfo(
const std::string & value )
216 const std::string & Wtx::Dbo::FieldDefBase::toolTip()
const 221 void Wtx::Dbo::FieldDefBase::setToolTip(
const std::string & value )
226 int Wtx::Dbo::FieldDefBase::helpTopic()
const 231 void Wtx::Dbo::FieldDefBase::setHelpTopic(
int value )
246 const std::string & Wtx::Dbo::FieldDefBase::defaultValue()
const 248 return m_defaultValue;
251 void Wtx::Dbo::FieldDefBase::setDefaultValue(
const std::string & value )
253 m_defaultValue = value;
256 bool Wtx::Dbo::FieldDefBase::forceUppercase()
const 258 return m_forceUppercase || Wtx::forceUppercase();
261 void Wtx::Dbo::FieldDefBase::setForceUppercase(
bool value )
263 m_forceUppercase = value;
266 const std::string & Wtx::Dbo::FieldDefBase::inputMask()
const 271 void Wtx::Dbo::FieldDefBase::setInputMask(
const std::string & mask, Wt::WFlags< Wt::InputMaskFlag > flags )
274 m_inputMaskFlags = flags;
277 std::unique_ptr<Wt::WItemDelegate> Wtx::Dbo::FieldDefBase::createItemDelegate(
int sid,
Wtx::Dbo::Session & session )
const 280 return std::make_unique<Wt::WItemDelegate>();
283 std::unique_ptr<Wt::WWidget> Wtx::Dbo::FieldDefBase::createLabelWidget(
int sid,
Wtx::Dbo::Session & session )
const 286 return std::make_unique<Wt::WText>(m_label);
289 std::unique_ptr<Wt::WWidget> Wtx::Dbo::FieldDefBase::createEditWidget(
int sid,
Wtx::Dbo::Session & session )
const 291 auto retVal = std::make_unique<Wt::WLineEdit>();
293 retVal-> setPlaceholderText( placeholderText() );
294 retVal-> setInputMask( inputMask(), m_inputMaskFlags );
299 std::unique_ptr<Wt::WWidget> Wtx::Dbo::FieldDefBase::createDisplayWidget(
int sid,
Wtx::Dbo::Session & session )
const 302 return std::make_unique<Wt::WText>();
305 std::string Wtx::Dbo::FieldDefBase::toJson()
const 311 retVal +=
" \"fieldName\":";
312 retVal +=
" \"" + std::string(m_fieldName) +
"\"";
314 retVal +=
",\n \"width\":";
315 retVal +=
" " + std::to_string(m_width);
317 retVal +=
",\n \"label\":";
318 retVal +=
" \"" + std::string(m_label) +
"\"";
325 void Wtx::Dbo::FieldDefBase::fromJson(
const std::string & value )
FieldDefBase(TableDef &td, const char *fn, int w=-1, int h=-1, Flags f=Flags::None, std::string lb="", std::string ph="", std::string inf="", std::string tt="", int ht=-1)
ctor field definition object
Flags
Field Definition Flags.