SavvyUI C++ UI Library
Loading...
Searching...
No Matches
MaskedField.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
14class MaskedField : public Component
15{
16 wstring _mask;
17 wstring _text;
18 BOOL _isNumeric;
19 long _numericDecimalDigits;
20 BOOL _readOnly;
21
22protected:
23
27 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
28
33
34public:
35
40
44 virtual ~MaskedField();
45
50
51 void setReadOnly(BOOL readOnly);
52 BOOL isReadOnly();
53
59 void setNumeric(long decimalDigits);
60
67 BOOL isNumeric(long& decimalDigits);
68
79 void setMask(const wstring& mask);
80
86 wstring getMask();
87
93 void setText(const wstring& text);
94
100 wstring getText();
101
109 void onDataChanged(WinHandle hTarget, const wstring& newValue, const ProcParams& procParams);
110
117};
HWND WinHandle
Definition Common.h:16
Component()
Constructs a new Component instance.
Definition EventListeners.h:15
void setMask(const wstring &mask)
Sets the input mask for the field.
wstring getText()
Gets the current text value.
void onDataChanged(WinHandle hTarget, const wstring &newValue, const ProcParams &procParams)
Handles data changed events.
void windowCreated()
Called after the window is created.
MaskedField()
Constructs a MaskedField with no mask or text.
int getPreferredHeight()
Returns the preferred height.
virtual ~MaskedField()
Destructor.
void setText(const wstring &text)
Sets the text value of the field.
BOOL isReadOnly()
BOOL isNumeric(long &decimalDigits)
Checks if the field is numeric and outputs decimal digits count.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Provides window creation options for the masked input field.
void setNumeric(long decimalDigits)
Configures the field to accept numeric input only, with specified decimal digits.
void addDataChangedListener(DataChangeListener *l)
Adds a listener to receive data change notifications.
wstring getMask()
Retrieves the current mask.
void setReadOnly(BOOL readOnly)
Definition Component.h:9