FLImaging 6.10.22.1
GUIPropertyGridCtrl.h
1#pragma once
9
10#include <vector>
11#include <unordered_map>
12#include "DefinitionsGUI.h"
13
14#define AFX_STRETCH_DELTA 2
15
17namespace FLImaging
18{
20 namespace GUI
21 {
22 class CGUIMainFrame;
23 class CGUIPaneProperties;
26 class CGUIPropertyGridPropertyDropdownList;
27 class CGUIPropertyGridPropertyViewGraphList;
28 class CGUIPropertyGridPropertyViewImageList;
29 class CGUIPropertyGridPropertyView3DList;
30 class CGUIPropertyGridPropertyBase;
31 class CGUIPropertyGridToolTipCtrl;
32 class CGUIPropertyGridPropertyCategory;
33 class CGUIPropertyGridPropertyRadioButtonGroup;
34 class CGUIPropertyGridPropertyRadioButton;
35 class CGUIPropertyGridPropertySliderDualHandle;
36 class CGUIScrollBarOwnerDrawn;
37
50 class FL_EXPORT CGUIPropertyGridCtrl : public CMFCPropertyGridCtrl, public Base::CFLBase
51 {
52 friend class CGUIPropertyGridPropertySliderDualHandle;
53 friend class CGUIPropertyGridPropertySlider;
54 friend class CGUIPropertyGridPropertyDraggableSpin;
55 friend class CGUIDialogPropertyImageFigureDrawingAttribute;
56 public:
69
82
93 virtual void AdjustLayout() override;
94
110
121 virtual void AdjustLayoutAsync();
122
134 void GetPropertyByVisibleOrder(std::vector<CMFCPropertyGridProperty*>& vctProps, CMFCPropertyGridProperty* pParent = nullptr) const;
135
147 virtual void SetParentPane(CGUIPaneProperties* pParentPane);
148
160 virtual CGUIPaneProperties* GetParentPane() const;
161
171 virtual void SetLeftColumnWidth(int32_t i32LeftColumnWidth);
172
182 virtual COLORREF GetCustomColorGroupText() const;
183
193 virtual void SetCustomColorGroupText(COLORREF color);
194
204 virtual COLORREF GetCustomColorGroupBackground() const;
205
215 virtual void SetCustomColorGroupBackground(COLORREF color);
216
217
218 DeclareGetClassType();
219
220 public:
221 virtual CMFCPropertyGridProperty* HitTest(CPoint pt, CMFCPropertyGridProperty::ClickArea* pnArea = NULL, BOOL bPropsOnly = FALSE) const;
222 virtual BOOL DeleteProperty(CMFCPropertyGridProperty*& pProp, BOOL bRedraw = TRUE, BOOL bAdjustLayout = TRUE);
223 void EnsureVisible(CMFCPropertyGridProperty* pProp, BOOL bExpandParents = FALSE);
224 virtual void SetAlphabeticMode(BOOL bSet = TRUE);
225
226 virtual void SetParentMainFrame(CGUIMainFrame* pMainFrame);
227 virtual CGUIMainFrame* GetParentMainFrame() const;
228
229 virtual const CGUIScrollBarOwnerDrawn* GetOwnerDrawScrollBar(EOrientation eOrientation = EOrientation_Vertical) const;
230 virtual int GetTotalItemsWithExtraRows(BOOL bIncludeHidden = TRUE) const;
231
232 void SetFontBold(HFONT hfont);
233 void SetFont(HFONT hfont);
234 virtual CFont* GetFontBold();
235
236 protected:
237 virtual void AddPendingUpdateValue(const CMFCPropertyGridProperty* pPGP, const COleVariant& var);
238 virtual void AddPendingUpdateValueMin(const CGUIPropertyGridPropertySliderDualHandle* pPGP, const COleVariant& var);
239 virtual void AddPendingUpdateValueMax(const CGUIPropertyGridPropertySliderDualHandle* pPGP, const COleVariant& var);
240 virtual const CResult GetPendingUpdateValue(const CMFCPropertyGridProperty* pPGP, COleVariant& varRes) const;
241 virtual const CResult GetPendingUpdateValueMin(const CGUIPropertyGridPropertySliderDualHandle* pPGP, COleVariant& varRes) const;
242 virtual const CResult GetPendingUpdateValueMax(const CGUIPropertyGridPropertySliderDualHandle* pPGP, COleVariant& varRes) const;
243 virtual void AddPendingUpdateVisibility(const CMFCPropertyGridProperty* pPGP, bool bVisibility);
244 virtual const CResult GetPendingUpdateVisibility(const CMFCPropertyGridProperty* pPGP, bool& bVisibility) const;
245
246 virtual int OnDrawProperty(CDC* pDC, CMFCPropertyGridProperty* pProp) const override;
247 virtual int OnDrawProperty(CDC* pDC, CGUIPropertyGridPropertyCategory* pPropCat) const;
248 virtual int OnDrawProperty(CDC* pDC, CGUIPropertyGridPropertyRadioButtonGroup* pPropRBG) const;
249 virtual int OnDrawProperty(CDC* pDC, CGUIPropertyGridPropertyRadioButton* pPropRB) const;
250 static void OnDrawComboDropButton(CDC* pDC, CRect rect, BOOL bDisabled, BOOL bDropped, BOOL bHighlighted, CMFCToolBarComboBoxButton* pButton);
251 static void OnDrawButtonBorder(CDC* pDC, CMFCToolBarButton* pButton, CRect rect, CMFCVisualManager::AFX_BUTTON_STATE state);
252 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
253 virtual CList<CMFCPropertyGridProperty*, CMFCPropertyGridProperty*>* GetTopLevelProperties();
254
255 virtual void SetScrollSizes();
256 virtual void ReposProperties();
257
258 private:
259 void RecursivelySetPropertySliderWidth(CMFCPropertyGridProperty* pParent = nullptr);
260
261 protected:
262 CMFCPropertyGridProperty* m_pPropLButtonDown;
263 Base::TPoint<int32_t> m_tpPrev;
264 CGUIPaneProperties* m_pParentPane;
265 CGUIMainFrame* m_pParentMainFrame;
266 CGUIPropertyGridPropertyBase* m_pPropertyPrevHit;
267 CGUIPropertyGridToolTipCtrl* m_pIPToolTip;
268 CGUIScrollBarOwnerDrawn* m_pOwnerDrawScrollBarVert;
269 CGUIScrollBarOwnerDrawn* m_pOwnerDrawScrollBarHorz;
270 std::unordered_map<CMFCPropertyGridProperty*, COleVariant>& m_mapPendingValue;
271 std::unordered_map<CGUIPropertyGridPropertySliderDualHandle*, COleVariant>& m_mapPendingValueMin;
272 std::unordered_map<CGUIPropertyGridPropertySliderDualHandle*, COleVariant>& m_mapPendingValueMax;
273 std::unordered_map<CMFCPropertyGridProperty*, bool>& m_mapPendingVisibility;
274
275 bool m_bPropertySliderDeprecatedExists;
276 CBrush m_brBrush;
277
278 friend class CGUIManagerPane;
279 friend class CGUIPaneProperties;
280 friend class CGUIMenuItemProperty;
281 friend class CGUIPropertyGridPropertyDropdownList;
282 friend class CGUIPropertyGridPropertyViewListBase;
283 friend class CGUIPropertyGridPropertyBase;
284 friend class CGUIPropertyGridPropertyColor;
285 friend class CGUIPropertyItemRadioButton;
286 friend class CGUIPropertyItemSliderDualHandle;
287 friend class CGUIPropertyItemCheckBox;
288 friend class CGUIPropertyItemCategory;
289 friend class CGUIPropertyItemText;
290 friend class CGUIPropertyItemFont;
291 friend class CGUIPropertyItemBase;
292 friend class CGUIPropertyItemRadioButtonGroup;
293 friend class CGUIDialogProperty;
294 friend class CGUIDialogLicenseFeatures;
295
296 public:
297 DECLARE_MESSAGE_MAP()
298 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
299 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
300 afx_msg void OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt);
301 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
302 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
303 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
304 afx_msg void OnSetFocus(CWnd* pOldWnd);
305 afx_msg void OnKillFocus(CWnd* pNewWnd);
306 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
307 afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
308 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
309 virtual void PreSubclassWindow();
310 virtual BOOL PreTranslateMessage(MSG* pMsg);
311 afx_msg void OnEnable(BOOL bEnable);
312 afx_msg void OnCancelMode();
313 afx_msg void OnDestroy();
314 LRESULT OnScrollBarPosChanged(WPARAM wParam, LPARAM lParam);
315 LRESULT OnSliderOwnerDrawnPosChanged(WPARAM wParam, LPARAM lParam);
316 LRESULT OnSliderOwnerDrawnRedraw(WPARAM wParam, LPARAM lParam);
317 afx_msg BOOL OnNeedTipText(UINT id, NMHDR* pNMH, LRESULT* pResult);
318 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
319 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
320 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
321 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
322 afx_msg void OnHeaderItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
323 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
324
325 void TrackToolTip(CPoint pt);
326 virtual void Init() override;
327 virtual void OnDraw(CDC* pDC) override;
328 virtual void OnClickButton(CPoint point) override;
329};
330 }
331}
Broadcast message class.
Definition BroadcastMessage.h:27
Top-level base class of FLImaging.
Definition FLBase.h:36
Simplified class representing a point.
Definition TPoint.h:37
FLImaging module execution result object.
Definition ResultsDef.h:1631
The menu item class associated with the property pane.
Definition GUIMenuItemProperty.h:48
virtual void SetCustomColorGroupBackground(COLORREF color)
Set custom color for group background.
virtual CGUIPaneProperties * GetParentPane() const
Get parent pane.
virtual COLORREF GetCustomColorGroupText() const
Get custom color for group text.
virtual void SetParentPane(CGUIPaneProperties *pParentPane)
Set parent pane.
virtual void OnReceiveBroadcast(const Base::CBroadcastMessage *pMessage) override
Callback function. A function that receives a BroadcastMessage.
virtual void AdjustLayoutAsync()
Adjusts the control's layout.(Asynchronous function) This function should be called only when there a...
virtual bool AdjustLayoutForVisibility()
Used to adjust the control's layout after calling CGUIPropertyItemBase::SetVisible()....
virtual void AdjustLayout() override
Adjusts the control's layout. This function should be called only when there are layout changes,...
virtual COLORREF GetCustomColorGroupBackground() const
Get custom color for group background.
virtual ~CGUIPropertyGridCtrl()
Destructor for the property grid control.
CGUIPropertyGridCtrl()
Default constructor for the property grid control.
void GetPropertyByVisibleOrder(std::vector< CMFCPropertyGridProperty * > &vctProps, CMFCPropertyGridProperty *pParent=nullptr) const
Get properties by their visible order.
virtual void SetLeftColumnWidth(int32_t i32LeftColumnWidth)
Set left column(name area) width.
virtual void SetCustomColorGroupText(COLORREF color)
Set custom color for group text.
Property item base class.
Definition GUIPropertyItemBase.h:345
Definition D2DObject.h:12
EOrientation
Direction.
Definition DefinitionsGUI.h:5807
@ EOrientation_Vertical
a vertical direction
Definition DefinitionsGUI.h:5814