FLImaging 7.11.18.11
GUIEditBase.h
1#pragma once
2
10
11#include <afxwin.h>
12#include "GUIStyledCtrlBase.h"
13
15namespace FLImaging
16{
18 namespace GUI
19 {
27 class FL_EXPORT CGUIEditBase : public CEdit, public CGUIStyledCtrlBase
28 {
29 public:
40 {
49
58
67
76
85
94
103 };
104
105 public:
114
122 virtual ~CGUIEditBase();
123
136
150 virtual const CResult SetValue(const Base::CFLString<wchar_t>& flstrValue);
151
161 virtual int32_t GetValueAsInt32() const;
162
172 virtual int64_t GetValueAsInt64() const;
173
183 virtual double GetValueAsDouble() const;
184
185 DECLARE_MESSAGE_MAP()
186 public:
194 virtual void OnEditPaste();
195
203 virtual void OnEditCut();
204
216 virtual void SetInputType(EInputType eInputType);
217
229 virtual EInputType GetInputType() const;
230
264 virtual void SetUserDefinedInput(const Base::CFLString<wchar_t>& flstrInvalidCharSet, const Base::CFLString<wchar_t>& flstrValidCharSet);
265
279 virtual void SetPlaceholderText(const Base::CFLString<wchar_t>& flsPlaceholder);
280
292 virtual void SetToolTipText(const Base::CFLString<wchar_t>& flsToolTipText);
293
313 virtual void SetWindowTextKeepCaret(const Base::CFLString<wchar_t>& flstrText);
314
315 virtual void NotifyParentPropertyEditing();
316
317 virtual void SetTextAlignment(EGUIAlignment eAlign) override;
318
319 virtual void UpdateTheme();
320
321 virtual void SetFillColorNormal(COLORREF clr);
322 virtual COLORREF GetFillColorNormal();
323
324 virtual void SetFillColorReadOnly(COLORREF clr);
325 virtual COLORREF GetFillColorReadOnly();
326
327 virtual void SetBorderColorActive(COLORREF clr);
328 virtual COLORREF GetBorderColorActive();
329
330 virtual void SetTextColorNormal(COLORREF clr);
331 virtual COLORREF GetTextColorNormal();
332
333 virtual void SetTextColorReadOnly(COLORREF clr);
334 virtual COLORREF GetTextColorReadOnly();
335
336 static void SetGlobalFillColorNormal(COLORREF clr);
337 static COLORREF GetGlobalFillColorNormal();
338
339 static void SetGlobalFillColorReadOnly(COLORREF clr);
340 static COLORREF GetGlobalFillColorReadOnly();
341
342 static void SetGlobalBorderColorActive(COLORREF clr);
343 static COLORREF GetGlobalBorderColorActive();
344
345 static void SetGlobalTextColorNormal(COLORREF clr);
346 static COLORREF GetGlobalTextColorNormal();
347
348 static void SetGlobalTextColorReadOnly(COLORREF clr);
349 static COLORREF GetGlobalTextColorReadOnly();
350
351 protected:
352 virtual BOOL PreTranslateMessage(MSG* pMsg);
353
354 virtual BOOL CopyToClipboard(Base::CFLString<wchar_t> str);
355 virtual Base::CFLString<wchar_t> PasteFromClipboard();
356 virtual bool CheckValidInput(UINT nNewChar, int32_t i32Index, Base::CFLString<wchar_t> strExist) const;
357 virtual void DeletePreviousWord();
358
359 virtual const CResult SetValue(const Base::CFLString<wchar_t>& flstrValue, bool bRedraw);
360
361 protected:
362 EInputType m_eInputType;
363 Base::CFLString<wchar_t> m_flsInvalidCharSet;
364 Base::CFLString<wchar_t> m_flsValidCharSet;
365 CToolTipCtrl m_ToolTip;
366 Base::CFLString<wchar_t> m_flsPlaceholder;
367 Base::CFLString<wchar_t> m_flsToolTipText;
368 Base::CFLString<wchar_t> m_flsPendingValue;
369 int32_t m_i32SelStart;
370 int32_t m_i32SelEnd;
371 bool m_bNeedToSetWindowText;
372
373 CBrush m_brBackground;
374 CBrush m_brBackgroundReadOnly;
375
376 friend class CGUIPropertyItemText;
377
378 public:
379 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
380 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
381 afx_msg void OnDestroy();
382 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
383 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
384 };
385
387 {
388 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) | static_cast<int32_t>(b));
389 }
390
392 {
393 return static_cast<CGUIEditBase::EInputType>(static_cast<int32_t>(a) & static_cast<int32_t>(b));
394 }
395
396 inline CGUIEditBase::EInputType operator~(CGUIEditBase::EInputType a)
397 {
398 return static_cast<CGUIEditBase::EInputType>(~static_cast<int32_t>(a));
399 }
400
401 inline bool operator!(CGUIEditBase::EInputType a)
402 {
403 return static_cast<bool>(!static_cast<int32_t>(a));
404 }
405 }
406}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition FLImagingBase/ResultsDef.h:1739
virtual void OnEditPaste()
Function that is invoked by a paste event.
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 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 SetPlaceholderText(const Base::CFLString< wchar_t > &flsPlaceholder)
Sets the placeholder text to be displayed in the edit control when it is empty and does not have focu...
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:40
@ EInputType_All
All type.
Definition GUIEditBase.h:48
@ EInputType_Int
Integer type.
Definition GUIEditBase.h:57
@ EInputType_Number
Number.
Definition GUIEditBase.h:84
@ EInputType_Float
Floating point type (including integer type).
Definition GUIEditBase.h:66
@ EInputType_UserDefined
User defined.
Definition GUIEditBase.h:102
@ EInputType_FileName
File name.
Definition GUIEditBase.h:75
@ EInputType_Alphabet
Alphabet.
Definition GUIEditBase.h:93
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.
virtual void SetToolTipText(const Base::CFLString< wchar_t > &flsToolTipText)
Set the tooltip text.
Definition FLImagingBase/AESCryptography.h:18
Definition D2DObject.h:12
EGUIAlignment
Alignment information.
Definition FLImagingGUI/DefinitionsGUI.h:13960