diff options
Diffstat (limited to 'xfa/fwl/lightwidget')
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_barcode.cpp | 60 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_barcode.h | 35 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_checkbox.h | 18 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_combobox.cpp | 10 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_combobox.h | 101 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_datetimepicker.h | 23 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_edit.h | 5 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_listbox.cpp | 12 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_listbox.h | 19 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_picturebox.cpp | 10 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_picturebox.h | 37 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_pushbutton.h | 17 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_widgetproperties.cpp | 14 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_widgetproperties.h | 11 |
14 files changed, 250 insertions, 122 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.cpp b/xfa/fwl/lightwidget/cfwl_barcode.cpp index 4b998d04d7..2e29d63f34 100644 --- a/xfa/fwl/lightwidget/cfwl_barcode.cpp +++ b/xfa/fwl/lightwidget/cfwl_barcode.cpp @@ -44,7 +44,67 @@ FX_BOOL CFWL_Barcode::IsProtectedType() { return 0; return static_cast<IFWL_Barcode*>(m_pIface)->IsProtectedType(); } + +CFWL_Barcode::CFWL_BarcodeDP::CFWL_BarcodeDP() + : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} + FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) { return FWL_Error::Succeeded; } + +BC_CHAR_ENCODING CFWL_Barcode::CFWL_BarcodeDP::GetCharEncoding() { + return m_eCharEncoding; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleHeight() { + return m_nModuleHeight; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleWidth() { + return m_nModuleWidth; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetDataLength() { + return m_nDataLength; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() { + return m_nCalChecksum; +} + +FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() { + return m_bPrintChecksum; +} + +BC_TEXT_LOC CFWL_Barcode::CFWL_BarcodeDP::GetTextLocation() { + return m_eTextLocation; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetWideNarrowRatio() { + return m_nWideNarrowRatio; +} + +FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetStartChar() { + return m_cStartChar; +} + +FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetEndChar() { + return m_cEndChar; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetVersion() { + return m_nVersion; +} + +int32_t CFWL_Barcode::CFWL_BarcodeDP::GetErrorCorrectionLevel() { + return m_nECLevel; +} + +FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() { + return m_bTruncated; +} + +uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() { + return m_dwAttributeMask; +} diff --git a/xfa/fwl/lightwidget/cfwl_barcode.h b/xfa/fwl/lightwidget/cfwl_barcode.h index 565ebb884e..1a22064a97 100644 --- a/xfa/fwl/lightwidget/cfwl_barcode.h +++ b/xfa/fwl/lightwidget/cfwl_barcode.h @@ -80,28 +80,31 @@ class CFWL_Barcode : public CFWL_Edit { protected: CFWL_Barcode(); - virtual ~CFWL_Barcode(); + ~CFWL_Barcode() override; class CFWL_BarcodeDP : public IFWL_BarcodeDP { public: - CFWL_BarcodeDP() : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} + CFWL_BarcodeDP(); + // IFWL_DataProvider FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override; - BC_CHAR_ENCODING GetCharEncoding() override { return m_eCharEncoding; } - int32_t GetModuleHeight() override { return m_nModuleHeight; } - int32_t GetModuleWidth() override { return m_nModuleWidth; } - int32_t GetDataLength() override { return m_nDataLength; } - int32_t GetCalChecksum() override { return m_nCalChecksum; } - FX_BOOL GetPrintChecksum() override { return m_bPrintChecksum; } - BC_TEXT_LOC GetTextLocation() override { return m_eTextLocation; } - int32_t GetWideNarrowRatio() override { return m_nWideNarrowRatio; } - FX_CHAR GetStartChar() override { return m_cStartChar; } - FX_CHAR GetEndChar() override { return m_cEndChar; } - int32_t GetVersion() override { return m_nVersion; } - int32_t GetErrorCorrectionLevel() override { return m_nECLevel; } - FX_BOOL GetTruncated() override { return m_bTruncated; } - uint32_t GetBarcodeAttributeMask() override { return m_dwAttributeMask; } + + // IFWL_BarcodeDP + BC_CHAR_ENCODING GetCharEncoding() override; + int32_t GetModuleHeight() override; + int32_t GetModuleWidth() override; + int32_t GetDataLength() override; + int32_t GetCalChecksum() override; + FX_BOOL GetPrintChecksum() override; + BC_TEXT_LOC GetTextLocation() override; + int32_t GetWideNarrowRatio() override; + FX_CHAR GetStartChar() override; + FX_CHAR GetEndChar() override; + int32_t GetVersion() override; + int32_t GetErrorCorrectionLevel() override; + FX_BOOL GetTruncated() override; + uint32_t GetBarcodeAttributeMask() override; BC_CHAR_ENCODING m_eCharEncoding; int32_t m_nModuleHeight, m_nModuleWidth; diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.h b/xfa/fwl/lightwidget/cfwl_checkbox.h index 061e46f777..7fcd43a6eb 100644 --- a/xfa/fwl/lightwidget/cfwl_checkbox.h +++ b/xfa/fwl/lightwidget/cfwl_checkbox.h @@ -12,27 +12,33 @@ class CFWL_CheckBox : public CFWL_Widget { public: + CFWL_CheckBox(); + ~CFWL_CheckBox() override; + static CFWL_CheckBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_Error GetCaption(CFX_WideString& wsCaption); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); FWL_Error SetBoxSize(FX_FLOAT fHeight); int32_t GetCheckState(); FWL_Error SetCheckState(int32_t iCheck); - CFWL_CheckBox(); - virtual ~CFWL_CheckBox(); protected: class CFWL_CheckBoxDP : public IFWL_CheckBoxDP { public: CFWL_CheckBoxDP(); - virtual FWL_Error GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption); - virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget); + + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + + // IFWL_CheckBoxDP + FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) override; + FX_FLOAT m_fBoxHeight; CFX_WideString m_wsCaption; }; + CFWL_CheckBoxDP m_checkboxData; }; diff --git a/xfa/fwl/lightwidget/cfwl_combobox.cpp b/xfa/fwl/lightwidget/cfwl_combobox.cpp index 934b0d856e..9d20c97824 100644 --- a/xfa/fwl/lightwidget/cfwl_combobox.cpp +++ b/xfa/fwl/lightwidget/cfwl_combobox.cpp @@ -290,6 +290,12 @@ CFWL_ComboBox::CFWL_ComboBoxDP::CFWL_ComboBoxDP() { CFWL_ComboBox::CFWL_ComboBoxDP::~CFWL_ComboBoxDP() {} +FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetCaption( + IFWL_Widget* pWidget, + CFX_WideString& wsCaption) { + return FWL_Error::Succeeded; +} + int32_t CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget* pWidget) { return m_ItemArray.size(); } @@ -427,3 +433,7 @@ FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckState( FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetListHeight(IFWL_Widget* pWidget) { return m_fMaxListHeight; } + +CFWL_ComboBoxItem::CFWL_ComboBoxItem() : m_pDIB(nullptr), m_pData(nullptr) {} + +CFWL_ComboBoxItem::~CFWL_ComboBoxItem() {} diff --git a/xfa/fwl/lightwidget/cfwl_combobox.h b/xfa/fwl/lightwidget/cfwl_combobox.h index a708589d4f..ba5db16f87 100644 --- a/xfa/fwl/lightwidget/cfwl_combobox.h +++ b/xfa/fwl/lightwidget/cfwl_combobox.h @@ -20,6 +20,9 @@ class CFWL_ComboBoxItem; class CFWL_ComboBox : public CFWL_Widget { public: + CFWL_ComboBox(); + ~CFWL_ComboBox() override; + static CFWL_ComboBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); int32_t AddString(const CFX_WideStringC& wsText); @@ -65,58 +68,59 @@ class CFWL_ComboBox : public CFWL_Widget { FWL_Error GetBBox(CFX_RectF& rect); FWL_Error EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); - CFWL_ComboBox(); - virtual ~CFWL_ComboBox(); protected: class CFWL_ComboBoxDP : public IFWL_ComboBoxDP { public: CFWL_ComboBoxDP(); - ~CFWL_ComboBoxDP(); - virtual FWL_Error GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption) { - return FWL_Error::Succeeded; - } - - virtual int32_t CountItems(IFWL_Widget* pWidget); - virtual IFWL_ListItem* GetItem(IFWL_Widget* pWidget, int32_t nIndex); - virtual int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem); - virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - int32_t nIndex); - - virtual uint32_t GetItemStyles(IFWL_Widget* pWidget, IFWL_ListItem* pItem); - virtual FWL_Error GetItemText(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - CFX_WideString& wsText); - virtual FWL_Error GetItemRect(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - CFX_RectF& rtItem); - virtual void* GetItemData(IFWL_Widget* pWidget, IFWL_ListItem* pItem); - virtual FWL_Error SetItemStyles(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - uint32_t dwStyle); - virtual FWL_Error SetItemText(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - const FX_WCHAR* pszText); - virtual FWL_Error SetItemRect(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - const CFX_RectF& rtItem); - virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, - IFWL_ListItem* pItem); - virtual FWL_Error GetItemCheckRect(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - CFX_RectF& rtCheck); - virtual FWL_Error SetItemCheckRect(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - const CFX_RectF& rtCheck); - virtual uint32_t GetItemCheckState(IFWL_Widget* pWidget, - IFWL_ListItem* pItem); - virtual FWL_Error SetItemCheckState(IFWL_Widget* pWidget, - IFWL_ListItem* pItem, - uint32_t dwCheckState); - virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget); + ~CFWL_ComboBoxDP() override; + + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + + // IFWL_ListBoxDP + int32_t CountItems(IFWL_Widget* pWidget) override; + IFWL_ListItem* GetItem(IFWL_Widget* pWidget, int32_t nIndex) override; + int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; + FX_BOOL SetItemIndex(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + int32_t nIndex) override; + + uint32_t GetItemStyles(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; + FWL_Error GetItemText(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + CFX_WideString& wsText) override; + FWL_Error GetItemRect(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + CFX_RectF& rtItem) override; + void* GetItemData(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; + FWL_Error SetItemStyles(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + uint32_t dwStyle) override; + FWL_Error SetItemText(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + const FX_WCHAR* pszText) override; + FWL_Error SetItemRect(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + const CFX_RectF& rtItem) override; + FX_FLOAT GetItemHeight(IFWL_Widget* pWidget) override; + CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, + IFWL_ListItem* pItem) override; + FWL_Error GetItemCheckRect(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + CFX_RectF& rtCheck) override; + FWL_Error SetItemCheckRect(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + const CFX_RectF& rtCheck) override; + uint32_t GetItemCheckState(IFWL_Widget* pWidget, + IFWL_ListItem* pItem) override; + FWL_Error SetItemCheckState(IFWL_Widget* pWidget, + IFWL_ListItem* pItem, + uint32_t dwCheckState) override; + + // IFWL_ComboBoxDP + FX_FLOAT GetListHeight(IFWL_Widget* pWidget) override; std::vector<std::unique_ptr<CFWL_ComboBoxItem>> m_ItemArray; FX_FLOAT m_fMaxListHeight; @@ -127,7 +131,8 @@ class CFWL_ComboBox : public CFWL_Widget { class CFWL_ComboBoxItem : public IFWL_ListItem { public: - CFWL_ComboBoxItem() : m_pDIB(nullptr), m_pData(nullptr) {} + CFWL_ComboBoxItem(); + ~CFWL_ComboBoxItem(); CFX_RectF m_rtItem; uint32_t m_dwStyles; diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.h b/xfa/fwl/lightwidget/cfwl_datetimepicker.h index b4349d0cb0..2fa385fede 100644 --- a/xfa/fwl/lightwidget/cfwl_datetimepicker.h +++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.h @@ -13,6 +13,7 @@ class CFWL_DateTimePicker : public CFWL_Widget { public: static CFWL_DateTimePicker* Create(); + FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); FWL_Error GetEditText(CFX_WideString& wsText); @@ -40,22 +41,28 @@ class CFWL_DateTimePicker : public CFWL_Widget { uint32_t dwStylesExRemoved); protected: - CFWL_DateTimePicker(); - virtual ~CFWL_DateTimePicker(); class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP { public: CFWL_DateTimePickerDP(); - virtual FWL_Error GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption); - virtual FWL_Error GetToday(IFWL_Widget* pWidget, - int32_t& iYear, - int32_t& iMonth, - int32_t& iDay); + + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + + // IFWL_DateTimePickerDP + FWL_Error GetToday(IFWL_Widget* pWidget, + int32_t& iYear, + int32_t& iMonth, + int32_t& iDay) override; int32_t m_iYear; int32_t m_iMonth; int32_t m_iDay; CFX_WideString m_wsData; }; + + CFWL_DateTimePicker(); + ~CFWL_DateTimePicker() override; + CFWL_DateTimePickerDP m_DateTimePickerDP; }; diff --git a/xfa/fwl/lightwidget/cfwl_edit.h b/xfa/fwl/lightwidget/cfwl_edit.h index 349b380670..a9c058a514 100644 --- a/xfa/fwl/lightwidget/cfwl_edit.h +++ b/xfa/fwl/lightwidget/cfwl_edit.h @@ -16,6 +16,9 @@ class IFDE_TxtEdtDoRecord; class CFWL_Edit : public CFWL_Widget { public: + CFWL_Edit(); + ~CFWL_Edit() override; + static CFWL_Edit* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); FWL_Error SetText(const CFX_WideString& wsText); @@ -60,8 +63,6 @@ class CFWL_Edit : public CFWL_Widget { std::vector<CFX_ByteString>& sSuggest); FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, const CFX_ByteStringC& bsReplace); - CFWL_Edit(); - virtual ~CFWL_Edit(); }; #endif // XFA_FWL_LIGHTWIDGET_CFWL_EDIT_H_ diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp index d51db44f3b..be6a6b1249 100644 --- a/xfa/fwl/lightwidget/cfwl_listbox.cpp +++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp @@ -341,3 +341,15 @@ FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckState( static_cast<CFWL_ListItem*>(pItem)->m_dwCheckState = dwCheckState; return FWL_Error::Succeeded; } + +CFWL_ListItem::CFWL_ListItem() { + m_rtItem.Reset(); + m_dwStates = 0; + m_wsText = L""; + m_pDIB = NULL; + m_pData = NULL; + m_dwCheckState = 0; + m_rtCheckBox.Reset(); +} + +CFWL_ListItem::~CFWL_ListItem() {} diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h index 7d79893fa6..c684015b61 100644 --- a/xfa/fwl/lightwidget/cfwl_listbox.h +++ b/xfa/fwl/lightwidget/cfwl_listbox.h @@ -19,6 +19,9 @@ class CFWL_ListItem; class CFWL_ListBox : public CFWL_Widget { public: + CFWL_ListBox(); + ~CFWL_ListBox() override; + static CFWL_ListBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem); @@ -43,14 +46,12 @@ class CFWL_ListBox : public CFWL_Widget { void* GetItemData(IFWL_ListItem* pItem); IFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); uint32_t GetItemStates(IFWL_ListItem* pItem); - CFWL_ListBox(); - virtual ~CFWL_ListBox(); protected: class CFWL_ListBoxDP : public IFWL_ListBoxDP { public: CFWL_ListBoxDP(); - ~CFWL_ListBoxDP(); + ~CFWL_ListBoxDP() override; // IFWL_DataProvider: FWL_Error GetCaption(IFWL_Widget* pWidget, @@ -105,15 +106,9 @@ class CFWL_ListBox : public CFWL_Widget { class CFWL_ListItem : public IFWL_ListItem { public: - CFWL_ListItem() { - m_rtItem.Reset(); - m_dwStates = 0; - m_wsText = L""; - m_pDIB = NULL; - m_pData = NULL; - m_dwCheckState = 0; - m_rtCheckBox.Reset(); - } + CFWL_ListItem(); + ~CFWL_ListItem(); + CFX_RectF m_rtItem; uint32_t m_dwStates; CFX_WideString m_wsText; diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.cpp b/xfa/fwl/lightwidget/cfwl_picturebox.cpp index f3f52ab993..33b11cd8b5 100644 --- a/xfa/fwl/lightwidget/cfwl_picturebox.cpp +++ b/xfa/fwl/lightwidget/cfwl_picturebox.cpp @@ -97,6 +97,16 @@ CFWL_PictureBox::CFWL_PictureBox() {} CFWL_PictureBox::~CFWL_PictureBox() {} +CFWL_PictureBox::CFWL_PictureBoxDP::CFWL_PictureBoxDP() + : m_pBitmap(nullptr), + m_iOpacity(0), + m_iFlipMode(0), + m_fRotation(0.0f), + m_fScaleX(1.0f), + m_fScaleY(1.0f), + m_fOffSetX(0.0f), + m_fOffSetY(0.0f) {} + FWL_Error CFWL_PictureBox::CFWL_PictureBoxDP::GetCaption( IFWL_Widget* pWidget, CFX_WideString& wsCaption) { diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.h b/xfa/fwl/lightwidget/cfwl_picturebox.h index 8b0b13de24..95a0117224 100644 --- a/xfa/fwl/lightwidget/cfwl_picturebox.h +++ b/xfa/fwl/lightwidget/cfwl_picturebox.h @@ -13,7 +13,11 @@ class CFWL_PictureBox : public CFWL_Widget { public: + CFWL_PictureBox(); + ~CFWL_PictureBox() override; + static CFWL_PictureBox* Create(); + FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); CFX_DIBitmap* GetPicture(); FWL_Error SetPicture(CFX_DIBitmap* pBitmap); @@ -27,28 +31,24 @@ class CFWL_PictureBox : public CFWL_Widget { FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy); - CFWL_PictureBox(); - virtual ~CFWL_PictureBox(); protected: class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { public: - CFWL_PictureBoxDP() { - m_fRotation = 0.0f; - m_fScaleX = 1.0f; - m_fScaleY = 1.0f; - m_fOffSetX = 0.0f; - m_fOffSetY = 0.0f; - m_pBitmap = NULL; - } - virtual FWL_Error GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption); - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget); - virtual int32_t GetOpacity(IFWL_Widget* pWidget); - virtual int32_t GetFlipMode(IFWL_Widget* pWidget); - virtual FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); + CFWL_PictureBoxDP(); + + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + + // IFWL_PictureBoxDP + CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) override; + CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) override; + CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) override; + int32_t GetOpacity(IFWL_Widget* pWidget) override; + int32_t GetFlipMode(IFWL_Widget* pWidget) override; + FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; + CFX_DIBitmap* m_pBitmap; int32_t m_iOpacity; int32_t m_iFlipMode; @@ -59,6 +59,7 @@ class CFWL_PictureBox : public CFWL_Widget { FX_FLOAT m_fOffSetY; CFX_WideString m_wsData; }; + CFWL_PictureBoxDP m_PictureBoxDP; }; diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.h b/xfa/fwl/lightwidget/cfwl_pushbutton.h index 5ca3dded37..145f5ed6f0 100644 --- a/xfa/fwl/lightwidget/cfwl_pushbutton.h +++ b/xfa/fwl/lightwidget/cfwl_pushbutton.h @@ -12,24 +12,33 @@ class CFWL_PushButton : public CFWL_Widget { public: + CFWL_PushButton(); + ~CFWL_PushButton() override; + static CFWL_PushButton* Create(); + FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); FWL_Error GetCaption(CFX_WideString& wsCaption); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); CFX_DIBitmap* GetPicture(); FWL_Error SetPicture(CFX_DIBitmap* pBitmap); - CFWL_PushButton(); - virtual ~CFWL_PushButton(); protected: class CFWL_PushButtonDP : public IFWL_PushButtonDP { public: CFWL_PushButtonDP() : m_pBitmap(NULL) {} - FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); + + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + + // IFWL_PushButtonDP + CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) override; + CFX_WideString m_wsCaption; CFX_DIBitmap* m_pBitmap; }; + CFWL_PushButtonDP m_buttonData; }; diff --git a/xfa/fwl/lightwidget/cfwl_widgetproperties.cpp b/xfa/fwl/lightwidget/cfwl_widgetproperties.cpp index 9afa1b6959..31e1dda687 100644 --- a/xfa/fwl/lightwidget/cfwl_widgetproperties.cpp +++ b/xfa/fwl/lightwidget/cfwl_widgetproperties.cpp @@ -8,6 +8,20 @@ #include "xfa/fwl/lightwidget/cfwl_widget.h" +CFWL_WidgetProperties::CFWL_WidgetProperties() + : m_dwStyles(FWL_WGTSTYLE_Child), + m_dwStyleExes(0), + m_dwStates(0), + m_pParent(nullptr), + m_pOwner(nullptr) { + m_rtWidget.Set(0, 0, 0, 0); +} + +CFWL_WidgetProperties::~CFWL_WidgetProperties() {} + +CFWL_WidgetProperties::CFWL_WidgetProperties( + const CFWL_WidgetProperties& other) = default; + CFWL_WidgetImpProperties CFWL_WidgetProperties::MakeWidgetImpProperties( IFWL_DataProvider* pDataProvider) const { CFWL_WidgetImpProperties result; diff --git a/xfa/fwl/lightwidget/cfwl_widgetproperties.h b/xfa/fwl/lightwidget/cfwl_widgetproperties.h index 2a3e3ffefb..5d4116e62d 100644 --- a/xfa/fwl/lightwidget/cfwl_widgetproperties.h +++ b/xfa/fwl/lightwidget/cfwl_widgetproperties.h @@ -17,14 +17,9 @@ class IFWL_DataProvider; class CFWL_WidgetProperties { public: - CFWL_WidgetProperties() - : m_dwStyles(FWL_WGTSTYLE_Child), - m_dwStyleExes(0), - m_dwStates(0), - m_pParent(nullptr), - m_pOwner(nullptr) { - m_rtWidget.Set(0, 0, 0, 0); - } + CFWL_WidgetProperties(); + ~CFWL_WidgetProperties(); + CFWL_WidgetProperties(const CFWL_WidgetProperties& other); CFWL_WidgetImpProperties MakeWidgetImpProperties( IFWL_DataProvider* pDataProvider) const; |