wxPg::Row_binding Class Reference

Binding widgets to display values from wxPg::Data_row. More...

Inheritance diagram for wxPg::Row_binding:

wxPg::Binding wxPg::UI_updater

List of all members.

Public Types

typedef void(* upd_ctrl_f )(wxWindow *, const wxString &, Data_row_provider *)
 Function, responsible for setting value of widget.

Public Member Functions

 Row_binding ()
 Creates new object.
 Row_binding (Data_row_provider *data)
 Creates new object.
virtual ~Row_binding ()
 Destroys the object.
Data_row_providerdata ()
 Returns currently used data row.
void data (Data_row_provider *data)
 Sets currently used data row.
void bind (wxWindow *w, wxString field, upd_ctrl_f f)
 Binds widget.
virtual void unbind (wxWindow *w)
 Unbind widget.
virtual void update_UI ()
 Update UI.

Protected Types

typedef std::pair< wxString,
upd_ctrl_f
ctrl_binding

Protected Attributes

Data_row_providerdata_
std::map< wxWindow
*, ctrl_binding > 
ctrl_bindings_


Detailed Description

Binding widgets to display values from wxPg::Data_row.


Member Typedef Documentation

typedef void(* wxPg::Row_binding::upd_ctrl_f)(wxWindow *, const wxString &, Data_row_provider *)

Function, responsible for setting value of widget.


Constructor & Destructor Documentation

wxPg::Row_binding::Row_binding (  ) 

Creates new object.

Call data() to complete initialization of object.

wxPg::Row_binding::Row_binding ( Data_row_provider data  )  [explicit]

Creates new object.

Parameters:
data - a row of query result to be used.

virtual wxPg::Row_binding::~Row_binding (  )  [inline, virtual]

Destroys the object.


Member Function Documentation

Data_row_provider* wxPg::Row_binding::data (  ) 

Returns currently used data row.

Returns:
currently used data row.

void wxPg::Row_binding::data ( Data_row_provider data  ) 

Sets currently used data row.

Parameters:
data - new data row to be used.

void wxPg::Row_binding::bind ( wxWindow *  w,
wxString  field,
upd_ctrl_f  f 
)

Binds widget.

When update_UI() is called, the value of widget is set to the value of field. Usually you don't need to call this method directly - use binding macros, defined in binding_macros.h.

Parameters:
w - widget to be binded.
field - database field.
f - function, responsible for setting control value.

virtual void wxPg::Row_binding::unbind ( wxWindow *  w  )  [virtual]

Unbind widget.

Parameters:
w is no longer updated.

Implements wxPg::Binding.

virtual void wxPg::Row_binding::update_UI (  )  [virtual]

Update UI.

Sets values of binded widgets to specified field values.

Implements wxPg::UI_updater.


Generated on Thu May 7 22:51:17 2009 for wxPostgres by  doxygen 1.5.6