FLImaging 6.8.12.1
GUIPropertyItemSliderDualHandle.h
1#pragma once
2#include "GUIPropertyItemSliderBase.h"
3
11
13namespace FLImaging
14{
16 namespace GUI
17 {
18 class CGUISliderOwnerDrawnBase;
19
28 {
29 friend class CGUIPropertyGridPropertySliderDualHandle;
30
31 public:
42
50
66 virtual bool SetPropertyCallbackMin(CPropertyCallback* pFunc, bool bAutoDestroy = true);
67
79 virtual CPropertyCallback* GetPropertyCallbackMin() const;
80
96 virtual bool SetPropertyCallbackMax(CPropertyCallback* pFunc, bool bAutoDestroy = true);
97
109 virtual CPropertyCallback* GetPropertyCallbackMax() const;
110
124 virtual bool SetValueMin(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true);
125
150 virtual bool SetValueMin(Base::CFLString<wchar_t> strValue, bool bInvokeCallback, bool bRedraw);
151
165 virtual bool SetValueMax(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true);
166
191 virtual bool SetValueMax(Base::CFLString<wchar_t> strValue, bool bInvokeCallback, bool bRedraw);
192
208 virtual bool SetValue(Base::CFLString<wchar_t> strValueMin, Base::CFLString<wchar_t> strValueMax, bool bInvokeCallback = true);
209
227 virtual bool SetValue(Base::CFLString<wchar_t> strValueMin, Base::CFLString<wchar_t> strValueMax, bool bInvokeCallback, bool bRedraw);
228
240 virtual bool SetBufferValueMin(const Base::CFLString<wchar_t>& strValue);
241
253 virtual bool SetBufferValueMax(const Base::CFLString<wchar_t>& strValue);
254
268 virtual bool SetBufferValue(const Base::CFLString<wchar_t>& strValueMin, const Base::CFLString<wchar_t>& strValueMax);
269
280
291 virtual void GetValue(Base::CFLString<wchar_t>& strMin, Base::CFLString<wchar_t>& strMax) const;
292
303
314
325
336
348 virtual bool SetOrigValueMin(const Base::CFLString<wchar_t>& strValue);
349
361 virtual bool SetOrigValueMax(const Base::CFLString<wchar_t>& strValue);
362
372 virtual void SetDefaultValueMin(const Base::CFLString<wchar_t>& strDefaultValue);
373
383 virtual void SetDefaultValueMax(const Base::CFLString<wchar_t>& strDefaultValue);
384
396 virtual void SetDefaultValue(const Base::CFLString<wchar_t>& strDefaultValueMin, const Base::CFLString<wchar_t>& strDefaultValueMax);
397
408
419
429 virtual void ShowSlider(bool bShow);
430
440 virtual bool IsSliderVisible() const;
441
453 virtual void SetLabel(const Base::CFLString<wchar_t>& strMinLabel, const Base::CFLString<wchar_t>& strMaxLabel);
454
464 virtual void SetMinLabel(const Base::CFLString<wchar_t>& strLabel);
465
475 virtual void SetMaxLabel(const Base::CFLString<wchar_t>& strLabel);
476
487
498
510 virtual void SetLabelRatio(float f32MinRatio = 0.f, float f32MaxRatio = 0.f);
511
521 virtual void SetMinLabelRatio(float f32Ratio = 0.f);
522
532 virtual void SetMaxLabelRatio(float f32Ratio = 0.f);
533
543 virtual float GetMinLabelRatio() const;
544
554 virtual float GetMaxLabelRatio() const;
555
567 virtual const CResult SetHandleSlideTogether(bool bSet = true);
568
579 virtual bool IsHandleSlidingTogether() const;
580
590 virtual void ShowSpinControl(bool bShow = true);
591
601 virtual bool IsSpinControlVisible() const;
602
603 virtual void SetRange(int32_t i32Min, int32_t i32Max) override;
604 virtual void SetRange(uint32_t u32Min, uint32_t u32Max) override;
605 virtual void SetRange(int64_t i64Min, int64_t i64Max) override;
606 virtual void SetRange(uint64_t u64Min, uint64_t u64Max) override;
607 virtual void SetRange(double f64Min, double f64Max) override;
608 virtual void SetRange(double f64Min, double f64Max, double f64Unit) override;
609 virtual void SetRange(double f64Min, double f64Max, double f64Unit, uint8_t u8DecimalPlace) override;
610
611 virtual void Invalidate() override;
612
613 virtual CMFCPropertyGridProperty* CreateGridProperty() override;
614 virtual bool Save(const Base::CFLString<wchar_t>& strFilePath) const override;
615 virtual bool Save(Base::CFLArray<Base::CFLString<wchar_t>>& flaData) const override;
616 virtual bool Load(const Base::CFLString<wchar_t>& strFilePath) override;
617 virtual bool Load(const Base::CFLArray<Base::CFLString<wchar_t>>& flaData) override;
618
619 private:
620 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
621 virtual bool SetBufferValue(Base::CFLString<wchar_t> strValue) override;
622 virtual Base::CFLString<wchar_t> GetValue() const override;
623 virtual Base::CFLString<wchar_t> GetBufferValue() const override;
624 virtual Base::CFLString<wchar_t> GetPrevBufferValue() const override;
625 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
626 virtual void SetDefaultValue(const Base::CFLString<wchar_t>& strDefaultValue) override;
627 virtual Base::CFLString<wchar_t> GetDefaultValue() const override;
628 virtual bool SetPropertyCallback(CPropertyCallback* pFunc, bool bAutoDestroy = true)override;
629 virtual CPropertyCallback* GetPropertyCallback() const override;
630 virtual void InternalOnAfterSetRange();
631
632 virtual void InternalSetValueMin(const COleVariant& varValue, bool bRedrawImmediate);
633 virtual void InternalSetValueMax(const COleVariant& varValue, bool bRedrawImmediate);
634 virtual void InternalSetOrigValueMin(const COleVariant& varValue);
635 virtual void InternalSetOrigValueMax(const COleVariant& varValue);
636
637 virtual bool AdjustAndSetValueMinFromString(Base::CFLString<wchar_t>& strValue);
638 virtual bool AdjustAndSetValueMaxFromString(Base::CFLString<wchar_t>& strValue);
639 protected:
640 SVariant m_varValueMin;
641 SVariant m_varValueMax;
642
643 Base::CFLString<wchar_t> m_strDefaultValueMin;
644 Base::CFLString<wchar_t> m_strDefaultValueMax;
645
646 Base::CFLString<wchar_t> m_strInitialValueMin;
647 Base::CFLString<wchar_t> m_strInitialValueMax;
648
649 Base::CFLString<wchar_t> m_strBufferValueMin;
650 Base::CFLString<wchar_t> m_strBufferValueMax;
651
652 Base::CFLString<wchar_t> m_strPrevBufferValueMin;
653 Base::CFLString<wchar_t> m_strPrevBufferValueMax;
654
655 Base::CFLString<wchar_t> m_strLabelMin;
656 Base::CFLString<wchar_t> m_strLabelMax;
657
658 bool m_bDrawSlider;
659 bool m_bShowSpinCtrl;
660 bool m_bHandleSlidingTogether;
661 float m_f32LabelMinRatio;
662 float m_f32LabelMaxRatio;
663
664 CPropertyCallback* m_pPropertyCallbackMin;
665 CPropertyCallback* m_pPropertyCallbackMax;
666 bool m_bPropertyCallbackMinAutoDestroy;
667 bool m_bPropertyCallbackMaxAutoDestroy;
668 };
669 }
670}
671
Template type array class.
Definition FLArray.h:53
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1596
CGUIPropertyItemSliderBase(ESliderTemplateType eTemplateType)
Constructor for CGUIPropertyItemSliderBase class.
virtual void ShowSlider(bool bShow)
Sets whether the slider is visible or not.
virtual void SetRange(uint32_t u32Min, uint32_t u32Max) override
Sets the range for the slider.
virtual void SetRange(double f64Min, double f64Max) override
Sets the range for the slider.
virtual bool IsSpinControlVisible() const
Checks whether the spin control is currently visible.
virtual bool SetPropertyCallbackMin(CPropertyCallback *pFunc, bool bAutoDestroy=true)
Sets the callback function to be executed when the minimum value is set.
virtual bool SetPropertyCallbackMax(CPropertyCallback *pFunc, bool bAutoDestroy=true)
Sets the callback function to be executed when the maximum value is set.
virtual bool SetOrigValueMax(const Base::CFLString< wchar_t > &strValue)
Sets the original maximum value of this.
virtual Base::CFLString< wchar_t > GetValueMin() const
Retrieves the minimum value of this.
virtual void Invalidate() override
Invalidates the area corresponding to this on the screen, forcing a redraw.
virtual ~CGUIPropertyItemSliderDualHandle()
Destructor for CGUIPropertyItemSliderDualHandle class.
virtual float GetMinLabelRatio() const
Retrieves the label ratio for the minimum value of the slider.
virtual bool SetValue(Base::CFLString< wchar_t > strValueMin, Base::CFLString< wchar_t > strValueMax, bool bInvokeCallback=true)
Sets the minimum and maximum value for the slider from a string.
virtual bool Save(Base::CFLArray< Base::CFLString< wchar_t > > &flaData) const override
Function to record the value of this in INI data array.
CGUIPropertyItemSliderDualHandle(ESliderTemplateType eTemplateType=ESliderTemplateType_Int32)
Constructor for CGUIPropertyItemSliderDualHandle class.
virtual CPropertyCallback * GetPropertyCallbackMin() const
Retrieves the callback function associated with setting the minimum value.
virtual bool SetValueMin(Base::CFLString< wchar_t > strValue, bool bInvokeCallback, bool bRedraw)
Sets the minimum value for the slider from a string.
virtual void SetMinLabel(const Base::CFLString< wchar_t > &strLabel)
Sets the label for the minimum value of the slider.
virtual void SetMaxLabelRatio(float f32Ratio=0.f)
Sets the label ratio for the maximum value of the slider.
virtual void SetMaxLabel(const Base::CFLString< wchar_t > &strLabel)
Sets the label for the maximum value of the slider.
virtual void SetRange(double f64Min, double f64Max, double f64Unit) override
Sets the range of the slider and the incremental value per step.
virtual Base::CFLString< wchar_t > GetMinLabel() const
Retrieves the label for the minimum value of the slider.
virtual void SetDefaultValue(const Base::CFLString< wchar_t > &strDefaultValueMin, const Base::CFLString< wchar_t > &strDefaultValueMax)
Sets the default maximum value of this.
virtual Base::CFLString< wchar_t > GetMaxLabel() const
Retrieves the label for the maximum value of the slider.
virtual Base::CFLString< wchar_t > GetBufferValueMin() const
Retrieves the minimum buffer value of this.
virtual bool SetBufferValue(const Base::CFLString< wchar_t > &strValueMin, const Base::CFLString< wchar_t > &strValueMax)
Sets the minimum and maximum buffer value of this.
virtual bool Save(const Base::CFLString< wchar_t > &strFilePath) const override
Saves the value of this to an ini file.
virtual void SetLabelRatio(float f32MinRatio=0.f, float f32MaxRatio=0.f)
Sets the label ratios for the minimum and maximum values of the slider.
virtual bool Load(const Base::CFLArray< Base::CFLString< wchar_t > > &flaData) override
Loads the value of this from a string array.
virtual Base::CFLString< wchar_t > GetValueMax() const
Retrieves the maximum value of this.
virtual Base::CFLString< wchar_t > GetPrevBufferValueMin() const
Retrieves the previous minimum buffer value of this.
virtual bool SetBufferValueMin(const Base::CFLString< wchar_t > &strValue)
Sets the minimum buffer value of this.
virtual bool SetValueMax(Base::CFLString< wchar_t > strValue, bool bInvokeCallback, bool bRedraw)
Sets the maximum value for the slider from a string.
virtual bool IsHandleSlidingTogether() const
Returns whether the slider handles (thumbs) move together upon collision or stop at their positions.
virtual void SetMinLabelRatio(float f32Ratio=0.f)
Sets the label ratio for the minimum value of the slider.
virtual bool SetValueMin(Base::CFLString< wchar_t > strValue, bool bInvokeCallback=true)
Sets the minimum value for the slider from a string.
virtual bool IsSliderVisible() const
Retrieves whether the slider is visible or not.
virtual void SetLabel(const Base::CFLString< wchar_t > &strMinLabel, const Base::CFLString< wchar_t > &strMaxLabel)
Sets the labels for the minimum and maximum values of the slider.
virtual const CResult SetHandleSlideTogether(bool bSet=true)
Sets whether the slider handles (thumbs) should stop upon collision or move together....
virtual bool SetValueMax(Base::CFLString< wchar_t > strValue, bool bInvokeCallback=true)
Sets the maximum value for the slider from a string.
virtual void SetRange(int64_t i64Min, int64_t i64Max) override
Sets the range for the slider.
virtual Base::CFLString< wchar_t > GetDefaultValueMax() const
Retrieves the default maximum value of this.
virtual void SetDefaultValueMin(const Base::CFLString< wchar_t > &strDefaultValue)
Sets the default minimum value of this.
virtual CMFCPropertyGridProperty * CreateGridProperty() override
Creates and returns a new grid property associated with this.
virtual void SetDefaultValueMax(const Base::CFLString< wchar_t > &strDefaultValue)
Sets the default maximum value of this.
virtual void SetRange(double f64Min, double f64Max, double f64Unit, uint8_t u8DecimalPlace) override
Sets the range of the slider, the incremental value per step, and the number of decimal places to dis...
virtual bool Load(const Base::CFLString< wchar_t > &strFilePath) override
Loads the value of this from an ini file.
virtual Base::CFLString< wchar_t > GetDefaultValueMin() const
Retrieves the default minimum value of this.
virtual void ShowSpinControl(bool bShow=true)
Shows or hides the spin control next to the edit control.
virtual bool SetValue(Base::CFLString< wchar_t > strValueMin, Base::CFLString< wchar_t > strValueMax, bool bInvokeCallback, bool bRedraw)
Sets the minimum and maximum value for the slider from a string.
virtual void SetRange(int32_t i32Min, int32_t i32Max) override
Sets the range for the slider.
virtual float GetMaxLabelRatio() const
Retrieves the label ratio for the maximum value of the slider.
virtual CPropertyCallback * GetPropertyCallbackMax() const
Retrieves the callback function associated with setting the maximum value.
virtual void SetRange(uint64_t u64Min, uint64_t u64Max) override
Sets the range for the slider.
virtual bool SetOrigValueMin(const Base::CFLString< wchar_t > &strValue)
Sets the original minimum value of this.
virtual bool SetBufferValueMax(const Base::CFLString< wchar_t > &strValue)
Sets the maximum buffer value of this.
virtual Base::CFLString< wchar_t > GetBufferValueMax() const
Retrieves the maximum buffer value of this.
virtual Base::CFLString< wchar_t > GetPrevBufferValueMax() const
Retrieves the previous maximum buffer value of this.
Definition D2DObject.h:12
ESliderTemplateType
Template type of slider.
Definition DefinitionsGUI.h:10297
@ ESliderTemplateType_Int32
Definition DefinitionsGUI.h:10302