comparison anagram/guisupport/redmenudc.cpp @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
4 * See the file COPYING for license and usage terms.
5 *
6 * redmenudc.cpp
7 */
8
9 #include "cint.h"
10 #include "dc.h"
11 #include "q1glbl.h"
12 #include "redmenudc.h"
13 #include "stacks.h"
14 #include "token.h"
15 #include "ut.h"
16
17 //#define INCLUDE_LOGGING
18 #include "log.h"
19
20
21 static int reduction_menu_tabs[] = {7,0};
22
23 reduction_menu_dc::reduction_menu_dc(unsigned rn)
24 : dc("Select Reduction Token", AgString::format("Rule %d", rn))
25 {
26 int length;
27 int i, dw;
28 rule_number = rn;
29 //des->c_size = cursor_bar_size;
30
31 if (rn == 0) {
32 length = 0;
33 }
34 else {
35 length = ibnfn[rn];
36 }
37
38 for (i = dw = 0; i < length; i++) {
39 int tn = ibnfs[ibnfb[rn] + i];
40 int k;
41 ics();
42 atkn(tn);
43 k = reduction_menu_tabs[0] + rcs();
44 if (k > dw) {
45 dw = k;
46 }
47 }
48 tab_stops = reduction_menu_tabs;
49 des->d_size = cint(dw, length);
50 //manual_resize = 0;
51 //resize_window();
52 }
53
54 void reduction_menu_dc::getLine(unsigned ln) const {
55 unsigned tn;
56
57 tn = ibnfs[ibnfb[rule_number] + ln];
58 //ssprintf("T%03u: ", tn);
59 ssprintf("T%03u:\t", tn);
60 atkn(tn);
61 }
62