Beispiel #1
0
void NewViewSize (int width)
{
    viewsize = width;
    if(viewsize == 21)
        SetViewSize(screenWidth, screenHeight);
    else if(viewsize == 20)
        SetViewSize(screenWidth, screenHeight - scaleFactor * STATUSLINES);
    else
        SetViewSize(width*16*screenWidth/320, (unsigned) (width*16*HEIGHTRATIO*screenHeight/200));
}
Beispiel #2
0
void CDuiItemBox::UpdateScroll()
{
    CRect rcClient=m_rcWindow;

    int nPageCols=(rcClient.Width()+m_nSepWid)/(m_nItemWid+m_nSepWid);
    int nPageRows=(rcClient.Height()+m_nSepHei)/(m_nItemHei+m_nSepHei);
    if(nPageCols<1) nPageCols=1;
    int nPageItems=nPageCols*nPageRows;
    if(nPageItems<GetItemCount())
    {
        rcClient.right-=m_nSbWid;
        nPageCols=(rcClient.Width()+m_nSepWid)/(m_nItemWid+m_nSepWid);
        if(nPageCols<1) nPageCols=1;
        nPageItems=nPageCols*nPageRows;
    }


    SCROLLINFO si;
    si.fMask=SIF_RANGE|SIF_PAGE;
    si.nPage=(nPageItems<GetItemCount())?rcClient.Height():0;
    si.nMin=0;
    si.nMax=(GetItemCount()+nPageCols-1)/nPageCols*(m_nItemHei+m_nSepHei)-m_nSepHei;
    SetScrollInfo(si,TRUE);

    SetViewSize(CSize(rcClient.Width(),si.nMax));
    if(si.nPage==0) SetViewOrigin(CPoint(0,0));
    else SetViewOrigin(CPoint(0,GetScrollPos(TRUE)));
}
void SetRecord(const ::Neurotec::Biometrics::Standards::FirFingerView & value)
{
	m_bitmap = wxNullImage;
	m_imageError = NULL;
	m_record = value;

	if (value.IsNull())
	{
		m_w = 0;
		m_h = 0;
	}
	else
	{
		m_w = value.GetHorzLineLength();
		m_h = value.GetVertLineLength();
		try
		{
			::Neurotec::Images::NImage image = m_record.ToNImage();
			m_bitmap = image.ToBitmap();
		}
		catch (::Neurotec::NError & e)
		{
			m_imageError = e;
		}
	}
	SetViewSize(m_w, m_h);
}
Beispiel #4
0
BOOL SListBoxEx::SetItemCount(int nItems,LPCTSTR pszXmlTemplate)
{
    if(m_arrItems.GetCount()!=0) return FALSE;
    pugi::xml_document xmlDoc;
    pugi::xml_node xmlTemplate = m_xmlTempl.child(L"template");
    if(pszXmlTemplate)
    {
        SStringA strUtf8=S_CT2A(pszXmlTemplate,CP_UTF8);
        if(!xmlDoc.load_buffer((LPCSTR)strUtf8,strUtf8.GetLength(),pugi::parse_default,pugi::encoding_utf8)) return FALSE;
        xmlTemplate = xmlDoc.first_child();
    }
    if(!xmlTemplate) 
        return FALSE;
    
    
    m_arrItems.SetCount(nItems);
    for(int i=0;i<nItems;i++)
    {
        SItemPanel *pItemObj=SItemPanel::Create(this,xmlTemplate,this);
        pItemObj->Move(CRect(0,0,m_rcClient.Width(),m_nItemHei));
        if(m_pItemSkin) pItemObj->SetSkin(m_pItemSkin);
        pItemObj->SetColor(m_crItemBg,m_crItemSelBg);
        m_arrItems[i] = pItemObj;
        pItemObj->SetItemIndex(i);
    }
    
    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetItemCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);

    return TRUE;
}
Beispiel #5
0
void SListBoxEx::DeleteItem(int iItem)
{
    if(iItem<0 || iItem>=GetItemCount()) return;
    if(m_pCapturedFrame == m_arrItems[iItem])
    {
        m_pCapturedFrame=NULL;
        ReleaseCapture();
    }

    m_arrItems[iItem]->Release();
    m_arrItems.RemoveAt(iItem);

    if(m_iSelItem==iItem) m_iSelItem=-1;
    else if(m_iSelItem>iItem) m_iSelItem--;
    if(m_iHoverItem==iItem) m_iHoverItem=-1;
    else if(m_iHoverItem>iItem) m_iHoverItem--;

    UpdatePanelsIndex(iItem,-1);

    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetItemCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);
}
Beispiel #6
0
int SListBoxEx::InsertItem(int iItem,pugi::xml_node xmlNode,LPARAM dwData/*=0*/)
{
    SItemPanel *pItemObj=SItemPanel::Create(this,xmlNode,this);

    if(iItem==-1 || iItem>=GetItemCount())
    {
        iItem=GetItemCount();
    }
    pItemObj->SetItemData(dwData);
    pItemObj->Move(CRect(0,0,m_rcClient.Width(),m_nItemHei));
    if(m_pItemSkin) pItemObj->SetSkin(m_pItemSkin);
    pItemObj->SetColor(m_crItemBg,m_crItemSelBg);

    m_arrItems.InsertAt(iItem,pItemObj);

    if(m_iSelItem>=iItem) m_iSelItem++;
    if(m_iHoverItem>=iItem) m_iHoverItem++;

    UpdatePanelsIndex(iItem,-1);

    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetItemCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);

    return iItem;
}
Camera::Camera(float fov, float width, float height, XMFLOAT4 lookAtTarget, XMFLOAT4 position, XMFLOAT4 up)
{
	SetFOV(fov);
  SetViewSize(width, height);
	SetLookAtTarget(lookAtTarget);
	SetPosition(position);
	SetUpVector(up);
}
Beispiel #8
0
void SListBox::OnSize(UINT nType,CSize size)
{
    __super::OnSize(nType,size);
    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);
}
Beispiel #9
0
    void SMCTreeCtrl::SetTreeWidth(int nWid)
    {
        m_nTreeWidth = nWid;
        m_nItemWid = -1;
        CalcItemWidth(0);

        CSize szView = GetViewSize();
        szView.cx = m_nItemWid;
        SetViewSize(szView);

        Invalidate();
    }
