34 typedef std::map<TWindow*, TFieldInfo, std::less<TWindow*> >
TFieldDetails;
42 TOffsetEq(
size_t ofs) : Offset(
ofs) {}
44 bool operator()(
const TFieldDetails::value_type&
v)
45 {
return v.second.Offset == Offset;}
54 TIdEq(
int id) : Id(id) {}
56 bool operator()(
const TFieldDetails::value_type&
v)
57 {
return v.first->GetId() == Id;}
63 struct TTransferIterInfo
83 if (TValidator*
v = edit->GetValidator())
84 if (
v->HasOption(
voTransfer))
throw TTransferBufferWindowBase::TXMeddlingValidator(*edit);
87 TFieldDetails::const_iterator
i = t.Details->find(&
child);
88 if (
i == t.Details->end())
throw TTransferBufferWindowBase::TXUnboundControl(
child);
89 const TFieldInfo& f = (*i).second;
94 void*
field =
static_cast<char*
>(t.Buffer) + f.Offset;
106 TWindow* p =
c.GetParentO();
109 <<
_T(
" is trying to bind to more than one field.\n\n")
110 <<
_T(
"Ensure that every control is bound to a separate field in the transfer buffer, ")
121 TWindow* p =
c.GetParentO();
124 <<
_T(
" is trying to bind to an already bound field.\n\n")
125 <<
_T(
"Ensure that every control is bound to a separate field in the transfer buffer, ")
136 TWindow* p =
c.GetParentO();
137 s <<
_T(
"Transfer requested by unbound control #")
140 <<
_T(
"Use TTransferBufferWindow::Bind to bind the control to a field in the window's transfer buffer, ")
151 TWindow* p =
c.GetParentO();
153 <<
_T(
" is meddling with the transfer of control #")
156 <<
_T(
"Validators are not allowed to take part in transfers in a TTransferBufferWindow. ")
168class TTransferBufferWindowBase::TImpl
202 if (std::find_if(f.begin(), f.end(), TOffsetEq(
offset)) != f.end())
204 if (std::find_if(f.begin(), f.end(), TIdEq(
c.GetId())) != f.end())
208 typedef std::pair<TFieldDetails::iterator, bool>
TInsertResult;
#define PRECONDITION(condition)
A TEdit is an interface object that represents an edit control interface element.
Thrown if a more than one control tries to associate with the same field.
TXFieldConflict(TWindow &c)
TXMeddlingValidator(TEdit &c)
Thrown if a a control tries to associate with more than one field.
TXPolygamousControl(TWindow &c)
TXUnboundControl(TWindow &c)
void AssignField(TWindow &, size_t offset, size_t size)
Stores the field details and enables transfer for the given control.
TTransferBufferWindowBase()
Initializes the private implementation.
virtual ~TTransferBufferWindowBase()
Required for proper clean-up.
virtual uint Transfer(void *buffer, TTransferDirection direction)
TWindow override Dispatches to all the children.
virtual void TransferData(TTransferDirection direction)
TWindow override Initiates the transfer of the children data to or from the transfer buffer.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
auto GetChildren()
Returns a TWindow::TChildrenRange that can be iterated by standard means.
void * GetTransferBuffer() const
uint GetTransferBufferSize() const
TXOwl is root class of the ObjectWindows exception hierarchy.
static void Raise(TWindow *win=nullptr, uint resourceId=IDS_INVALIDWINDOW)
Creates the TXWindow exception and throws it.
@ voTransfer
Option to perform conversion & transfer.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
@ wfTransfer
Participates in the Transfer mechanism.
@ tdSizeData
Return the size of data transferred by the class.
Object Windows Library (OWLNext Core)
tstring GetFullTypeName(T *w)
Helper; returns the type of a window as an tstring.
std::ostringstream tostringstream
#define TYPESAFE_DOWNCAST(object, toClass)