FLImaging 7.10.21.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
80
96 virtual bool SetPropertyCallbackMax(CPropertyCallback* pFunc, bool bAutoDestroy = true);
97
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
615
628
629 virtual void SetRange(int32_t i32Min, int32_t i32Max) override;
630 virtual void SetRange(uint32_t u32Min, uint32_t u32Max) override;
631 virtual void SetRange(int64_t i64Min, int64_t i64Max) override;
632 virtual void SetRange(uint64_t u64Min, uint64_t u64Max) override;
633 virtual void SetRange(double f64Min, double f64Max) override;
634 virtual void SetRange(double f64Min, double f64Max, double f64Unit) override;
635 virtual void SetRange(double f64Min, double f64Max, double f64Unit, uint8_t u8DecimalPlaces) override;
636
637 virtual void Invalidate() override;
638
639 virtual CMFCPropertyGridProperty* CreateGridProperty() override;
640 virtual bool Save(const Base::CFLString<wchar_t>& strFilePath) const override;
641 virtual bool Save(Base::CFLArray<Base::CFLString<wchar_t>>& flaData) const override;
642 virtual bool Load(const Base::CFLString<wchar_t>& strFilePath) override;
643 virtual bool Load(const Base::CFLArray<Base::CFLString<wchar_t>>& flaData) override;
644
645 private:
646 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
647 virtual bool SetBufferValue(Base::CFLString<wchar_t> strValue) override;
648 virtual Base::CFLString<wchar_t> GetValue() const override;
649 virtual Base::CFLString<wchar_t> GetBufferValue() const override;
650 virtual Base::CFLString<wchar_t> GetPrevBufferValue() const override;
651 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
652 virtual void SetDefaultValue(const Base::CFLString<wchar_t>& strDefaultValue) override;
653 virtual Base::CFLString<wchar_t> GetDefaultValue() const override;
654 virtual bool SetPropertyCallback(CPropertyCallback* pFunc, bool bAutoDestroy = true)override;
655 virtual CPropertyCallback* GetPropertyCallback() const override;
656 virtual void InternalOnAfterSetRange();
657
658 virtual void InternalSetValueMin(const COleVariant& varValue, bool bRedrawImmediately);
659 virtual void InternalSetValueMax(const COleVariant& varValue, bool bRedrawImmediately);
660 virtual void InternalSetOrigValueMin(const COleVariant& varValue);
661 virtual void InternalSetOrigValueMax(const COleVariant& varValue);
662
663 virtual bool AdjustAndSetValueMinFromString(Base::CFLString<wchar_t>& strValue);
664 virtual bool AdjustAndSetValueMaxFromString(Base::CFLString<wchar_t>& strValue);
665 protected:
666 SVariant m_varValueMin;
667 SVariant m_varValueMax;
668
669 Base::CFLString<wchar_t> m_strDefaultValueMin;
670 Base::CFLString<wchar_t> m_strDefaultValueMax;
671
672 Base::CFLString<wchar_t> m_strInitialValueMin;
673 Base::CFLString<wchar_t> m_strInitialValueMax;
674
675 Base::CFLString<wchar_t> m_strBufferValueMin;
676 Base::CFLString<wchar_t> m_strBufferValueMax;
677
678 Base::CFLString<wchar_t> m_strPrevBufferValueMin;
679 Base::CFLString<wchar_t> m_strPrevBufferValueMax;
680
681 Base::CFLString<wchar_t> m_strLabelMin;
682 Base::CFLString<wchar_t> m_strLabelMax;
683
684 bool m_bDrawSlider;
685 bool m_bShowSpinCtrl;
686 bool m_bHandleSlidingTogether;
687 float m_f32LabelMinRatio;
688 float m_f32LabelMaxRatio;
689 ESpinButtonLayout m_eSpinButtonLayout;
690
691 CPropertyCallback* m_pPropertyCallbackMin;
692 CPropertyCallback* m_pPropertyCallbackMax;
693 bool m_bPropertyCallbackMinAutoDestroy;
694 bool m_bPropertyCallbackMaxAutoDestroy;
695 };
696 }
697}
698
Template type array class.
Definition FLArray.h:71
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition FLImagingBase/ResultsDef.h:1712
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 void SetSpinButtonLayout(ESpinButtonLayout eSpinButtonLayout=ESpinButtonLayout_Compact)
Sets the layout of the spin control buttons.
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 ESpinButtonLayout GetSpinButtonLayout() const
Gets the layout of the spin control buttons.
virtual void SetRange(double f64Min, double f64Max, double f64Unit, uint8_t u8DecimalPlaces) override
Sets the range of the slider, the incremental value per step, and the number of decimal places to dis...
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
It creates and returns the MFC grid property for this item. If an instance has already been created,...
virtual void SetDefaultValueMax(const Base::CFLString< wchar_t > &strDefaultValue)
Sets the default maximum value of this.
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 FLImagingGUI/DefinitionsGUI.h:14598
@ ESliderTemplateType_Int32
Definition FLImagingGUI/DefinitionsGUI.h:14603
std::function< void(CGUIPropertyItemBase *, Base::CFLString< wchar_t > &, const Base::CFLString< wchar_t > &)> CPropertyCallback
Value-change callback invoked from within SetValue().
Definition GUIPropertyItemBase.h:193
ESpinButtonLayout
Layout of the spin control buttons.
Definition FLImagingGUI/DefinitionsGUI.h:14730
@ ESpinButtonLayout_Compact
Small buttons stacked vertically on the right side of the edit box.
Definition FLImagingGUI/DefinitionsGUI.h:14737