FLImaging 6.10.23.2
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:
113
121 virtual ~CGUIEditBase();
122
135
149 virtual const CResult SetValue(const Base::CFLString<wchar_t>& flstrValue);
150
160 virtual int32_t GetValueAsInt32() const;
161
171 virtual int64_t GetValueAsInt64() const;
172
182 virtual double GetValueAsDouble() const;
183
184 DECLARE_MESSAGE_MAP()
185 public:
193 virtual void OnEditPaste();
194
202 virtual void OnEditCut();
203
215 virtual void SetInputType(EInputType eInputType);
216
228 virtual EInputType GetInputType() const;
229
263 virtual void SetUserDefinedInput(const Base::CFLString<wchar_t>& flstrInvalidCharSet, const Base::CFLString<wchar_t>& flstrValidCharSet);
264
276 virtual void SetToolTipText(const Base::CFLString<wchar_t>& flstrToolTipText);
277
297 virtual void SetWindowTextKeepCaret(const Base::CFLString<wchar_t>& flstrText);
298
299 virtual void NotifyParentPropertyEditing();
300
301 static void SetBackgroundColor(COLORREF clr);
302 static COLORREF GetBackgroundColor();
303
304 static void SetBackgroundColorReadOnly(COLORREF clr);
305 static COLORREF GetBackgroundColorReadOnly();
306
307 static void SetBorderColorActive(COLORREF clr);
308 static COLORREF GetBorderColorActive();
309
310 static void SetTextColor(COLORREF clr);
311 static COLORREF GetTextColor();
312
313 static void SetTextColorReadOnly(COLORREF clr);
314 static COLORREF GetTextColorReadOnly();
315
316 protected:
317 virtual BOOL PreTranslateMessage(MSG* pMsg);
318
319 virtual BOOL CopyToClipboard(Base::CFLString<wchar_t> str);
320 virtual Base::CFLString<wchar_t> PasteFromClipboard();
321 virtual bool CheckValidInput(UINT nNewChar, int32_t i32Index, Base::CFLString<wchar_t> strExist) const;
322 virtual void DeletePreviousWord();
323
324 virtual const CResult SetValue(const Base::CFLString<wchar_t>& flstrValue, bool bRedraw);
325
326 protected:
327 EInputType m_eInputType;
328 Base::CFLString<wchar_t> m_flsInvalidCharSet;
329 Base::CFLString<wchar_t> m_flsValidCharSet;
330 CToolTipCtrl m_ToolTip;
331 Base::CFLString<wchar_t> m_flsToolTipText;
332 Base::CFLString<wchar_t> m_flsPendingValue;
333 CBrush m_brBackground;
334 CBrush m_brBackgroundReadOnly;
335 int32_t m_i32SelStart;
336 int32_t m_i32SelEnd;
337 bool m_bNeedToSetWindowText;
338
339 static COLORREF m_clrBk;
340 static COLORREF m_clrBkReadOnly;
341 static COLORREF m_clrBorderActive;
342 static COLORREF m_clrText;
343 static COLORREF m_clrTextReadOnly;
344
345 friend class CGUIPropertyItemText;
346
347 public:
348 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
349 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
350 afx_msg void OnDestroy();
351 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
352 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
353 };
354
356 {
357 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) | static_cast<int32_t>(b));
358 }
359
361 {
362 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) & static_cast<int32_t>(b));
363 }
364
365 inline CGUIEditBase::EInputType operator~(CGUIEditBase::EInputType a)
366 {
367 return static_cast<CGUIEditBase::EInputType>(~static_cast<int32_t>(a));
368 }
369
370 inline bool operator!(CGUIEditBase::EInputType a)
371 {
372 return static_cast<bool>(!static_cast<int32_t>(a));
373 }
374 }
375}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1631
virtual void OnEditPaste()
Function that is invoked by a paste event.
virtual ~CGUIEditBase()
Default destructor.
virtual void SetToolTipText(const Base::CFLString< wchar_t > &flstrToolTipText)
Set the tooltip text.
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 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.
virtual void SetUserDefinedInput(const Base::CFLString< wchar_t > &flstrInvalidCharSet, const Base::CFLString< wchar_t > &flstrValidCharSet)
Set the character set to be denied or accept input.
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
virtual void OnEditCut()
Function that is invoked by a cut event.
CGUIEditBase()
Default constructor.
virtual void SetWindowTextKeepCaret(const Base::CFLString< wchar_t > &flstrText)
Sets the edit control text while preserving the current caret (cursor) position.
virtual void SetInputType(EInputType eInputType)
Specify the type of input values by EInputType.
Definition AESCryptography.h:18
Definition D2DObject.h:12