Wtx ~ Wt Extension Library
WtxLib
Public Types | Public Member Functions | List of all members
Wtx::Dbo::FieldDefBase Class Reference

Base Class. More...

#include <FieldDefBase.h>

+ Inheritance diagram for Wtx::Dbo::FieldDefBase:

Public Types

enum  Flags {
  None = 0x0000, Required = 0x0001, ReadOnly = 0x0002, Password = 0x0004,
  ShowOnly = 0x0008, NoUi = 0x0010, Unique = 0x0020, Search = 0x0040
}
 Field Definition Flags. More...
 

Public Member Functions

 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 More...
 
 FieldDefBase (TableDef &td, const char *fn, std::string lb="", std::string ph="", std::string inf="", std::string tt="", int ht=-1)
 ctor field definition object More...
 
virtual Wtx::Dbo::TableDeftableDef () const
 
virtual const char * fieldName () const
 
virtual const std::string & aliasName () const
 
virtual int width () const
 
virtual void setWidth (int value)
 
virtual int height () const
 
virtual void setHeight (int value)
 
virtual bool isVisible () const
 
virtual void setIsVisible (bool value=true)
 
virtual bool isReadOnly () const
 
virtual void setIsReadOnly (bool value=true)
 
virtual bool isUnique () const
 
virtual void setIsUnique (bool value=true)
 
virtual const std::string & label () const
 
virtual void setLabel (const std::string &value)
 
virtual const std::string & placeholderText () const
 
virtual void setPlaceholderText (const std::string &value)
 
virtual const std::string & info () const
 
virtual void setInfo (const std::string &value)
 
virtual const std::string & toolTip () const
 
virtual void setToolTip (const std::string &value)
 
virtual int helpTopic () const
 
virtual void setHelpTopic (int value)
 
virtual const Flagsflags () const
 
virtual void setFlags (const Flags value)
 
virtual const std::string & defaultValue () const
 
virtual void setDefaultValue (const std::string &value)
 
virtual bool forceUppercase () const
 
virtual void setForceUppercase (bool value=true)
 
virtual const std::string & inputMask () const
 
virtual void setInputMask (const std::string &mask="", Wt::WFlags< Wt::InputMaskFlag > flags=Wt::None)
 
virtual std::unique_ptr< Wt::WItemDelegate > createItemDelegate (int sid, Wtx::Dbo::Session &session) const
 
virtual std::unique_ptr< Wt::WWidget > createLabelWidget (int sid, Wtx::Dbo::Session &session) const
 
virtual std::unique_ptr< Wt::WWidget > createEditWidget (int sid, Wtx::Dbo::Session &session) const
 
virtual std::unique_ptr< Wt::WWidget > createDisplayWidget (int sid, Wtx::Dbo::Session &session) const
 
virtual std::string toJson () const
 
virtual void fromJson (const std::string &valud)
 

Detailed Description

Base Class.

This is a back-end database field definition, and a front-end UI field-editor definition.

A field definition object provides definition services such as placeholder text, tool-tips, help-context and various other things useful for a GUI type application. It also defines the 'column name' or 'field name' for the back-end database, as well as any associated indexes or restraints. The FieldDef object can be thought of as a 'glue' object for the back-to-fronti database design, or part of the 'C' in the 'MVC' programming paradigm.The field definition object requires, at the very least, a reference back to the owning table definition object, and a 'char' pointer to the field-name value. Both of these parameters are required, and cannot be modified after construction, since they represent a constant (non-changing) reference to the table and to the column name within that table. During construction the field definition object will automatically insert itself in to the table definition 'field list' set.

Definition at line 88 of file FieldDefBase.h.

Member Enumeration Documentation

Field Definition Flags.

These flags can be 'or' together

Todo:
this should have some other c++ type of construct
Enumerator
None 

0x0000 ~ no flags

Required 

0x0001 ~ the field is required

ReadOnly 

0x0002 ~ the field is read-only

Password 

0x0004 ~ the field displays with password masking

ShowOnly 

0x0008 ~ the field is display-only

NoUi 

0x0010 ~ the field will not call upon createWidget

Unique 

0x0020 ~ the field carries a unique constraint

Search 

0x0040 ~ searchable from table views

Definition at line 101 of file FieldDefBase.h.

Constructor & Destructor Documentation

Wtx::Dbo::FieldDefBase::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

Parameters
fnowning table definition (ro required)
wfield name (ro required)
hwidth
fheight
lbflags
phlabel
infplaceholder text
ttinfo
httooltipText help topic

Definition at line 60 of file FieldDefBase.cpp.

Wtx::Dbo::FieldDefBase::FieldDefBase ( TableDef td,
const char *  fn,
std::string  lb = "",
std::string  ph = "",
std::string  inf = "",
std::string  tt = "",
int  ht = -1 
)

ctor field definition object

Parameters
fnowning table definition (ro required)
lbfield name (ro required)
phlabel
infplaceholder text
ttinfo
httooltipText help topic

Definition at line 88 of file FieldDefBase.cpp.


The documentation for this class was generated from the following files: