FX_BOOL CXFA_FFComboBox::LoadWidget() { CFWL_ComboBox* pComboBox = CFWL_ComboBox::Create(); pComboBox->Initialize(); m_pNormalWidget = (CFWL_Widget*)pComboBox; IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); m_pNormalWidget->SetPrivateData(pWidget, this, NULL); IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { pComboBox->AddString(wsLabelArray[i]); } CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); if (iSelCount > 0) { pComboBox->SetCurSel(iSelArray[0]); } else { CFX_WideString wsText; m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Raw); pComboBox->SetEditText(wsText); } UpdateWidgetProperty(); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
FX_BOOL CXFA_FFListBox::LoadWidget() { CFWL_ListBox* pListBox = CFWL_ListBox::Create(); pListBox->Initialize(); pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, 0xFFFFFFFF); m_pNormalWidget = (CFWL_Widget*)pListBox; IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); m_pNormalWidget->SetPrivateData(pWidget, this, NULL); IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { pListBox->AddString(wsLabelArray[i]); } FX_DWORD dwExtendedStyle = FWL_STYLEEXT_LTB_ShowScrollBarFocus; if (m_pDataAcc->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { dwExtendedStyle |= FWL_STYLEEXT_LTB_MultiSelection; } dwExtendedStyle |= GetAlignment(); m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iSelCount = iSelArray.GetSize(); for (int32_t j = 0; j < iSelCount; j++) { FWL_HLISTITEM item = pListBox->GetItem(iSelArray[j]); pListBox->SetSelItem(item, TRUE); } m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
CXFA_FFListBox::~CXFA_FFListBox() { if (m_pNormalWidget) { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->UnregisterEventTarget(pWidget); } }
FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { #if (_FX_OS_ == _FX_WIN32_DESKTOP_) if (count <= 0) #endif { CFWL_EvtIdle ev; IFWL_App* pApp = FWL_GetApp(); if (!pApp) return FWL_ERR_Indefinite; IFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); if (!pDriver) return FWL_ERR_Indefinite; pDriver->SendNote(&ev); } return FWL_ERR_Indefinite; }
FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { CFWL_Edit* pWidget = CFWL_Edit::Create(); pWidget->Initialize(); m_pNormalWidget = (CFWL_Widget*)pWidget; IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); m_pNormalWidget->SetPrivateData(pIWidget, this, NULL); IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); CFX_WideString wsText; m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); pWidget->SetText(wsText); UpdateWidgetProperty(); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
FX_BOOL CXFA_FFPushButton::LoadWidget() { ASSERT(!m_pNormalWidget); CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); if (pPushButton) { pPushButton->Initialize(); } m_pOldDelegate = pPushButton->SetDelegate(this); m_pNormalWidget = pPushButton; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pNormalWidget->LockUpdate(); UpdateWidgetProperty(); LoadHighlightCaption(); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
FX_BOOL CXFA_FFImageEdit::LoadWidget() { CFWL_PictureBox* pPictureBox = new CFWL_PictureBox; if (pPictureBox) { pPictureBox->Initialize(); } m_pNormalWidget = pPictureBox; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = pPictureBox->SetDelegate(this); CXFA_FFField::LoadWidget(); if (m_pDataAcc->GetImageEditImage()) { return TRUE; } UpdateFWLData(); return TRUE; }
FX_BOOL CXFA_FFCheckButton::LoadWidget() { CFWL_CheckBox* pCheckBox = CFWL_CheckBox::Create(); pCheckBox->Initialize(); m_pNormalWidget = pCheckBox; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); if (m_pDataAcc->IsRadioButton()) { pCheckBox->ModifyStylesEx(FWL_STYLEEXT_CKB_RadioButton, 0xFFFFFFFF); } m_pNormalWidget->LockUpdate(); UpdateWidgetProperty(); SetFWLCheckState(m_pDataAcc->GetCheckState()); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { CFWL_DateTimePicker* pWidget = CFWL_DateTimePicker::Create(); pWidget->Initialize(); m_pNormalWidget = (CFWL_Widget*)pWidget; IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); m_pNormalWidget->SetPrivateData(pIWidget, this, NULL); IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); CFX_WideString wsText; m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); pWidget->SetEditText(wsText); XFA_DATETIMETYPE eType = XFA_DATETIMETYPE_DateAndTime; if (CXFA_Value value = m_pDataAcc->GetFormValue()) { switch (value.GetChildValueClassID()) { case XFA_ELEMENT_Date: { eType = XFA_DATETIMETYPE_Date; if (!wsText.IsEmpty()) { CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc); CFX_Unitime date = lcValue.GetDate(); if ((FX_UNITIME)date != 0) { pWidget->SetCurSel(date.GetYear(), date.GetMonth(), date.GetDay()); } } } break; case XFA_ELEMENT_Time: eType = XFA_DATETIMETYPE_Time; break; default: eType = XFA_DATETIMETYPE_DateAndTime; break; } } UpdateWidgetProperty(); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); }
IFWL_AdapterNative* FWL_GetAdapterNative() { IFWL_App* pApp = FWL_GetApp(); if (!pApp) return NULL; return pApp->GetAdapterNative(); }
CXFA_FFApp* FWL_GetAdapterNative() { IFWL_App* pApp = FWL_GetApp(); if (!pApp) return nullptr; return pApp->GetAdapterNative(); }
// static CFWL_WidgetMgr* CFWL_WidgetMgr::GetInstance() { IFWL_App* pApp = FWL_GetApp(); return pApp ? pApp->GetWidgetMgr() : nullptr; }
IFWL_NoteThread* CFWL_NoteDriver::GetOwnerThread() const { return FWL_GetApp(); }