-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPUXMTEXT.c
140 lines (129 loc) · 4.84 KB
/
PUXMTEXT.c
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
/*PUXMTEXT.c*/
#include "PKIN.h"
#include "PKINDLOG.h"
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
/*varible needed between inserttext and replacetext*/
static XmTextPosition position;
static long laststrlen;
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/****cleartexts()*************************************************************/
void cleartexts()
{
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
if(Lquiet==0) /*was Lcommanded before 990402*/
{
XmTextReplace(textwindow,
0,
XmTextGetLastPosition(textwindow),
" ");
/*reset text position*/
position = XmTextGetLastPosition(textwindow);
maxtextchar = 0;
}
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
}
/*___cleartexts()____________________________________________________________*/
/****inserttexts()************************************************************/
void inserttexts(char texts[256], int dummy)
{
dummy = dummy; /*PC uses 0 insert, 1 replace*/
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
if(Lquiet==0) /*was Lcommanded before 990402*/
{
if(!Limittext)
{
laststrlen = (long)strlen(texts);
maxtextchar = maxtextchar + laststrlen;
if(maxtextchar >= 32767L)
{
Limittext = 1;
printf("Text about to exceed 32767 characters, \n"
" no more text will be put into Text Window!\n");
}
else
{
position = XmTextGetLastPosition(textwindow);
XmTextInsert(textwindow, position, texts);
/*advance position*/
position = XmTextGetLastPosition(textwindow);
/*set laststrlength=0 as will not overwrite this new text*/
laststrlen = 0;
}
}
}
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
}
/*___inserttexts()___________________________________________________________*/
/****pkintextinsert()********************************************************/
void pkintextinsert(char texts[256])
{
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
if(Lquiet==0)
{
inserttexts(texts,0);
}
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
}
/*___pkintextinsert()________________________________________________________*/
/****pkintextreplace()********************************************************/
void pkintextreplace(char texts[256])
{/*does this from the last position set by inserttexts*/
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
if(Lquiet==0) /*was Lcommanded before 990402*/
{
if(!Limittext)
{
maxtextchar = maxtextchar - laststrlen + (long)strlen(texts);
if(maxtextchar >= 32767L)
{
Limittext = 1;
printf("Text about to exceed 32767 characters, \n"
" no more text will be put into Text Window!\n");
}
else
{
laststrlen = (long)strlen(texts);/*update*/
XmTextReplace(textwindow,
position,
XmTextGetLastPosition(textwindow),
texts);
/*position is end of last inserttext*/
}
}
}
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
}
/*___pkintextreplace()________________________________________________________*/
/****completetext()*********************************************************/
void completetext()
{
;
}
/*___completetext()________________________________________________________*/
/****adjusttext()*************************************************************/
void adjusttext(int iadjust)
{
#ifdef UNIX_MOTIF /*060324 re compile with NOGUI, requires Lquiet=1*/
if(Lquiet==0) /*was Lcommanded before 990402*/
{
XmTextScroll(textwindow,iadjust);
}
#endif /* UNIX_MOTIF 060324 re compile with NOGUI, requires Lquiet=1*/
/*this should NOT do any scrolling unless reach bottom of text window*/
/*so needs to check height and lines available, etc... */
}
/*___adjusttext()____________________________________________________________*/
/****getmactextselect()******************************************************/
void getmactextselect(void)
{
;
}
/*___getmactextselect()_____________________________________________________*/
/*PUXMTEXT.c*/
/****cleanuptextwindow()*****************************************************/
void cleanuptextwindow()
{
;
}
/*___cleanuptextwindow()____________________________________________________*/