Beispiel #1
0
SListBoxEx::SListBoxEx()
    : m_nItemHei(20)
    , m_iScrollSpeed(-1)
    , m_iSelItem(-1)
    , m_iHoverItem(-1)
    , m_pCapturedFrame(NULL)
    , m_pItemSkin(NULL)
    , m_crItemBg(CR_INVALID)
    , m_crItemSelBg(RGBA(57,145,209,255))
	, m_crItemHotBg(RGBA(57,145,209,128))
    , m_bItemRedrawDelay(TRUE)
{
    m_bFocusable=TRUE;
    m_evtSet.addEvent(EVENTID(EventOfPanel));
    m_evtSet.addEvent(EVENTID(EventLBGetDispInfo));
    m_evtSet.addEvent(EVENTID(EventLBSelChanging));
    m_evtSet.addEvent(EVENTID(EventLBSelChanged));
}
Beispiel #2
0
    //////////////////////////////////////////////////////////////////////////
    // SComboBoxBase
    SComboBase::SComboBase(void)
        :m_pSkinBtn(GETBUILTINSKIN(SKIN_SYS_DROPBTN))
        ,m_pEdit(NULL)
        ,m_bDropdown(TRUE)
        ,m_nDropHeight(200, SLayoutSize::dp)
        ,m_dwBtnState(WndState_Normal)
        ,m_nAnimTime(200)
        ,m_pDropDownWnd(NULL)
        ,m_iInitSel(-1)
		,m_bAutoFitDropBtn(TRUE)
    {
        m_bFocusable=TRUE;
        m_style.SetAttribute(L"align",L"left",TRUE);
        m_style.SetAttribute(L"valign",L"middle",TRUE);

        m_evtSet.addEvent(EVENTID(EventCBSelChange));
        m_evtSet.addEvent(EVENTID(EventRENotify));
		m_evtSet.addEvent(EVENTID(EventCBDropdown));
    }
Beispiel #3
0
SListBox::SListBox()
    : m_nItemHei(20)
    , m_iSelItem(-1)
    , m_iHoverItem(-1)
    , m_crItemBg(CR_INVALID)
    , m_crItemBg2(CR_INVALID)
    , m_crItemSelBg(RGBA(57,145,209,255))
	, m_crItemHotBg(RGBA(57,145,209,128))
    , m_crText(CR_INVALID)
    , m_crSelText(CR_INVALID)
    , m_pItemSkin(NULL)
    , m_pIconSkin(NULL)
    , m_ptIcon(-1,-1)
    , m_ptText(-1,-1)
    , m_bHotTrack(FALSE)
{
    m_bFocusable = TRUE;
    m_evtSet.addEvent(EVENTID(EventLBSelChanging));
    m_evtSet.addEvent(EVENTID(EventLBSelChanged));
}
Beispiel #4
0
 SSpinButtonCtrl::SSpinButtonCtrl(void)
 :m_btnUp(NULL)
 ,m_btnDown(NULL)
 ,m_nMin(0)
 ,m_nMax(100)
 ,m_nValue(0)
 ,m_uStep(1)
 ,m_bCircle(TRUE)
 {
     GetEventSet()->addEvent(EVENTID(EventSpinValue2String));
 }
