wxPg/binding/binding_macros.h File Reference

Binding macros to easily bind common controls. More...


Defines

#define wxPG_BIND_CONTROLS(binding)   { wxPg::Row_binding *b = binding;
 Start binding controls to binding.
#define wxPG_BIND_LIST_CONTROLS(binding)   { wxPg::List_binding *b = binding;
 Start binding controls with items to binding.
#define wxPG_BINDING_END()   }
 End control binding.
#define wxPG_BIND_CALENDAR_CTRL(calendar, field)   b->bind(new wxPg::wxCalendarCtrl_updater(calendar, field));
 Bind wxCalendarCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_COMBO_BOX(combo, field)   b->bind(new wxPg::wxComboBox_updater(combo, field));
 Bind wxComboBox to wxPg::Data_row_provider.
#define wxPG_BIND_COMBO_CTRL(combo, field)   b->bind(new wxPg::wxComboCtrl_updater(combo, field));
 Bind wxComboCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_RICH_TEXT_CTRL(text, field)   b->bind(new wxPg::wxRichTextCtrl_updater(text, field));
 Bind wxRichTextCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_TEXT_CTRL(text, field)   b->bind(new wxPg::wxTextCtrl_updater(text, field));
 Bind wxTextCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_SPIN_CTRL(spin, field)   b->bind(new wxPg::wxSpinCtrl_updater(spin, field));
 Bind wxSpinCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_STATIC_TEXT(static_text, field)   b->bind(new wxPg::wxStaticText_updater(static_text, field));
 Bind wxStaticText to wxPg::Data_row_provider.
#define wxPG_BIND_HYPERLINK_CTRL(hyperlink, field)   b->bind(new wxPg::wxHyperlinkCtrl_updater(hyperlink, field));
 Bind wxHyperlinkCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_HYPERLINK_CTRL_WLABEL(hyperlink, url_field, label_field)
 Bind wxHyperlinkCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_DATE_PICKER_CTRL(date_ctrl, field)   b->bind(new wxPg::wxDatePickerCtrl_updater(date_ctrl, field));
 Bind wxDatePickerCtrl to wxPg::Data_row_provider.
#define wxPG_BIND_CHECK_BOX(check_box, field)   b->bind(new wxPg::wxCheckBox_updater(check_box, field));
 Bind wxCheckBox to wxPg::Data_row_provider.
#define wxPG_BIND_GAUGE(gauge, field)   b->bind(new wxPg::wxGauge_updater(gauge, field));
 Bind wxGauge to wxPg::Data_row_provider.
#define wxPG_BIND_SPIN_BUTTON(spin, field)   b->bind(new wxPg::wxSpinButton_updater(spin, field));
 Bind wxSpinButton to wxPg::Data_row_provider.
#define wxPG_BIND_LIST_ITEM(control, field)   b->bind(new wxPg::wxItemContainer_updater(control, field));
 Bind wxItemContainer to wxPg::Data_row_provider.
#define wxPG_BIND_RADIO_BOX(control, field)   b->bind(new wxPg::wxRadioBox_updater(control, field));
 Bind wxRadioBox to wxPg::Data_row_provider.
#define wxPG_BIND_VLIST_BOX(control, field)   b->bind(new wxPg::wxVListBox_updater(control, field));
 Bind wxVListBox to wxPg::Data_row_provider.
#define wxPG_BIND_HTML_WINDOW(control, field)   b->bind(new wxPg::wxHtmlWindow_updater(control, field));
 Bind wxHtmlWindow to wxPg::Data_row_provider.
#define wxPG_BIND_LIST(control, field)   b->bind(new wxPg::wxItemContainer_list_updater(control, field));
 Bind wxItemContainer to wxPg::Result_data_provider.


Detailed Description

Binding macros to easily bind common controls.



Example for using binding macros to bin controls to Data_row_provider (query is wxPg::Query, values of current row will be displayed in controls):

    wxPG_BIND_CONTROLS(&query)
        wxPG_BIND_TEXT_CTRL(wxTextCtrl1, wxT("FIRSTNAME"))
        wxPG_BIND_TEXT_CTRL(wxTextCtrl2, wxT("SECONDNAME"))
        wxPG_BIND_DATE_PICKER_CTRL(wxDateCtrl1, wxT("BIRTHDATE"))
        wxPG_BIND_SPIN_CTRL(wxSpinCtrl1, wxT("CATEGORY"))
    wxPG_BINDING_END()
