FLImaging 6.7.1.3
GUIEditBase.h
1#pragma once
2
10
11#include <afxwin.h>
12
14namespace FLImaging
15{
17 namespace GUI
18 {
26 class FL_EXPORT CGUIEditBase : public CEdit
27 {
28 public:
39 {
48
57
66
75
84
93
102 };
103
104 public:
112
119 virtual ~CGUIEditBase();
120
132
143 virtual const CResult SetValue(const Base::CFLString<wchar_t>& flstrValue);
144
153 virtual int32_t GetValueAsInt32() const;
154
163 virtual int64_t GetValueAsInt64() const;
164
173 virtual double GetValueAsDouble() const;
174
175 DECLARE_MESSAGE_MAP()
176 public:
183 virtual void OnEditPaste();
184
191 virtual void OnEditCut();
192
193 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
194 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
195 afx_msg void OnDestroy();
196 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
197
198
209 virtual void SetInputType(EInputType eInputType);
210
221 virtual EInputType GetInputType() const;
222
239 virtual void SetUserDefinedInput(Base::CFLString<wchar_t> cstrInvalidCharSet, Base::CFLString<wchar_t> cstrValidCharSet);
240
251 virtual void SetToolTipText(Base::CFLString<wchar_t> cstrToolTipText);
252
253 static void SetBackgroundColor(COLORREF clr);
254 static COLORREF GetBackgroundColor();
255
256 static void SetBackgroundColorReadOnly(COLORREF clr);
257 static COLORREF GetBackgroundColorReadOnly();
258
259 static void SetBorderColorActive(COLORREF clr);
260 static COLORREF GetBorderColorActive();
261
262 static void SetTextColor(COLORREF clr);
263 static COLORREF GetTextColor();
264
265 static void SetTextColorReadOnly(COLORREF clr);
266 static COLORREF GetTextColorReadOnly();
267
268 protected:
269 virtual BOOL PreTranslateMessage(MSG* pMsg);
270
271 virtual BOOL CopyToClipboard(Base::CFLString<wchar_t> str);
272 virtual Base::CFLString<wchar_t> PasteFromClipboard();
273 virtual bool CheckValidInput(UINT nNewChar, int32_t i32Index, Base::CFLString<wchar_t> strExist) const;
274
275 protected:
276 EInputType m_eInputType;
277 Base::CFLString<wchar_t> m_cstrInvalidCharSet;
278 Base::CFLString<wchar_t> m_cstrValidCharSet;
279 CToolTipCtrl m_ToolTip;
280 Base::CFLString<wchar_t> m_cstrToolTipText;
281 CBrush m_brBackground;
282 CBrush m_brBackgroundReadOnly;
283 int32_t m_i32SelStart;
284 int32_t m_i32SelEnd;
285
286 static COLORREF m_clrBk;
287 static COLORREF m_clrBkReadOnly;
288 static COLORREF m_clrBorderActive;
289 static COLORREF m_clrText;
290 static COLORREF m_clrTextReadOnly;
291
292};
293
295 {
296 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) | static_cast<int32_t>(b));
297 }
298
300 {
301 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) & static_cast<int32_t>(b));
302 }
303
304 inline CGUIEditBase::EInputType operator~(CGUIEditBase::EInputType a)
305 {
306 return static_cast<CGUIEditBase::EInputType>(~static_cast<int32_t>(a));
307 }
308
309 inline bool operator!(CGUIEditBase::EInputType a)
310 {
311 return static_cast<bool>(!static_cast<int32_t>(a));
312 }
313 }
314}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1596
virtual ~CGUIEditBase()
Default destructor.
virtual int32_t GetValueAsInt32() const
Returns the value converted from the input value to integer(int32_t) type.
virtual EInputType GetInputType() const
Get the type of input values.
virtual DECLARE_MESSAGE_MAP() public void OnEditCut()
Function that is invoked by a paste event.
virtual Base::CFLString< wchar_t > GetValue() const
Get string value.
virtual double GetValueAsDouble() const
Returns the value converted from the input value to double type.
virtual const CResult SetValue(const Base::CFLString< wchar_t > &flstrValue)
A function that sets the input value, the value is modified and stored for the input type you set.
virtual int64_t GetValueAsInt64() const
Returns the value converted from the input value to integer(int64_t) type.
EInputType
Input type.
Definition GUIEditBase.h:39
@ EInputType_All
All type.
Definition GUIEditBase.h:47
@ EInputType_Int
Integer type.
Definition GUIEditBase.h:56
@ EInputType_Number
Number.
Definition GUIEditBase.h:83
@ EInputType_Float
Floating point type (including integer type)
Definition GUIEditBase.h:65
@ EInputType_UserDefined
User defined.
Definition GUIEditBase.h:101
@ EInputType_FileName
File name.
Definition GUIEditBase.h:74
@ EInputType_Alphabet
Alphabet.
Definition GUIEditBase.h:92
CGUIEditBase()
Default constructor.
virtual void SetToolTipText(Base::CFLString< wchar_t > cstrToolTipText)
Set the tooltip text.
virtual void SetUserDefinedInput(Base::CFLString< wchar_t > cstrInvalidCharSet, Base::CFLString< wchar_t > cstrValidCharSet)
Set the character set to be denied or accept input.
virtual void SetInputType(EInputType eInputType)
Specify the type of input values by EInputType.
Definition AESCryptography.h:18
Definition D2DObject.h:12