Beispiel #5
0
STabCtrl::STabCtrl() : m_nCurrentPage(0)
    , m_pSkinTab(GETBUILTINSKIN(SKIN_SYS_TAB_PAGE))
    , m_pSkinIcon(NULL)
    , m_pSkinTabInter(NULL)
    , m_pSkinFrame(NULL)
    , m_nTabInterSize(0)
    , m_nTabPos(0)
    , m_nHoverTabItem(-1)
    , m_nTabAlign(AlignTop)
    , m_nAnimateSteps(0)
    , m_ptText(-1,-1)
    , m_tabSlider(NULL)
{
    m_szTab.cx = m_szTab.cy = -1;
    m_bFocusable=TRUE;
    m_evtSet.addEvent(EVENTID(EventTabSelChanging));
    m_evtSet.addEvent(EVENTID(EventTabSelChanged));
    m_evtSet.addEvent(EVENTID(EventTabItemHover));
    m_evtSet.addEvent(EVENTID(EventTabItemLeave));
}
Beispiel #6
0
SItemPanel::SItemPanel(SWindow *pFrameHost,pugi::xml_node xmlNode,IItemContainer *pItemContainer)
    :m_pFrmHost(pFrameHost)
    ,m_pItemContainer(pItemContainer)
    ,m_dwData(0)
    ,m_crBk(CR_INVALID)
    ,m_crHover(CR_INVALID)
    ,m_crSelBk(RGBA(0,0,128,255))
    ,m_lpItemIndex(-1)
{
    SASSERT(m_pFrmHost);
    SASSERT(m_pItemContainer);
    SetContainer(this);
    if(xmlNode) 
    {
        InitFromXml(xmlNode);
        BuildWndTreeZorder();
    }
    m_evtSet.addEvent(EVENTID(EventItemPanelClick));
    m_evtSet.addEvent(EVENTID(EventItemPanelDbclick));
    m_evtSet.addEvent(EVENTID(EventItemPanelRclick));
    m_evtSet.addEvent(EVENTID(EventItemPanelHover));
    m_evtSet.addEvent(EVENTID(EventItemPanelLeave));
}
Beispiel #7
0
bool VistaEventManager::AddToIdList(HANP &idmap, EVENTID nEventId, int nPrio, VistaEventHandler *pHan)
{
	if(nEventId != NVET_ALL)
	{
		// check id mapping validity
		if(nEventId > EVENTID(idmap.second.first.size()))
			return false;

		// retrieve handler-list
		HQUEUE &hanlist = idmap.second.first[nEventId];


		HANQUEUE::const_iterator cit = std::find(hanlist.second->begin(),
			hanlist.second->end(), HANDLER(-1, pHan));
		if(cit == hanlist.second->end())
		{
			hanlist.second->push_back(HANDLER(nPrio, pHan));
			hanlist.second->sort(_qCompPrio());
			return true;
		}
		else
		{
			return false; // handler already registered!
		}
	}
	else // NVET_ALL
	{
		std::vector<HQUEUE> &v = idmap.second.first;
		for(std::vector<HQUEUE>::const_iterator cit = v.begin();
			cit != v.end(); ++cit)
		{
			HANQUEUE *p = (*cit).second;
			// test for existence
			HANQUEUE::const_iterator lookup = std::find(p->begin(),
				p->end(), HANDLER(-1, pHan));
			if(lookup == p->end())
			{
				p->push_back(HANDLER(nPrio, pHan));
				p->sort(_qCompPrio());
			}
			// else: skip
		}
		return true;
	}
}
Beispiel #8
0
bool VistaEventManager::RemoveFromIdList(HANP &idmap,
										  EVENTID nEventId,
										  VistaEventHandler *pHan)
{
	if(nEventId != NVET_ALL)
	{

		// check id mapping validity
		if(nEventId > EVENTID(idmap.second.first.size()))
			return false;

		// retrieve handler-list
		HQUEUE &hanlist = idmap.second.first[nEventId];
				HANDLER h(-1,pHan);
		HANQUEUE *p = hanlist.second;
		HANQUEUE::iterator it = std::find(p->begin(), p->end(), HANDLER(-1,pHan));
		if(it != p->end())
			p->erase(it);
		// we do not need to re-sort the list, removing
		// elements preserves the order of the others
	}
	else // NVET_ALL
	{
		const std::vector<HQUEUE> &v = idmap.second.first;
		for(std::vector<HQUEUE>::const_iterator cit = v.begin();
			cit != v.end(); ++cit)
		{
			HANQUEUE *p = (*cit).second;
				HANQUEUE::iterator it = std::find(p->begin(), p->end(), HANDLER(-1,pHan));
					if(it != p->end())
							p->erase(it);

		}
	}
	return true;
}
Beispiel #9
0
 SChatEdit::SChatEdit(void)
 {
     GetEventSet()->addEvent(EVENTID(EventChatEditKeyReturn));
 }
 SCaptureButton::SCaptureButton(void)
 {
     m_evtSet.addEvent(EVENTID(EventCapture));
     m_evtSet.addEvent(EVENTID(EventCaptureFinish));
 }
Beispiel #11
0
 SSearchDropdownList::SSearchDropdownList(void):m_nDropAlign(DROPALIGN_RIGHT),m_nMaxDropHeight(150),m_pDropDownWnd(NULL)
 {
     GetEventSet()->addEvent(EVENTID(EventFillSearchDropdownList));
     GetEventSet()->addEvent(EVENTID(EventDropdownListSelected));
 }
Beispiel #12
0
SLoopButton::SLoopButton():m_iSkinStates(1),m_iCurState(0),m_iState(4)
{
	m_evtSet.addEvent(EVENTID(EventBtnSelChanging));
	m_evtSet.addEvent(EVENTID(EventBtnSelChanged));
}
Beispiel #13
0
 SFlyWnd::SFlyWnd(void):m_bEndPos(FALSE),m_nAniTime(200)
 {
    m_evtSet.addEvent(EVENTID(FlyStateEvent));
 }