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; }
void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { ASSERT(m_pFormFillEnv); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCharSet(FXFONT_GB2312_CHARSET); pEdit->SetCodePage(936); pEdit->SetReadyToInput(); CFX_WideString wsText = pEdit->GetText(); int nCharacters = wsText.GetLength(); CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true); } }
void CPWL_Note::RePosChildWnd() { RePosNoteChildren(); m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); ResetScrollBar(); m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0); //ͬ²½ if (const CPWL_Wnd* pWnd = this->GetFocused()) { if (pWnd->GetClassName() == "CPWL_Edit") { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCaret(pEdit->GetCaret()); } } //CPDF_Point ptNew = m_pContents->GetScrollPos(); //m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y); }
void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { ASSERT(m_pApp != NULL); ASSERT(pWnd != NULL); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCharSet(134); pEdit->SetCodePage(936); pEdit->SetReadyToInput(); CFX_WideString wsText = pEdit->GetText(); int nCharacters = wsText.GetLength(); CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE); pEdit->SetEditNotify(this); } }