-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathC3270Char.h
138 lines (119 loc) · 2.98 KB
/
C3270Char.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/***********************************************************
WinTN3270
Copyright © 2007 Bob Carroll ([email protected])
This software is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.
This software is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public
License along with this software; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA
***********************************************************/
#pragma once
namespace WinTN3270
{
/***********************************************************
Character object for 3270 terminals.
***********************************************************/
public ref class C3270Char
{
public: /* Public Enums */
ref class DisplayOptions
{
public:
static const int NormalNoLPDetect = 0;
static const int NormalLPDetect = 1;
static const int Bright = 2;
static const int Dark = 3;
};
private: /* Private Member Attributes */
wchar_t m_chInitChar;
wchar_t m_chChar;
bool m_fAutoSkip;
bool m_fModified;
bool m_fNumeric;
bool m_fProtected;
bool m_fStartField;
int m_nDisplay;
public: /* Public Properties */
property bool AutoSkip
{
bool get()
{
return m_fAutoSkip;
}
}
property wchar_t Character
{
wchar_t get()
{
return m_chChar;
}
void set(wchar_t chValue)
{
m_chChar = chValue;
}
}
property int Display
{
int get()
{
return m_nDisplay;
}
}
property bool Modified
{
bool get()
{
return m_fModified;
}
void set(bool fValue)
{
/* This is only for the field-start */
if (!m_fStartField)
return;
/* Flip bit 7 */
m_chChar = (fValue ? m_chChar | 0x01 : m_chChar & ~0x01);
m_fModified = fValue;
}
}
property int NumericOnly
{
int get()
{
return m_fNumeric;
}
}
property bool Protected
{
bool get()
{
return m_fProtected;
}
}
property bool StartField
{
bool get()
{
return m_fStartField;
}
}
private: /* Private Member Functions */
void UnserializeAttributes();
public: /* Public Member Functions */
C3270Char();
C3270Char(System::Byte chChar);
C3270Char(System::Byte chChar, bool fStartField);
void __Constructor(System::Byte chChar, bool fStartField);
System::Drawing::Brush^ GetPaintBrush();
System::Drawing::Brush^ GetPaintBrush(bool fBaseColor);
virtual System::String^ ToString() override;
System::String^ ToString(bool fMasked);
};
}