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. |
wxPg::Grid_bind_def::Grid_bind_def | ( | ) | [inline] |
Constructor.
wxPg::Grid_bind_def::Grid_bind_def | ( | const std::map< int, wxString > & | col_bindings | ) | [explicit] |
wxPg::Grid_bind_def::Grid_bind_def | ( | const std::map< int, wxString > & | col_bindings, | |
const std::map< wxString, wxString > & | labels | |||
) |
Constructor.
col_bindings | - column bindings to be set. | |
labels | - column labels (see col_labels()). |
virtual wxPg::Grid_bind_def::~Grid_bind_def | ( | ) | [inline, virtual] |
Destructor.
void wxPg::Grid_bind_def::bind | ( | const std::map< int, wxString > & | col_bindings | ) | [inline] |
Bind grid columns to database fields.
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.
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.
void wxPg::Grid_bind_def::clear | ( | ) | [inline] |
Clear all bindings.
unsigned wxPg::Grid_bind_def::col_count | ( | ) | const |
Get 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.
col_idx | - column index. |
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.
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.
void wxPg::Grid_bind_def::col_labels | ( | const std::map< wxString, wxString > & | labels | ) | [inline] |
Set labels for grid columns.
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.
field | - field name. |
void wxPg::Grid_bind_def::rem_col_label | ( | const wxString & | field | ) | [inline] |
Remove assigned label from column, displaying values of database field.
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.
col_idx | - grid column index. |