Exemplo n.º 1
0
// Copy a list to another list
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefListValue> target)
{
    int arg_length = source->GetSize();
    if (arg_length == 0)
        return;
    target->SetSize(arg_length);
    for (int i = 0; i < arg_length; ++i)
        SetListValue(target, i, source);
}
Exemplo n.º 2
0
// Transfer a V8 vector to a list
void SetList(const CefV8ValueList& source, CefRefPtr<CefListValue> target)
{
    int arg_length = source.size();
    if (arg_length == 0)
        return;
    target->SetSize(arg_length);
    for (int i = 0; i < arg_length; ++i)
        SetListValue(target, i, source[i]);
}
Exemplo n.º 3
0
// Transfer a List to a V8 array.
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
    ASSERT(target->IsArray());

    int arg_length = source->GetSize();
    if (arg_length == 0)
        return;

    for (int i = 0; i < arg_length; ++i)
        SetListValue(target, i, source);
}
Exemplo n.º 4
0
void CMyEditShowList::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{	
	CEdit::OnChar(nChar, nRepCnt, nFlags);
	oncharflag=true;
	CString str;
    CGATHEROUT *cwnd=( CGATHEROUT *)GetParent();
	CRect rect1;cwnd->GetClientRect(rect1);
    ClientToScreen(rect1);	
	CRect rect;
	GetClientRect(rect);
	int a=rect.left;
	int b=rect.top;
	ClientToScreen(rect);
	if(!m_list)
	{
	  m_list.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT,CRect(rect.left,rect.top,rect.right+200,rect.bottom+200), cwnd, 1);	
	  m_list.InsertColumn(0,"商品编号",LVCFMT_LEFT,60);
	  m_list.InsertColumn(1,"商品名称",LVCFMT_LEFT,60);
	  m_list.InsertColumn(2,"单价",LVCFMT_LEFT,60);
	  m_list.InsertColumn(3,"规格型号",LVCFMT_LEFT,60);
	  m_list.InsertColumn(4,"供应商",LVCFMT_LEFT,60);
	  m_list.InsertColumn(5,"单位",LVCFMT_LEFT,60);
	  m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
	}
	TEXTMETRIC Metrics ;
	CDC * dc=this->GetDC();
	dc->GetTextMetrics(&Metrics) ; 
	 
	if(nChar!=VK_BACK)
	{   
		this;
		cwnd->UpdateData();
		querystr=cwnd->m_mercid;
		width+=Metrics.tmHeight/8;
        m_list.MoveWindow(rect.left-100+width,rect.top-100,rect.right+width,rect.bottom-500,true);
	}
    else
	{
		querystr=querystr.Mid(0,querystr.GetLength()-1);
        width-=Metrics.tmHeight/8;
        m_list.MoveWindow(rect.left-100+width,rect.top-100,rect.right+width,rect.bottom-500,true);
	}
	if(nChar==VK_DOWN)
	{
	
		::SetFocus(m_list.m_hWnd);
	}
	str.Format("select * from tb_merchangiseinfo where id like '%%%s%%'",querystr);
    GetRecord(str);

	SetListValue("");
}
Exemplo n.º 5
0
// Transfer a V8 array to a List.
void SetList(CefRefPtr<CefV8Value> source, CefRefPtr<CefListValue> target) {
    ASSERT(source->IsArray());

    int arg_length = source->GetArrayLength();
    if (arg_length == 0)
        return;

    // Start with null types in all spaces.
    target->SetSize(arg_length);

    for (int i = 0; i < arg_length; ++i)
        SetListValue(target, i, source->GetValue(i));
}
Exemplo n.º 6
0
bool Value::
IsSListValue(classad_shared_ptr<ExprList>& l)
{
    if (valueType == SLIST_VALUE) {
        l = (*slistValue);
        return true;
    } else if (valueType == LIST_VALUE) {
            // we must copy our list, because it does not belong
            // to a shared_ptr
        l = classad_shared_ptr<ExprList>( (ExprList*)listValue->Copy() );
        if( !l ) {
            return false;
        }
            // in case we are called multiple times, stash a shared_ptr
            // to the copy of the list
        SetListValue(l);
        return true;
    } else {
        return false;
    }
}