// control ids
enum
{
- ComboPage_Reset = 100,
+ ComboPage_Reset = wxID_HIGHEST,
ComboPage_CurText,
ComboPage_InsertionPointText,
ComboPage_Insert,
class ComboboxWidgetsPage : public WidgetsPage
{
public:
- ComboboxWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
+ ComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const { return m_combobox; }
virtual void RecreateWidget() { CreateCombo(); }
+ // lazy creation of the content
+ virtual void CreateContent();
+
protected:
// event handlers
void OnButtonReset(wxCommandEvent& event);
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"));
+#if defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"),
+ FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
+ );
-ComboboxWidgetsPage::ComboboxWidgetsPage(wxBookCtrlBase *book,
+ComboboxWidgetsPage::ComboboxWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
- : WidgetsPage(book)
+ : WidgetsPage(book, imaglist, combobox_xpm)
{
// init everything
m_chkSort =
m_combobox = (wxComboBox *)NULL;
m_sizerCombo = (wxSizer *)NULL;
+}
- imaglist->Add(wxBitmap(combobox_xpm));
-
+void ComboboxWidgetsPage::CreateContent()
+{
/*
What we create here is a frame having 3 panes: style pane is the
leftmost one, in the middle the pane with buttons allowing to perform
void ComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event))
{
int sel = m_combobox->GetSelection();
- if ( sel != -1 )
+ if ( sel != wxNOT_FOUND )
{
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
void ComboboxWidgetsPage::OnUpdateUIDeleteSelButton(wxUpdateUIEvent& event)
{
if (m_combobox)
- event.Enable(m_combobox->GetSelection() != -1);
+ event.Enable(m_combobox->GetSelection() != wxNOT_FOUND);
}
void ComboboxWidgetsPage::OnUpdateUIClearButton(wxUpdateUIEvent& event)