#include <odcombo.h>
Inheritance diagram for wxOwnerDrawnComboBox:
Public Member Functions | |
wxOwnerDrawnComboBox () | |
wxOwnerDrawnComboBox (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, int n, const wxString choices[], long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr) | |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr) |
wxOwnerDrawnComboBox (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr) | |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, int n, const wxString choices[], long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr) |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxComboBoxNameStr) |
virtual | ~wxOwnerDrawnComboBox () |
void | SetPopupControl (wxVListBoxComboPopup *popup) |
virtual void | Clear () |
virtual void | Delete (int n) |
virtual int | GetCount () const |
virtual wxString | GetString (int n) const |
virtual void | SetString (int n, const wxString &s) |
virtual int | FindString (const wxString &s, bool bCase) const |
virtual int | FindString (const wxString &s) const |
virtual void | Select (int n) |
virtual int | GetSelection () const |
virtual void | SetSelection (int n) |
virtual void | SetSelection (long from, long to) |
virtual int | GetWidestItemWidth () |
virtual int | GetWidestItem () |
Protected Member Functions | |
virtual void | OnDrawItem (wxDC &dc, const wxRect &rect, int item, int flags) const |
virtual wxCoord | OnMeasureItem (size_t item) const |
virtual wxCoord | OnMeasureItemWidth (size_t item) const |
virtual void | OnDrawBackground (wxDC &dc, const wxRect &rect, int item, int flags) const |
virtual void | DoSetPopupControl (wxComboPopup *popup) |
void | ClearClientDatas () |
wxVListBoxComboPopup * | GetVListBoxComboPopup () const |
virtual int | DoAppend (const wxString &item) |
virtual int | DoInsert (const wxString &item, int pos) |
virtual void | DoSetItemClientData (int n, void *clientData) |
virtual void * | DoGetItemClientData (int n) const |
virtual void | DoSetItemClientObject (int n, wxClientData *clientData) |
virtual wxClientData * | DoGetItemClientObject (int n) const |
Protected Attributes | |
wxArrayString | m_initChs |
Private Member Functions | |
void | Init () |
Friends | |
class | wxVListBoxComboPopup |
Definition at line 231 of file odcombo.h.
|
Definition at line 239 of file odcombo.h. 00239 : wxComboCtrl() { Init(); }
|
|
Definition at line 241 of file odcombo.h. 00251 : wxComboCtrl() 00252 { 00253 Init(); 00254 00255 (void)Create(parent, id, value, pos, size, n, 00256 choices, style, validator, name); 00257 }
|
|
Definition at line 786 of file odcombo.cpp. 00795 : wxComboCtrl() 00796 { 00797 Init(); 00798 00799 Create(parent,id,value,pos,size,choices,style, validator, name); 00800 }
|
|
Definition at line 846 of file odcombo.cpp. 00847 { 00848 if ( m_popupInterface ) 00849 GetVListBoxComboPopup()->ClearClientDatas(); 00850 }
|
|
Definition at line 875 of file odcombo.cpp. 00876 { 00877 EnsurePopupControl(); 00878 00879 GetVListBoxComboPopup()->Clear(); 00880 00881 SetValue(wxEmptyString); 00882 }
|
|
|
|
Definition at line 802 of file odcombo.cpp. 00811 { 00812 m_initChs = choices; 00813 //wxCArrayString chs(choices); 00814 00815 //return Create(parent, id, value, pos, size, chs.GetCount(), 00816 // chs.GetStrings(), style, validator, name); 00817 return Create(parent, id, value, pos, size, 0, 00818 NULL, style, validator, name); 00819 }
|
|
Definition at line 821 of file odcombo.cpp. 00831 { 00832 00833 if ( !Create(parent, id, value, pos, size, style, 00834 validator, name) ) 00835 { 00836 return false; 00837 } 00838 00839 int i; 00840 for ( i=0; i<n; i++ ) 00841 m_initChs.Add(choices[i]); 00842 00843 return true; 00844 }
|
|
Reimplemented from wxGenericComboControl. Definition at line 774 of file odcombo.cpp. 00782 { 00783 return wxComboCtrl::Create(parent,id,value,pos,size,style,validator,name); 00784 }
|
|
Definition at line 884 of file odcombo.cpp. 00885 { 00886 wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") ); 00887 00888 if ( GetSelection() == (int) n ) 00889 SetValue(wxEmptyString); 00890 00891 GetVListBoxComboPopup()->Delete(n); 00892 }
|
|
Definition at line 958 of file odcombo.cpp. 00959 { 00960 EnsurePopupControl(); 00961 wxASSERT(m_popupInterface); 00962 00963 return GetVListBoxComboPopup()->Append(item); 00964 }
|
|
Definition at line 987 of file odcombo.cpp. 00988 { 00989 if ( !m_popupInterface ) 00990 return NULL; 00991 00992 return GetVListBoxComboPopup()->GetItemClientData(n); 00993 }
|
|
Definition at line 1000 of file odcombo.cpp. 01001 { 01002 return (wxClientData*) DoGetItemClientData(n); 01003 }
|
|
Definition at line 966 of file odcombo.cpp. 00967 { 00968 EnsurePopupControl(); 00969 00970 wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); 00971 #if 0 00972 wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index")); 00973 #endif 00974 00975 GetVListBoxComboPopup()->Insert(item,pos); 00976 00977 return pos; 00978 }
|
|
Definition at line 980 of file odcombo.cpp. 00981 { 00982 EnsurePopupControl(); 00983 00984 GetVListBoxComboPopup()->SetItemClientData(n,clientData,m_clientDataItemsType); 00985 }
|
|
Definition at line 995 of file odcombo.cpp. 00996 { 00997 DoSetItemClientData(n, (void*) clientData); 00998 }
|
|
Reimplemented from wxComboCtrlBase. Definition at line 852 of file odcombo.cpp. 00853 { 00854 if ( !popup ) 00855 { 00856 popup = new wxVListBoxComboPopup(); 00857 } 00858 00859 wxComboCtrl::DoSetPopupControl(popup); 00860 00861 wxASSERT(popup); 00862 00863 // Add initial choices to the wxVListBox 00864 if ( !GetVListBoxComboPopup()->GetCount() ) 00865 { 00866 GetVListBoxComboPopup()->Populate(m_initChs); 00867 m_initChs.Clear(); 00868 } 00869 }
|
|
Definition at line 314 of file odcombo.h. 00314 {return FindString (s, false);}
|
|
Definition at line 921 of file odcombo.cpp. 00922 { 00923 if ( !m_popupInterface ) 00924 return m_initChs.Index(s, bCase); 00925 00926 return GetVListBoxComboPopup()->FindString(s, bCase); 00927 }
|
|
Definition at line 894 of file odcombo.cpp. 00895 { 00896 if ( !m_popupInterface ) 00897 return m_initChs.GetCount(); 00898 00899 return GetVListBoxComboPopup()->GetCount(); 00900 }
|
|
Definition at line 950 of file odcombo.cpp. 00951 { 00952 if ( !m_popupInterface ) 00953 return m_initChs.Index(m_valueString); 00954 00955 return GetVListBoxComboPopup()->GetSelection(); 00956 }
|
|
Definition at line 902 of file odcombo.cpp. 00903 { 00904 wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") ); 00905 00906 if ( !m_popupInterface ) 00907 return m_initChs.Item(n); 00908 00909 return GetVListBoxComboPopup()->GetString(n); 00910 }
|
|
Definition at line 359 of file odcombo.h. 00360 { 00361 return (wxVListBoxComboPopup*) m_popupInterface; 00362 }
|
|
Definition at line 330 of file odcombo.h. 00330 { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItem(); }
|
|
Definition at line 327 of file odcombo.h. 00327 { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItemWidth(); }
|
|
Reimplemented from wxGenericComboControl. Definition at line 770 of file odcombo.cpp.
|
|
Definition at line 1036 of file odcombo.cpp. 01037 { 01038 // we need to render selected and current items differently 01039 if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) || 01040 (flags & wxODCB_PAINTING_CONTROL) ) 01041 { 01042 DrawFocusBackground(dc, 01043 rect, 01044 (flags&wxODCB_PAINTING_CONTROL?0:wxCONTROL_ISSUBMENU) | 01045 wxCONTROL_SELECTED); 01046 } 01047 //else: do nothing for the normal items 01048 }
|
|
Definition at line 1009 of file odcombo.cpp. 01013 { 01014 if ( flags & wxODCB_PAINTING_CONTROL ) 01015 { 01016 dc.DrawText( GetValue(), 01017 rect.x + GetTextIndent(), 01018 (rect.height-dc.GetCharHeight())/2 + rect.y ); 01019 } 01020 else 01021 { 01022 dc.DrawText( GetVListBoxComboPopup()->GetString(item), rect.x + 2, rect.y ); 01023 } 01024 }
|
|
|
|
|
|
Definition at line 929 of file odcombo.cpp. 00930 { 00931 EnsurePopupControl(); 00932 00933 wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Select") ); 00934 00935 GetVListBoxComboPopup()->SetSelection(n); 00936 00937 wxString str; 00938 if ( n >= 0 ) 00939 str = GetVListBoxComboPopup()->GetString(n); 00940 00941 // Refresh text portion in control 00942 if ( m_text ) 00943 m_text->SetValue( str ); 00944 else 00945 m_valueString = str; 00946 00947 Refresh(); 00948 }
|
|
Definition at line 302 of file odcombo.h. 00303 { 00304 DoSetPopupControl(popup); 00305 }
|
|
Reimplemented from wxComboCtrlBase. Definition at line 321 of file odcombo.h. 00322 { 00323 wxComboCtrl::SetSelection(from,to); 00324 }
|
|
Definition at line 317 of file odcombo.h. 00317 { Select(n); }
|
|
Definition at line 912 of file odcombo.cpp. 00913 { 00914 EnsurePopupControl(); 00915 00916 wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::SetString") ); 00917 00918 GetVListBoxComboPopup()->SetString(n,s); 00919 }
|
|
|
|
|