void CIMDisplayView::OnInitialUpdate()
{
    CScrollView::OnInitialUpdate();

    CIMDisplayDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);

    // Save initial image geometry
    mBaseGeo.width( pDoc->GetImage().columns() );
    mBaseGeo.height( pDoc->GetImage().rows() );

    SetViewSize();
}
Beispiel #11
0
HRESULT CTestScrollView::DefaultMsgProc( UINT nMsg, WPARAM wparam, LPARAM lparam )
{
	HRESULT hr = CTxScrollView::DefaultMsgProc(nMsg, wparam, lparam);
	switch (nMsg)
	{
	case WM_CREATE:
		{
			CSize szView(1000,1000);
			SetViewSize(szView);
		}
		break;
	}
	return hr;
}
Beispiel #12
0
void SListBox::DeleteAll()
{
    for(int i=0; i < GetCount(); i++)
    {
        if (m_arrItems[i])
            delete m_arrItems[i];
    }
    m_arrItems.RemoveAll();

    m_iSelItem=-1;
    m_iHoverItem=-1;

    SetViewSize(CSize(0,0));
    Invalidate();
}
Beispiel #13
0
    BOOL SMCTreeCtrl::SetColWidth(int iCol,int nWid)
    {
        if(iCol<0 || iCol>=m_arrColWidth.GetCount()) 
            return FALSE;
        m_arrColWidth.SetAt(iCol,nWid);
        m_nItemWid = -1;
        CalcItemWidth(0);
        
        CSize szView = GetViewSize();
        szView.cx = m_nItemWid;
        SetViewSize(szView);

        Invalidate();
        return TRUE;
    }