Example for using binding macros to bin list controls (query is wxPg::Query, values of columns will be contained by controls):
    wxPG_BIND_LIST_CONTROLS(&query)
        wxPG_BIND_LIST(wxChoice1, wxT("COUNTRY"));
        wxPG_BIND_LIST(wxListBox1, wxT("REGION"));
        wxPG_BIND_LIST(wxComboBox1, wxT("POST_CODE"));
    wxPG_BINDING_END()
Remember to call update_UI() at the end.

Define Documentation

#define wxPG_BIND_CALENDAR_CTRL ( calendar,
field   )     b->bind(new wxPg::wxCalendarCtrl_updater(calendar, field));

Bind wxCalendarCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_CHECK_BOX ( check_box,
field   )     b->bind(new wxPg::wxCheckBox_updater(check_box, field));

Bind wxCheckBox to wxPg::Data_row_provider.

#define wxPG_BIND_COMBO_BOX ( combo,
field   )     b->bind(new wxPg::wxComboBox_updater(combo, field));

Bind wxComboBox to wxPg::Data_row_provider.

#define wxPG_BIND_COMBO_CTRL ( combo,
field   )     b->bind(new wxPg::wxComboCtrl_updater(combo, field));

Bind wxComboCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_CONTROLS ( binding   )     { wxPg::Row_binding *b = binding;

Start binding controls to binding.

#define wxPG_BIND_DATE_PICKER_CTRL ( date_ctrl,
field   )     b->bind(new wxPg::wxDatePickerCtrl_updater(date_ctrl, field));

Bind wxDatePickerCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_GAUGE ( gauge,
field   )     b->bind(new wxPg::wxGauge_updater(gauge, field));

Bind wxGauge to wxPg::Data_row_provider.

#define wxPG_BIND_HTML_WINDOW ( control,
field   )     b->bind(new wxPg::wxHtmlWindow_updater(control, field));

Bind wxHtmlWindow to wxPg::Data_row_provider.

#define wxPG_BIND_HYPERLINK_CTRL ( hyperlink,
field   )     b->bind(new wxPg::wxHyperlinkCtrl_updater(hyperlink, field));

Bind wxHyperlinkCtrl to wxPg::Data_row_provider.

This updates URL of wxHyperlinkCtrl, label is left unaffected.

#define wxPG_BIND_HYPERLINK_CTRL_WLABEL ( hyperlink,
url_field,
label_field   ) 

Value:

b->bind(new wxPg::wxHyperlinkCtrl_updater_wlabel( \
                    hyperlink, url_field, label_field));
Bind wxHyperlinkCtrl to wxPg::Data_row_provider.

This updates both URL and label of wxHyperlinkCtrl.

#define wxPG_BIND_LIST ( control,
field   )     b->bind(new wxPg::wxItemContainer_list_updater(control, field));

Bind wxItemContainer to wxPg::Result_data_provider.

#define wxPG_BIND_LIST_CONTROLS ( binding   )     { wxPg::List_binding *b = binding;

Start binding controls with items to binding.

#define wxPG_BIND_LIST_ITEM ( control,
field   )     b->bind(new wxPg::wxItemContainer_updater(control, field));

Bind wxItemContainer to wxPg::Data_row_provider.

#define wxPG_BIND_RADIO_BOX ( control,
field   )     b->bind(new wxPg::wxRadioBox_updater(control, field));

Bind wxRadioBox to wxPg::Data_row_provider.

This binding updates wxRadioBox by index, while wxPG_BIND_LIST_ITEM updates it by string value.

#define wxPG_BIND_RICH_TEXT_CTRL ( text,
field   )     b->bind(new wxPg::wxRichTextCtrl_updater(text, field));

Bind wxRichTextCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_SPIN_BUTTON ( spin,
field   )     b->bind(new wxPg::wxSpinButton_updater(spin, field));

Bind wxSpinButton to wxPg::Data_row_provider.

#define wxPG_BIND_SPIN_CTRL ( spin,
field   )     b->bind(new wxPg::wxSpinCtrl_updater(spin, field));

Bind wxSpinCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_STATIC_TEXT ( static_text,
field   )     b->bind(new wxPg::wxStaticText_updater(static_text, field));

Bind wxStaticText to wxPg::Data_row_provider.

#define wxPG_BIND_TEXT_CTRL ( text,
field   )     b->bind(new wxPg::wxTextCtrl_updater(text, field));

Bind wxTextCtrl to wxPg::Data_row_provider.

#define wxPG_BIND_VLIST_BOX ( control,
field   )     b->bind(new wxPg::wxVListBox_updater(control, field));

Bind wxVListBox to wxPg::Data_row_provider.

 
#define wxPG_BINDING_END (  )     }

End control binding.


Generated on Wed Oct 7 23:14:39 2009 for wxPostgres by  doxygen 1.5.8