2#include "control/SComboView.h"
34 m_pListBox->SetAttribute(L
"pos", L
"0,0,-0,-0", TRUE);
35 m_pListBox->SetAttribute(L
"hotTrack", L
"1", TRUE);
45 int nDropHeight = m_nDropHeight.toPixelSize(
GetScale());
48 IListViewItemLocator *pItemLocator =
m_pListBox->GetItemLocator();
49 SASSERT(pItemLocator);
50 CRect rcMargin =
m_pListBox->GetStyle().GetMargin();
51 nDropHeight = smin(nDropHeight, (
int)(pItemLocator->GetTotalHeight() + rcMargin.top + rcMargin.bottom));
58 __baseCls::OnCreateDropDown(pDropDown);
72 __baseCls::OnDestroyDropDown(pDropDown);
78 if (m_pEdit && !m_pEdit->GetEventSet()->isMuted())
80 SStringT strText = GetLBText(
m_pListBox->GetSel(), FALSE);
81 m_pEdit->GetEventSet()->setMutedState(
true);
82 SComboBase::SetWindowText(strText);
83 m_pEdit->GetEventSet()->setMutedState(
false);
86 __baseCls::OnSelChanged();
91 if (evt->IdFrom() == IDC_DROPDOWN_LIST && m_pDropDownWnd)
93 if (evt->GetID() == EventLVSelChanged::EventID)
98 if (evt->GetID() == EventCmd::EventID)
104 return SComboBase::FireEvent(evt);
109 __baseCls::OnScaleChanged(nScale);
121 ILvAdapter *pAdapter =
m_pListBox->GetAdapter();
122 if (!pAdapter || iItem == -1)
125 pAdapter->getItemDesc(iItem, &strDesc);
127 strDesc =
tr(strDesc);
128 SStringT ret = S_CW2T(strDesc);
135 ILvAdapter *pAdapter =
m_pListBox->GetAdapter();
138 return pAdapter->getCount();
157 HRESULT hr = __baseCls::OnLanguageChanged();
BOOL GetItemText(int iItem, BOOL bRawText, IStringT *str) SCONST OVERRIDE
Get the text of a list view item.
virtual void OnSelChanged()
Handle selection change in the dropdown window.
virtual int GetListBoxHeight()
Get the height of the list view.
virtual void OnDestroyDropDown(SDropDownWnd *pDropDown)
Handle destruction of the dropdown window.
virtual void OnCreateDropDown(SDropDownWnd *pDropDown)
Handle creation of the dropdown window.
IListView * GetIListView() OVERRIDE
Get the list view interface.
virtual void OnScaleChanged(int nScale)
Handle scale change event.
virtual BOOL CreateListBox(SXmlNode xmlNode)
Create the list view.
BOOL SetCurSel(int iSel) OVERRIDE
Set the current selection index.
~SComboView(void)
Destructor.
int GetCount() SCONST OVERRIDE
Get the number of items in the list view.
int GetCurSel() SCONST OVERRIDE
Get the current selection index.
SComboView(void)
Constructor.
SListView * GetListView()
Get the list view pointer.
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Notify event.
virtual HRESULT OnLanguageChanged() override
Handle language change event.
SWindow * GetRoot() const
Gets the root window.
static LPCWSTR GetClassName()
A class representing an ASCII string.
BOOL RemoveChild(SWindow *pChild)
Removes a child window from the window tree.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
ISwndContainer * GetContainer() OVERRIDE
Retrieves the container associated with this window.
void InsertChild(SWindow *pNewChild, SWindow *pInsertAfter=NULL)
Inserts a child window into the window tree.
virtual SStringW tr(const SStringW &strSrc) const
Translation function.
void UpdateChildrenPosition() OVERRIDE
Updates the position of child windows.
virtual SWindow * CreateChildByName(LPCWSTR pszName)
Create child window by name.
void Invalidate() OVERRIDE
Invalidates the entire window.
const wchar_t * as_string(const wchar_t *def=L"") const
Gets the attribute value as a string.
Class representing an XML node.
SXmlAttr attribute(const wchar_t *name, bool bCaseSensitive=false) const
Gets the attribute with the specified name.
SXmlNode child(const wchar_t *name, bool bCaseSensitive=false) const
Gets the child node, attribute, or next/previous sibling with the specified name.