/////////////////////////////////////////////////////////////////////////////
-// Name: univ/combobox.cpp
+// Name: src/univ/combobox.cpp
// Purpose: wxComboControl and wxComboBox implementation
// Author: Vadim Zeitlin
// Modified by:
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univcombobox.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
virtual ~wxComboListBox();
// implement wxComboPopup methods
- virtual bool SetSelection(const wxString& value);
- virtual void SetSelection(int n, bool select)
- { wxListBox::SetSelection( n, select); };
+ virtual bool SetSelection(const wxString& s);
virtual wxControl *GetControl() { return this; }
virtual void OnShow();
virtual wxCoord GetBestWidth() const;
+ // fix virtual function hiding
+ virtual void SetSelection(int n) { DoSetSelection(n, true); }
+ void SetSelection(int n, bool select) { DoSetSelection(n, select); }
+
+ // used to process wxUniv actions
+ bool PerformAction(const wxControlAction& action,
+ long numArg,
+ const wxString& strArg);
+
protected:
// we shouldn't return height too big from here
virtual wxSize DoGetBestClientSize() const;
// called whenever the user selects or activates a listbox item
void OnSelect(wxCommandEvent& event);
- // used to process wxUniv actions
- bool PerformAction(const wxControlAction& action,
- long numArg,
- const wxString& strArg);
-
private:
// has the mouse been released on this control?
bool m_clicked;
wxSize sizeBtn = m_btn->GetBestSize();
wxCoord wText = width - sizeBtn.x;
- wxPoint p = GetParent() ? GetParent()->GetClientAreaOrigin() : wxPoint();
+ wxPoint p = GetParent() ? GetParent()->GetClientAreaOrigin() : wxPoint(0,0);
m_text->SetSize(x - p.x, y - p.y, wText, height);
m_btn->SetSize(x - p.x + wText, y - p.y, sizeBtn.x, height);
}
event2.SetId(m_combo->GetId());
m_combo->ProcessEvent(event2);
}
- //else: ignore the events resultign from just moving the mouse initially
+ //else: ignore the events resulting from just moving the mouse initially
}
void wxComboListBox::OnShow()
// while a wxComboListBox is shown, it always has capture, so if it doesn't
// we're about to go away anyhow (normally this shouldn't happen at all,
// but I don't put assert here as it just might do on other platforms and
- // it doesn't break anythign anyhow)
+ // it doesn't break anything anyhow)
if ( this == wxWindow::GetCapture() )
{
if ( HitTest(event.GetPosition()) == wxHT_WINDOW_INSIDE )
GetLBox()->SetString(n, s);
}
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
{
- return GetLBox()->FindString(s);
+ return GetLBox()->FindString(s, bCase);
}
void wxComboBox::SetSelection(int n)