当前位置: 首页>>代码示例>>C++>>正文


C++ CPDFSDK_Widget类代码示例

本文整理汇总了C++中CPDFSDK_Widget的典型用法代码示例。如果您正苦于以下问题:C++ CPDFSDK_Widget类的具体用法?C++ CPDFSDK_Widget怎么用?C++ CPDFSDK_Widget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CPDFSDK_Widget类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT

FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
  ASSERT(pAnnot->GetType() == "Widget");
  if (pAnnot->GetSubType() == BFFT_SIGNATURE)
    return FALSE;

  CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
  if (!pWidget->IsVisible())
    return FALSE;

  int nFieldFlags = pWidget->GetFieldFlags();
  if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
    return FALSE;

  if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
    return TRUE;

  CPDF_Page* pPage = pWidget->GetPDFPage();
  CPDF_Document* pDocument = pPage->m_pDocument;
  uint32_t dwPermissions = pDocument->GetUserPermissions();
  return (dwPermissions & FPDFPERM_FILL_FORM) ||
         (dwPermissions & FPDFPERM_ANNOT_FORM);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:22,代码来源:fsdk_annothandler.cpp

示例2: ASSERT

FX_BOOL	CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
{
	if(!pAnnot) return FALSE;
	ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");

	if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
	{
		if (pFormFiller->OnKillFocus(pAnnot, nFlag))
		{
 			if (!m_bNotifying)
 			{
 				CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
 				if (pWidget->GetAAction(CPDF_AAction::LoseFocus))
 				{
 					m_bNotifying = TRUE;
 					pWidget->ClearAppModified();
 
 					CPDFSDK_PageView* pPageView = pWidget->GetPageView();
 					ASSERT(pPageView != NULL);
 
 					PDFSDK_FieldAction fa;
					fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
 					fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
 
 					pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
 
 					pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
 					m_bNotifying = FALSE;
 
 				}
 			}
		}
		else
			return FALSE;
	}

	return TRUE;
}
开发者ID:151706061,项目名称:PDFium,代码行数:38,代码来源:FFL_IFormFiller.cpp

示例3: KillFocusAnnot

FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag) {
  if (m_pFocusAnnot) {
    CPDFSDK_AnnotHandlerMgr* pAnnotHandler = m_pEnv->GetAnnotHandlerMgr();
    CPDFSDK_Annot* pFocusAnnot = m_pFocusAnnot;
    m_pFocusAnnot = nullptr;
    if (pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag)) {
      if (pFocusAnnot->GetType() == FX_BSTRC("Widget")) {
        CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
        int nFieldType = pWidget->GetFieldType();
        if (FIELDTYPE_TEXTFIELD == nFieldType ||
            FIELDTYPE_COMBOBOX == nFieldType) {
          m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, FALSE);
        }
      }

      if (!m_pFocusAnnot)
        return TRUE;
    } else {
      m_pFocusAnnot = pFocusAnnot;
    }
  }
  return FALSE;
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例4: ASSERT

bool CFFL_InteractiveFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
                                             CPDFSDK_Annot::ObservedPtr* pAnnot,
                                             uint32_t nFlags,
                                             const CFX_PointF& point) {
  ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
  CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get());

  bool bSetFocus;
  switch (pWidget->GetFieldType()) {
    case FormFieldType::kPushButton:
    case FormFieldType::kCheckBox:
    case FormFieldType::kRadioButton: {
      FX_RECT bbox = GetViewBBox(pPageView, pAnnot->Get());
      bSetFocus =
          bbox.Contains(static_cast<int>(point.x), static_cast<int>(point.y));
      break;
    }
    default:
      bSetFocus = true;
      break;
  }
  if (bSetFocus)
    m_pFormFillEnv->SetFocusAnnot(pAnnot);

  CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
  bool bRet = pFormFiller &&
              pFormFiller->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point);
  if (m_pFormFillEnv->GetFocusAnnot() != pAnnot->Get())
    return bRet;
  if (OnButtonUp(pAnnot, pPageView, nFlags) || !pAnnot)
    return true;
#ifdef PDF_ENABLE_XFA
  if (OnClick(pAnnot, pPageView, nFlags) || !pAnnot)
    return true;
#endif  // PDF_ENABLE_XFA
  return bRet;
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例5: ASSERT

FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
    if (!pAnnot)
        return FALSE;

    ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");

    if (!m_bNotifying) {
        CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
        if (pWidget->GetAAction(CPDF_AAction::GetFocus)) {
            m_bNotifying = TRUE;
            pWidget->GetAppearanceAge();

            int nValueAge = pWidget->GetValueAge();
            pWidget->ClearAppModified();

            CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
            ASSERT(pPageView != NULL);

            PDFSDK_FieldAction fa;
            fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
            fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);

            CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE);
            if (!pFormFiller)
                return FALSE;
            pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa);
            pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView);
            m_bNotifying = FALSE;

            if (pWidget->IsAppModified()) {
                if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
                    pFormFiller->ResetPDFWindow(pPageView,
                                                nValueAge == pWidget->GetValueAge());
                }
            }
        }
    }

    if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
        pFormFiller->SetFocusForAnnot(pAnnot, nFlag);

    return TRUE;
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:43,代码来源:FFL_IFormFiller.cpp


注:本文中的CPDFSDK_Widget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。