Beispiel #14
0
void SListBoxEx::DeleteAllItems(BOOL bUpdate/*=TRUE*/)
{
    for(int i=0; i<GetItemCount(); i++)
    {
        m_arrItems[i]->Release();
    }
    m_arrItems.RemoveAll();
    m_iSelItem=-1;
    m_iHoverItem=-1;
    m_pCapturedFrame=NULL;
    ReleaseCapture();

    SetViewSize(CSize(0,0));
    if(bUpdate) Invalidate();
}
void NewViewSize (int width)
{
    unsigned viewwidth    = screenWidth;
    unsigned viewheight   = screenHeight;

    viewsize = width;

    if(viewsize == 20)
        viewheight = screenHeight - scaleFactor * STATUSLINES;
    else if (viewsize != 21)
    {
        viewwidth  = width * 16 * screenWidth / 320;
        viewheight = (unsigned)(width * 16 * HEIGHTRATIO * screenHeight / 200);
    }

    SetViewSize(viewwidth, viewheight);
}
Beispiel #16
0
 int SMCTreeCtrl::InsertColumn(int iCol,int nWid)
 {
     if(iCol < 0) iCol = m_arrColWidth.GetCount();
     m_arrColWidth.InsertAt(iCol,nWid);
     
     HSTREEITEM hItem = GetRootItem();
     while(hItem)
     {
         MCITEM *pMcItem = (MCITEM*)STreeCtrl::GetItemData(hItem);
         pMcItem->arrText.InsertAt(iCol,SStringT());
         hItem = GetNextItem(hItem);
     }
     m_nItemWid = -1;
     CalcItemWidth(0);
     
     CSize szView = GetViewSize();
     szView.cx = m_nItemWid;
     SetViewSize(szView);
     Invalidate();
     return iCol;
 }
Beispiel #17
0
BOOL SListBox::DeleteString(int nIndex)
{
    if(nIndex<0 || nIndex>=GetCount()) return FALSE;


    if (m_arrItems[nIndex])
        delete m_arrItems[nIndex];
    m_arrItems.RemoveAt(nIndex);

    if(m_iSelItem==nIndex) m_iSelItem=-1;
    else if(m_iSelItem>nIndex) m_iSelItem--;
    if(m_iHoverItem==nIndex) m_iHoverItem=-1;
    else if(m_iHoverItem>nIndex) m_iHoverItem--;

    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);

    return TRUE;
}
Beispiel #18
0
int SListBox::InsertItem(int nIndex, LPLBITEM pItem)
{
    SASSERT(pItem);

    if(nIndex==-1 || nIndex>GetCount())
    {
        nIndex = GetCount();
    }

    m_arrItems.InsertAt(nIndex, pItem);

    if(m_iSelItem >= nIndex) m_iSelItem++;
    if(m_iHoverItem >= nIndex) m_iHoverItem++;

    CRect rcClient;
    SWindow::GetClientRect(&rcClient);
    CSize szView(rcClient.Width(),GetCount()*m_nItemHei);
    if(szView.cy>rcClient.Height()) szView.cx-=m_nSbWid;
    SetViewSize(szView);

    return nIndex;
}
Beispiel #19
0
    BOOL SMCTreeCtrl::DeleteColumn(int iCol)
    {
        if(iCol<0 || iCol>=m_arrColWidth.GetCount()) 
            return FALSE;
        HSTREEITEM hItem = GetRootItem();
        while(hItem)
        {
            MCITEM *pMcItem = (MCITEM*)STreeCtrl::GetItemData(hItem);
            pMcItem->arrText.RemoveAt(iCol);
            hItem = GetNextItem(hItem);
        }
        int nColWid = m_arrColWidth[iCol];
        m_arrColWidth.RemoveAt(iCol);
        
        m_nItemWid = -1;
        CalcItemWidth(0);

        CSize szView = GetViewSize();
        szView.cx = m_nItemWid;
        SetViewSize(szView);
        Invalidate();
        return TRUE;
    }
void CIMDisplayView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
    SetViewSize();
}
Beispiel #21
0
	void SetViewSize(QSize size)
	{
		SetViewSize(size.width(), size.height());
	}