コード例 #1
0
ファイル: cfwl_widgetmgr.cpp プロジェクト: hfiguiere/pdfium
IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
    IFWL_Widget* pRadioButton) {
  IFWL_Widget* pNext = pRadioButton;
  while (pNext) {
    if (pNext->GetStyles() & FWL_WGTSTYLE_Group)
      return pNext;
    pNext = GetSiblingRadioButton(pNext, FALSE);
  }
  pNext = GetLastSiblingWidget(pRadioButton);
  while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != nullptr &&
         pNext != pRadioButton) {
    if (pNext->GetStyles() & FWL_WGTSTYLE_Group)
      return pNext;
  }
  pNext = GetFirstSiblingWidget(pRadioButton);
  return GetSiblingRadioButton(pNext, TRUE);
}
コード例 #2
0
ファイル: ifwl_widget.cpp プロジェクト: documentcloud/pdfium
IFWL_ThemeProvider* IFWL_Widget::GetAvailableTheme() {
  if (m_pProperties->m_pThemeProvider)
    return m_pProperties->m_pThemeProvider;

  IFWL_Widget* pUp = this;
  do {
    pUp = (pUp->GetStyles() & FWL_WGTSTYLE_Popup)
              ? m_pWidgetMgr->GetOwnerWidget(pUp)
              : m_pWidgetMgr->GetParentWidget(pUp);
    if (pUp) {
      IFWL_ThemeProvider* pRet = pUp->GetThemeProvider();
      if (pRet)
        return pRet;
    }
  } while (pUp);
  return nullptr;
}
コード例 #3
0
ファイル: cfwl_widgetmgr.cpp プロジェクト: hfiguiere/pdfium
IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent,
                                     IFWL_Widget* focus,
                                     FX_BOOL& bFind) {
  CFWL_WidgetMgr* pMgr = CFWL_WidgetMgr::GetInstance();
  IFWL_Widget* child = pMgr->GetFirstChildWidget(parent);
  while (child) {
    if (focus == child)
      bFind = TRUE;

    if ((child->GetStyles() & FWL_WGTSTYLE_TabStop) &&
        (!focus || (focus != child && bFind))) {
      return child;
    }
    IFWL_Widget* bRet = nextTab(child, focus, bFind);
    if (bRet)
      return bRet;

    child = pMgr->GetNextSiblingWidget(child);
  }
  return nullptr;
}
コード例 #4
0
ファイル: cfwl_widgetmgr.cpp プロジェクト: hfiguiere/pdfium
void CFWL_WidgetMgr::GetSameGroupRadioButton(
    IFWL_Widget* pRadioButton,
    CFX_ArrayTemplate<IFWL_Widget*>& group) {
  IFWL_Widget* pFirst = GetFirstSiblingWidget(pRadioButton);
  if (!pFirst) {
    pFirst = pRadioButton;
  }
  int32_t iGroup = CountRadioButtonGroup(pFirst);
  if (iGroup < 2) {
    IFWL_Widget* pNext = pFirst;
    while ((pNext = GetSiblingRadioButton(pNext, TRUE)) != nullptr) {
      group.Add(pNext);
    }
    return;
  }
  IFWL_Widget* pNext = GetRadioButtonGroupHeader(pRadioButton);
  do {
    group.Add(pNext);
    pNext = GetSiblingRadioButton(pNext, TRUE);
    if (!pNext)
      pNext = GetSiblingRadioButton(pFirst, TRUE);
  } while (pNext && ((pNext->GetStyles() & FWL_WGTSTYLE_Group) == 0));
}