about summary refs log tree commit diff stats
path: root/src/LYForms.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1997-04-16 01:40:22 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1997-04-16 01:40:22 -0400
commite4409c408eedf320b8845cafdd62b664bec1afd8 (patch)
treeccce96259ffd0a5edf9dc05e49262aaf5854fd99 /src/LYForms.c
parent36a66292ee2ec3530d776892d22d6c5ace810ae0 (diff)
downloadlynx-snapshots-e4409c408eedf320b8845cafdd62b664bec1afd8.tar.gz
snapshot of project "lynx", label v2-7-1ac_0-6
Diffstat (limited to 'src/LYForms.c')
-rw-r--r--src/LYForms.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/LYForms.c b/src/LYForms.c
index 8474dc12..6385fc02 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -14,6 +14,11 @@
 
 #include "LYLeaks.h"
 
+#ifdef ALT_CHAR_SET
+#define BOXVERT 0   /* use alt char set for popup window vertical borders */
+#define BOXHORI 0   /* use alt char set for popup window vertical borders */
+#endif
+
 #ifndef BOXVERT
 #define BOXVERT '*'	/* character for popup window vertical borders */
 #endif
@@ -353,6 +358,27 @@ breakfor:
 }
 
 
+/* Use this rather than the 'wprintw()' function to write a blank-padded
+ * string to the given window, since someone's asserted that printw doesn't
+ * handle 8-bit characters unlike addstr (though more info would be useful).
+ *
+ * We're blank-filling so that with SVr4 curses, it'll show the background
+ * color to a uniform width in the popup-menu.
+ */
+#ifndef USE_SLANG
+PRIVATE void paddstr ARGS3(
+	WINDOW *,	the_window,
+	int,		width,
+	char *,		the_string)
+{
+	width -= strlen(the_string);
+	waddstr(the_window, the_string);
+	while (width-- > 0)
+		waddstr(the_window, " ");
+}
+#endif
+
+
 PRIVATE int popup_options ARGS7(
 	int,		cur_selection,
 	OptionType *,	list,
@@ -504,6 +530,13 @@ PRIVATE int popup_options ARGS7(
         return(orig_selection);
     }
     scrollok(form_window, TRUE);
+#ifdef NCURSES
+#ifdef wgetbkgd
+#define getbkgd(w) wgetbkgd(w)	/* workaround pre-1.9.9g bug */
+#endif
+    LYsubwindow(form_window);
+    wbkgd(form_window, getbkgd(stdscr));
+#endif
 #else
     SLsmg_fill_region (top, lx - 1, bottom - top, width + 4, ' ');
 #endif /* !USE_SLANG */
@@ -533,8 +566,7 @@ redraw:
         if (i >= window_offset && i - window_offset < length) {
 #ifndef USE_SLANG
 	    wmove(form_window,(i+1)-window_offset,2);
-	    wclrtoeol(form_window);
-	    waddstr(form_window,opt_ptr->name);
+	    paddstr(form_window, width, opt_ptr->name);
 #else
 	    SLsmg_gotorc (top + (i+1)-window_offset, lx - 1 + 2);
 	    SLsmg_write_nstring (opt_ptr->name, width);
@@ -564,7 +596,7 @@ redraw:
 	if (opt_ptr != NULL) {
 #ifndef USE_SLANG
 	    wmove(form_window,(i+1)-window_offset,2);
-            waddstr(form_window,opt_ptr->name);
+            paddstr(form_window, width, opt_ptr->name);
 #else
 	    SLsmg_gotorc (top + (i+1)-window_offset, lx - 1 + 2);
 	    SLsmg_write_nstring (opt_ptr->name, width);
@@ -579,7 +611,7 @@ redraw:
 #ifndef USE_SLANG
         wstart_reverse(form_window);
         wmove(form_window,(i+1)-window_offset,2);
-        waddstr(form_window,opt_ptr->name);
+        paddstr(form_window, width, opt_ptr->name);
         wstop_reverse(form_window);
         wrefresh(form_window);
 #else
@@ -1042,6 +1074,9 @@ restore_popup_statusline:
     }
 #ifndef USE_SLANG
     delwin(form_window);
+#ifdef NCURSES
+    LYsubwindow(0);
+#endif
 #endif /* !USE_SLANG */
     refresh();
 
href='/akkartik/mu/commit/063array.mu?h=main&id=51b0936fc78814134c2e90256fda6e048ba5244e'>51b0936f ^
502d2ea5 ^
4a48bedc ^

991d76f3 ^
502d2ea5 ^
9636c7ae ^

1ead3562 ^
9636c7ae ^
56e00e88 ^


65cec710 ^
56e00e88 ^
4a48bedc ^
56e00e88 ^




4a48bedc ^
56e00e88 ^







6f65d591 ^

56e00e88 ^
56e00e88 ^











6f65d591 ^


56e00e88 ^
56e00e88 ^










4a48bedc ^
6f65d591 ^

56e00e88 ^
56e00e88 ^












65cec710 ^
56e00e88 ^
4a48bedc ^
56e00e88 ^






6f65d591 ^


56e00e88 ^
56e00e88 ^













4a48bedc ^
56e00e88 ^













6f65d591 ^


56e00e88 ^
56e00e88 ^











6f65d591 ^


56e00e88 ^
56e00e88 ^










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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181