#include <gridcombo.h>
Inheritance diagram for wxGridCombo:
Public Member Functions | |
wxGridCombo () | |
wxGridCombo (wxWindow *pwndParent, wxWindowID wiID=wxID_ANY, const wxPoint &crptPos=wxDefaultPosition, const wxSize &crszSize=wxDefaultSize, long lStyle=0, const wxString &crstrName=wxT("wxSliderComboBox")) | |
bool | Create (wxWindow *pwndParent, wxWindowID wiID=wxID_ANY, const wxPoint &crptPos=wxDefaultPosition, const wxSize &crszSize=wxDefaultSize, long lStyle=0, const wxString &crstrName=wxT("wxSliderComboBox")) |
virtual | ~wxGridCombo () |
virtual void | AddItem (CGridComboUserData *pUserData) |
virtual CGridComboUserData * | GetUserData (int iIndex) |
virtual void | Clear () |
virtual void | DeleteUserData () |
void | SetColumns (int iCols) |
int | GetColumns () const |
int | GetRows () |
void | SetSelected (int iSelected) |
int | GetSelected () const |
int | GetItemsNum () const |
void | SetItemSize (wxSize szItem) |
wxSize | GetItemSize () const |
Protected Member Functions | |
void | Init () |
Protected Attributes | |
std::vector< CGridComboUserData * > | m_vecUserData |
Private Attributes | |
int | m_iColumns |
int | m_iSelected |
wxSize | m_szItem |
Definition at line 155 of file gridcombo.h.
|
Definition at line 160 of file gridcombo.h. 00160 {Init();}
|
|
Definition at line 693 of file gridcombo.cpp.
|
|
Function : wxGridCombo::~wxGridCombo Author : Mikhail Tatarnikov Purpose : Destroys the object Returns : void Exceptions: Parameters: None Notes : Definition at line 735 of file gridcombo.cpp. 00736 { 00737 DeleteUserData(); 00738 }
|
|
Function : wxGridCombo::AddItem Author : Mikhail Tatarnikov Purpose : Adds a new item (appended to the end) Returns : void Exceptions: Parameters: [in] CGridComboUserData* pUserData - a new item to add. Notes : Definition at line 767 of file gridcombo.cpp. 00768 { 00769 m_vecUserData.push_back(pUserData); 00770 00771 wxGridComboPopup* pPopup = (wxGridComboPopup*)GetPopupControl(); 00772 if (pPopup) 00773 pPopup->UpdateScrollers(); 00774 }
|
|
Function : wxGridCombo::Clear Author : Mikhail Tatarnikov Purpose : Removes all elements from the combobox Returns : void Exceptions: Parameters: None Notes : Definition at line 785 of file gridcombo.cpp. 00786 { 00787 DeleteUserData(); 00788 00789 wxGridComboPopup* pPopup = (wxGridComboPopup*)GetPopupControl(); 00790 00791 if (pPopup) 00792 pPopup->UpdateScrollers(); 00793 }
|
|
Function : wxGridCombo::Create Author : Mikhail Tatarnikov Purpose : Creates the control Returns : bool - see wxWindow::Create Exceptions: Parameters: see wxWindow::Create. Notes : Definition at line 713 of file gridcombo.cpp. 00719 { 00720 if (!wxComboCtrl::Create(pwndParent, wiID, wxEmptyString, crptPos, crszSize, lStyle, wxDefaultValidator, crstrName)) 00721 return false; 00722 00723 return true; 00724 }
|
|
Function : wxGridCombo::DeleteUserData Author : Mikhail Tatarnikov Purpose : Deletes all user data for itmes. Returns : void Exceptions: Parameters: None Notes : Definition at line 749 of file gridcombo.cpp. 00750 { 00751 std::vector<CGridComboUserData*>::const_iterator citCur = m_vecUserData.begin(); 00752 for (; citCur != m_vecUserData.end(); ++citCur) 00753 delete *citCur; 00754 00755 m_vecUserData.clear(); 00756 }
|
|
Definition at line 187 of file gridcombo.h. 00187 {return m_iColumns;}
|
|
Definition at line 196 of file gridcombo.h. 00196 {return m_szItem;}
|
|
Definition at line 193 of file gridcombo.h. 00193 {return m_vecUserData.size();}
|
|
Function : wxGridCombo::GetRows Author : Mikhail Tatarnikov Purpose : Calculates the number of rows. Returns : int - the number of rows. Exceptions: Parameters: None Notes : Definition at line 822 of file gridcombo.cpp. 00823 { 00824 // Calculate the full rows based on the item number and the columns requested. 00825 // Then add a partial row if required. 00826 int iRows = GetItemsNum() / GetColumns(); 00827 if (GetItemsNum() % GetColumns() != 0) 00828 iRows++; 00829 00830 return iRows; 00831 }
|
|
Function : wxGridCombo::GetSelected Author : Mikhail Tatarnikov Purpose : Gets the selected item Returns : int - the index of the selected item, -1 otherwise. Exceptions: Parameters: None Notes : Definition at line 915 of file gridcombo.cpp. 00916 { 00917 return m_iSelected; 00918 }
|
|
Function : wxGridCombo::GetUserData Author : Mikhail Tatarnikov Purpose : Retrieves user data associated with an item. Returns : CGridComboUserData* - the user data for the item, if any. Exceptions: Parameters: [in] int iIndex - index of the item to retrieve associated user data for. Notes : Definition at line 805 of file gridcombo.cpp. 00806 { 00807 if (iIndex < GetItemsNum()) 00808 return m_vecUserData[iIndex]; 00809 00810 return NULL; 00811 }
|
|
Function : wxGridCombo::Init Author : Mikhail Tatarnikov Purpose : Initialization routine Returns : void Exceptions: Parameters: None Notes : Reimplemented from wxGenericComboControl. Definition at line 687 of file gridcombo.cpp. 00688 { 00689 m_iColumns = 1; // A standard list box with one column by default. 00690 m_iSelected = -1; 00691 }
|
|
Function : wxGridCombo::SetColumns Author : Mikhail Tatarnikov Purpose : Sets the number of columns Returns : void Exceptions: Parameters: [in] int iCols - new column number. Notes : Definition at line 865 of file gridcombo.cpp. 00866 { 00867 m_iColumns = iCols; 00868 00869 wxGridComboPopup* pPopup = (wxGridComboPopup*)GetPopupControl(); 00870 00871 if (!pPopup) 00872 return; 00873 00874 pPopup->UpdateColumnsNum(); 00875 }
|
|
Function : wxGridCombo::SetItemSize Author : Mikhail Tatarnikov Purpose : Sets the item size Returns : void Exceptions: Parameters: [in] wxSize szItem - a new size for items. Notes : All items have the same size. Definition at line 843 of file gridcombo.cpp. 00844 { 00845 m_szItem = szItem; 00846 00847 wxGridComboPopup* pPopup = (wxGridComboPopup*)GetPopupControl(); 00848 00849 if (!pPopup) 00850 return; 00851 00852 pPopup->UpdateScrollers(); 00853 }
|
|
Function : wxGridCombo::SetSelected Author : Mikhail Tatarnikov Purpose : Selects an item. Returns : void Exceptions: Parameters: [in] int iItem - an item to select, -1 for unselecting. Notes : Definition at line 887 of file gridcombo.cpp. 00888 { 00889 // Check if we actually changed anything. 00890 if (GetSelected() == iItem) 00891 return; 00892 00893 wxGridComboPopup* pPopup = (wxGridComboPopup*)GetPopupControl(); 00894 00895 if (!pPopup) 00896 return; 00897 00898 pPopup->ChangeSelection(GetSelected(), iItem); 00899 00900 m_iSelected = iItem; 00901 00902 // Invalidate the combo control. 00903 Refresh(false); 00904 }
|
|
Definition at line 207 of file gridcombo.h. |
|
Definition at line 209 of file gridcombo.h. |
|
Definition at line 211 of file gridcombo.h. |
|
Definition at line 204 of file gridcombo.h. |