wxPg::Grid_bind_def Class Reference

Grid binding definitions. More...

List of all members.

Public Member Functions

 Grid_bind_def ()
 Constructor.
 Grid_bind_def (const std::map< int, wxString > &col_bindings)
 Constructor.
 Grid_bind_def (const std::map< int, wxString > &col_bindings, const std::map< wxString, wxString > &labels)
 Constructor.
virtual ~Grid_bind_def ()
 Destructor.
void bind (int col_idx, const wxString &field)
 Bind grid column to database field.
void bind (const wxString &field)
 Bind next grid column to database field.
void bind (const std::map< int, wxString > &col_bindings)
 Bind grid columns to database fields.
const std::map< int, wxString > & bindings () const
 Return current bindings for grid.
void unbind (int col_idx)
 Remove column from current bindings.
void unbind ()
 Remove all binded columns from list.
int field_binding (const wxString &field) const
 Get index of column, to which the field is binded.
void col_label (const wxString &field, const wxString &label)
 Set label for grid column, binded to database field.
void rem_col_label (const wxString &field)
 Remove assigned label from column, displaying values of database field.
void col_labels (const std::map< wxString, wxString > &labels)
 Set labels for grid columns.
const std::map< wxString,
wxString > & 
col_labels ()
 Returns currently specified labels for fields.
void col_labels_clear ()
 Clears all specified labels for grid columns.
void clear ()
 Clear all bindings.
unsigned col_count () const
 Get number of columns.
const wxString col_label (unsigned col_idx) const
 Get column label by column index.


Detailed Description

Grid binding definitions.


Constructor & Destructor Documentation

wxPg::Grid_bind_def::Grid_bind_def (  )  [inline]

Constructor.

wxPg::Grid_bind_def::Grid_bind_def ( const std::map< int, wxString > &  col_bindings  )  [explicit]

Constructor.

Parameters:
col_bindings - column bindings to be set (see bind()).

wxPg::Grid_bind_def::Grid_bind_def ( const std::map< int, wxString > &  col_bindings,
const std::map< wxString, wxString > &  labels 
)

Constructor.

Parameters:
col_bindings - column bindings to be set.
labels - column labels (see col_labels()).

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

Destructor.


Member Function Documentation

void wxPg::Grid_bind_def::bind ( const std::map< int, wxString > &  col_bindings  )  [inline]

Bind grid columns to database fields.

Parameters:
col_bindings - keys are column indices, values are database fields binded to them.

void wxPg::Grid_bind_def::bind ( const wxString &  field  ) 

Bind next grid column to database field.

The newly binded column has index, that is bigger by 1 than currenly binded column with highest index. It's not recomended to mix this method with other binding methods.

void wxPg::Grid_bind_def::bind ( int  col_idx,
const wxString &  field 
) [inline]

Bind grid column to database field.

Parameters:
col_idx - grid columns index.
field - database field. Grid column will contain values from this field.

const std::map<int, wxString>& wxPg::Grid_bind_def::bindings (  )  const [inline]

Return current bindings for grid.

Keys in map are column indices, values are database fields binded to them.

Returns:
current bindings.

void wxPg::Grid_bind_def::clear (  )  [inline]

Clear all bindings.

unsigned wxPg::Grid_bind_def::col_count (  )  const

Get number of columns.

Returns:
number of columns.

const wxString wxPg::Grid_bind_def::col_label ( unsigned  col_idx  )  const

Get column label by column index.

If label is set for column, that label is returned. If label is not set, than field name is returned. If neigther label, nor field is set, empty string is returned.

Parameters:
col_idx - column index.
Returns:
defined label for column.

void wxPg::Grid_bind_def::col_label ( const wxString &  field,
const wxString &  label 
) [inline]

Set label for grid column, binded to database field.

For columns, that don't have specified labels, field name is used instead. If no field is binded to column, label of that column is not changed.

Parameters:
field - database field. Grid column, that is binded to this field will have specified label.
label - label for column.

const std::map<wxString, wxString>& wxPg::Grid_bind_def::col_labels (  )  [inline]

Returns currently specified labels for fields.

Keys in map are fied names, values are labels.

Returns:
current column labels.

void wxPg::Grid_bind_def::col_labels ( const std::map< wxString, wxString > &  labels  )  [inline]

Set labels for grid columns.

Parameters:
labels - keys are fied names, values are labels for grid columns.

void wxPg::Grid_bind_def::col_labels_clear (  )  [inline]

Clears all specified labels for grid columns.

int wxPg::Grid_bind_def::field_binding ( const wxString &  field  )  const

Get index of column, to which the field is binded.

If field is not binded, -1 is returned.

Parameters:
field - field name.
Returns:
column index.

void wxPg::Grid_bind_def::rem_col_label ( const wxString &  field  )  [inline]

Remove assigned label from column, displaying values of database field.

Parameters:
field - database field.

void wxPg::Grid_bind_def::unbind (  )  [inline]

Remove all binded columns from list.

void wxPg::Grid_bind_def::unbind ( int  col_idx  )  [inline]

Remove column from current bindings.

Parameters:
col_idx - grid column index.


Generated on Sat Sep 5 23:00:40 2009 for wxPostgres by  doxygen 1.5.8