Exemple #1
0
CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
{
    CPWL_Edit * pWnd = new CPWL_Edit();
        pWnd->AttachFFLData(this);
    pWnd->Create(cp);



    ASSERT(m_pApp != NULL);
    CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
    pWnd->SetFillerNotify(pIFormFiller);

    ASSERT(m_pWidget != NULL);
    int32_t nMaxLen = m_pWidget->GetMaxLen();
    CFX_WideString swValue = m_pWidget->GetValue();

    if (nMaxLen > 0)
    {
        if (pWnd->HasFlag(PES_CHARARRAY))
        {
            pWnd->SetCharArray(nMaxLen);
            pWnd->SetAlignFormatV(PEAV_CENTER);
        }
        else
        {
            pWnd->SetLimitChar(nMaxLen);
        }
    }

    pWnd->SetText(swValue.c_str());
    return pWnd;
}